Repository landing page

We are not able to resolve this OAI Identifier to the repository landing page. If you are the repository manager for this record, please head to the Dashboard and adjust the settings.

CSS Minification via Constraint Solving

Abstract

Minification is a widely-accepted technique which aims at reducing the size ofthe code transmitted over the web. This paper concerns the problem ofsemantic-preserving minification of Cascading Style Sheets (CSS) --- the defacto language for styling web documents --- based on merging similar rules.The cascading nature of CSS makes the semantics of CSS files sensitive to theordering of rules in the file. To automatically identify rule-mergingopportunities that best minimise file size, we reduce the rule-merging problemto a problem concerning ``CSS-graphs'', i.e., node-weighted bipartite graphswith a dependency ordering on the edges, where weights capture the number ofcharacters.Constraint solving plays a key role in our approach. Transforming a CSS file intoa CSS-graph problem requires us to extract the dependency ordering on the edges (an NP-hard problem), which requires us to solve the selector intersectionproblem. To this end, we provide the first full formalisation of CSS3 selectors(the most stable version of CSS) and reduce their selector intersection problemto satisfiability of quantifier-free integer linear arithmetic, for whichhighly-optimised SMT-solvers are available. To solve the above NP-hard graphoptimisation problem, we show how Max-SAT solvers can be effectively employed. We have implemented our rule-merging algorithm, and tested it against approximately 70 real-world examples (including examples from each of the top 20 most popular websites).We also used our benchmarks to compare our tool against six well-known minifiers (which implement other optimisations). Our experiments suggest that our tool produced larger savings. A substantially better minification rate was shown when our tool is used together with these minifiers

Similar works

This paper was published in Royal Holloway - Pure.

Having an issue?

Is data on this page outdated, violates copyrights or anything else? Report the problem now and we will take corresponding actions after reviewing your request.