ABSTRACT
Cascading Style Sheets (CSS) is a popular language for describing the styles of XML documents as well as HTML documents. For a DTD D and a list R of CSS rules, due to specificity R may contain “unsatisfiable” rules under D, e.g., rules that are not applied to any element of any document valid to D. In this paper, we consider the problem of detecting unsatisfiable CSS rules under DTDs. We focus on CSS fragments in which descendant, child, adjacent sibling, and general sibling combinators are allowed. We show that the problem is coNP-hard in most cases, even if only one of the four combinators is allowed. We also show that the problem is in coNP or PSPACE depending on restrictions on DTDs and CSS. Finally, we present two conditions under which the problem can be solved in polynomial time.
References
- Michael Benedikt, Wenfei Fan, and Floris Geerts. 2008. XPath Satisfiability in the Presence of DTDs. J. ACM 55, 2, Article 8 (May 2008), 8:1–8:79 pages.Google Scholar
Digital Library
- Martí Bosch, Pierre Genevès, and Nabil Layaïida. 2014. Automated Refactoring for Size Reduction of CSS Style Sheets. In Proceedings of the 2014 ACM Symposium on Document Engineering (DocEng ’14). 13–16. Google Scholar
Digital Library
- Anne Brüggenmann-Klein. 1993. Regular expressions into finite automata. Theoretical Computer Science 120, 2 (1993), 197–213. Google Scholar
Digital Library
- M.R. Garey and D.S. Johnson. 1979. Computers and Intractability - A Guide to the Theory of NP-Completeness. W.H. Freeman. Google Scholar
Digital Library
- Pierre Geneves, Nabil Layaida, and Vincent Quint. 2012. On the Analysis of Cascading Style Sheets. In Proceedings of the 21st International Conference on World Wide Web (WWW ’12). 809–818. Google Scholar
Digital Library
- V. M. Glushkov. 1961. The Abstract Theory of Automata. Russian Math. Surveys 16 (1961), 1–53.Google Scholar
Cross Ref
- Matthew Hague, Anthony W. Lin, and C.-H. Luke Ong. 2015. Detecting Redundant CSS Rules in HTML5 Applications: A Tree Rewriting Approach. SIGPLAN Not. 50, 10 (Oct. 2015), 1–19.Google Scholar
- Yasunori Ishihara, Nobutaka Suzuki, Kenji Hashimoto, Shougo Shimizu, and Toru Fujiwara. 2013. XPath Satisfiability with Parent Axes or Qualifiers Is Tractable under Many of Real-World DTDs. In Proceedings of the 14th International Symposium on Database Programming Languages (DBPL 2013), August 30, 2013, Riva del Garda, Trento, Italy.Google Scholar
- Davood Mazinanian and Nikolaos Tsantalis. 2016. Migrating Cascading Style Sheets to Preprocessors by Introducing Mixins. In Proceedings of the 31st IEEE/ACM International Conference on Automated Software Engineering (ASE 2016). 672–683. Google Scholar
Digital Library
- Davood Mazinanian, Nikolaos Tsantalis, and Ali Mesbah. 2014. Discovering Refactoring Opportunities in Cascading Style Sheets. In Proceedings of the 22Nd ACM SIGSOFT International Symposium on Foundations of Software Engineering (FSE 2014). 496–506. Google Scholar
Digital Library
- Ali Mesbah and Shabnam Mirshokraie. 2012. Automated Analysis of CSS Rules to Support Style Maintenance. In Proceedings of the 34th International Conference on Software Engineering (ICSE ’12). 408–418.Google Scholar
Digital Library
- Manizheh Montazerian, Peter T. Wood, and Seyed R. Mousavi. 2007. XPath Query Satisfiability is in PTIME for Real-world DTDs. In Proceedings of the 5th International Conference on Database and XML Technologies (XSym’07). 17–30. Google Scholar
Digital Library
- H. Yamada R. McNaughton. 1960. Regular expressions and state graphs for automata. IRA Trans. Electron. Comput. EC-9, 1 (1960), 39–47.Google Scholar
Cross Ref
- L. J. Stockmeyer and A. R. Meyer. 1973. Word Problems Requiring Exponential Time(Preliminary Report). In Proceedings of the Fifth Annual ACM Symposium on Theory of Computing (STOC ’73). 1–9.Google Scholar
- Nobutaka Suzuki, Yuji Fukushima, and Kosetsu Ikeda. 2013. Satisfiability of Simple XPath Fragments under Duplicate-Free DTDs. IEICE Transactions 96-D, 5 (2013), 1029–1042.Google Scholar
Index Terms
Detecting unsatisfiable CSS rules in the presence of DTDs





Comments