Detecting redundant CSS rules in HTML5 applications: a tree rewriting approach

Detecting redundant CSS rules in HTML5 applications: a tree rewriting approach
复制标题

检测 HTML5 应用程序中的冗余 CSS 规则:树重写方法

DOI:
10.1145/2814270.2814288
复制
发表时间:
2014
期刊:
Proceedings of the 2015 ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and Applications
影响因子:
--
通讯作者:
C. Ong
C. Ong
中科院分区:
--
文献类型:
--
作者:
M. Hague;A. Lin;C. Ong

文献摘要

参考文献

被引文献

相似文献

HTML5 应用程序通常有大量 CSS(层叠样式表)规则用于数据显示。每个 CSS 规则都包含一个节点选择器和一个声明块(为所选节点的显示属性分配值)。随着 Web 应用程序的发展,维护 CSS 文件很容易成为问题。一些 CSS 规则将被新规则取代,但这些过时(因此冗余)的 CSS 规则通常保留在应用程序中。这不仅使应用程序“膨胀”——增加了带宽需求——而且还显着增加了网络浏览器的处理时间。大多数检测 HTML5 应用程序中冗余 CSS 规则的工作都没有考虑 HTML5 的动态行为(在 JavaScript 中指定);事实上,唯一提出的考虑这些的方法是动态分析,它不能可靠地证明 CSS 规则的冗余。在本文中,我们介绍了基于单调树重写的HTML5应用程序的抽象,并研究了其“冗余问题”。我们确定问题的精确复杂性以及具有实际重要性的各种子问题(范围从 P 到 EXP)。特别是,我们的算法依赖于对符号下推系统(可使用高度优化的求解器)分析的有效简化,这产生了一种在实践中检查冗余的快速方法。我们实现了我们的算法并证明了其在检测 HTML5 应用程序中冗余 CSS 规则方面的功效。
HTML5 applications normally have a large set of CSS (Cascading Style Sheets) rules for data display. Each CSS rule consists of a node selector and a declaration block (which assigns 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 – increasing the bandwidth requirement – but it also significantly increases web browsers' processing time. Most works on detecting redundant CSS rules in HTML5 applications do not consider the dynamic behaviours of HTML5 (specified in JavaScript); in fact, the only proposed method that takes these into account is dynamic analysis, which cannot soundly prove redundancy of CSS rules. In this paper, we introduce an abstraction of HTML5 applications based on monotonic tree-rewriting and study its "redundancy problem". We establish the precise complexity of the problem and various subproblems of practical importance (ranging from P to EXP). In particular, our algorithm relies on an efficient reduction to an analysis of symbolic pushdown systems (for which highly optimised solvers are available), which yields a fast method for checking redundancy in practice. We implemented our algorithm and demonstrated its efficacy in detecting redundant CSS rules in HTML5 applications.
值得信赖的机械化 JavaScript 规范
DOI: 10.1145/2535838.2535876
发表时间: 2014
期刊: --
影响因子: --
作者:
Bodin M
通讯作者: Bodin M
通过地面树重写系统细化进程重写系统层次结构
DOI: 10.1145/2629679
发表时间: 2014
影响因子: 0.5
作者:
Göller S
通讯作者: Göller S