Detecting Redundant CSS Rules in HTML5 Applications: A Tree-Rewriting Approach
Matthew Hague, Anthony Widjaja Lin, Luke Ong

TL;DR
This paper presents a novel static analysis method based on tree-rewriting to detect redundant CSS rules in HTML5 applications, accounting for dynamic behaviors and improving maintenance and performance.
Contribution
It introduces a formal model of HTML5 applications using monotonic tree-rewriting, analyzes the redundancy problem's complexity, and develops an efficient algorithm for practical detection of redundant CSS rules.
Findings
The redundancy problem is precisely characterized and its complexity established.
An efficient reduction to symbolic pushdown system analysis enables practical detection.
Experimental results demonstrate the algorithm's effectiveness in real HTML5 applications.
Abstract
HTML5 applications normally have a large set of CSS (Cascading Style Sheets) rules for data display. Each CSS rule consists of a node selector (given in an XPath-like query language) and a declaration block (assigning values to selected nodes' display attributes). As web applications evolve, maintaining CSS files can easily become problematic. Some CSS rules will be replaced by new ones, but these obsolete (hence redundant) CSS rules often remain in the applications. Not only does this "bloat" the applications, but it also significantly increases web browsers' processing time. Most works on detecting redundant CSS rules in HTML5 applications do not consider the dynamic behaviors of HTML5 (specified in JavaScript); in fact, the only proposed method that takes these into account is dynamic analysis (a.k.a. testing), which cannot soundly prove redundancy of CSS rules. In this paper, we…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsAdvanced Malware Detection Techniques · Web Application Security Vulnerabilities · Software Testing and Debugging Techniques
