10.1145/3315507.3330195acmconferencesArticle/Chapter ViewAbstractPublication PagessplashConference Proceedings
research-article

Detecting unsatisfiable CSS rules in the presence of DTDs

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

  1. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  2. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  3. Anne Brüggenmann-Klein. 1993. Regular expressions into finite automata. Theoretical Computer Science 120, 2 (1993), 197–213. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. M.R. Garey and D.S. Johnson. 1979. Computers and Intractability - A Guide to the Theory of NP-Completeness. W.H. Freeman. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  6. V. M. Glushkov. 1961. The Abstract Theory of Automata. Russian Math. Surveys 16 (1961), 1–53.Google ScholarGoogle ScholarCross RefCross Ref
  7. 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 ScholarGoogle Scholar
  8. 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 ScholarGoogle Scholar
  9. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  10. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  11. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  12. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  13. H. Yamada R. McNaughton. 1960. Regular expressions and state graphs for automata. IRA Trans. Electron. Comput. EC-9, 1 (1960), 39–47.Google ScholarGoogle ScholarCross RefCross Ref
  14. 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 ScholarGoogle Scholar
  15. 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 ScholarGoogle Scholar

Index Terms

  1. Detecting unsatisfiable CSS rules in the presence of DTDs

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in
      • Article Metrics

        • Downloads (Last 12 months)40
        • Downloads (Last 6 weeks)2

        Other Metrics

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader
      About Cookies On This Site

      We use cookies to ensure that we give you the best experience on our website.

      Learn more

      Got it!