Proceedings

Reasoning with Style

Download BibTeX Cite

Proceedings of the Twenty-Fourth International Joint Conference on Artificial Intelligence. Main Track. Pages 2227-2232.

Abstract

The Cascading Style Sheets (CSS) language constitutes a key component of web applications. It offers a series of sophisticated features to stylize web pages. Its apparent simplicity and power are however counter-balanced by the difficulty of debugging and maintaining style sheets, tasks for which developers still lack appropriate tools. In particular, significant portions of CSS code become either useless or redundant, and tend to accumulate over time. The situation becomes even worse as more complex features are added to the CSS language (e.g. CSS3 powerful selectors). A direct consequence is a waste of CPU that is required to display web pages, as well as the significant amount of useless traffic at web scale. Style sheets are designed to operate on a set of documents (possibly generated). However, existing techniques consist in syntax validators, optimizers and runtime debuggers that operate in one particular document instance. As such, they do not provide guarantees concerning all web pages in CSS refactoring, such as preservation of the formatting. This is partly because they are essentially syntactic and do not take advantage of CSS semantics to detect redundancies. We propose a set of automated refactoring techniques aimed at removing redundant and inaccessible declarations and rules, without affecting the layout of any document to which the style sheet is applied. We implemented a prototype that has been extensively tested with popular web sites (such as Google Sites, CNN, Apple, etc.). We show that significant size reduction can be obtained while preserving the code readability and improving maintainability.

  1. [Benson and Karger, 2013] Edward Benson and David R. Karger. Cascading tree sheets and recombinant HTML: better encapsulation and retargeting of web content. In WWW'13, pages 107-118, 2013.
  2. [Benson, 2013] Edward Benson. Mockup driven web devel- opment. In Proceedings of the 22nd International Confer- ence on World Wide Web Companion, WWW '13 Com- panion, pages 337-342, 2013.
  3. [C ¸elik et al., 2011] Tantek C ¸elik, Elika J. Etemad, Daniel Glazman, Ian Hickson, Peter Linss, and John Williams. Selectors level 3. W3C recommendation, World Wide Web Consortium, September 2011.
  4. [Consortium, 2014] World Wide Web Consor- tium. CSS specifications, November 2014. http://www.w3.org/Style/CSS/current-work. Link
  5. [Genevès et al., 2007] Pierre Genevès, Nabil Layaïda, and Alan Schmitt. Efficient static analysis of XML paths and types. In PLDI '07, pages 342-351, 2007.
  6. [Genevès et al., 2012] Pierre Genevès, Nabil Layaïda, and Vincent Quint. On the analysis of cascading style sheets. In WWW'12, pages 809-818, 2012.
  7. [Genevès et al., 2015] Pierre Genevès, Nabil Layaïda, Alan Schmitt, and Nils Gesbert. Efficiently Deciding µ- Calculus with Converse over Finite Trees. ACM Trans- actions on Computational Logic, 16(2), 2015.
  8. [Google, 2014] Google. Chrome Developer Tools, Novem- ber 2014. https://developer.chrome.com/devtools/. Link
  9. [Keller and Nussbaumer, 2009] Matthias Keller and Martin Nussbaumer. Cascading style sheets: a novel approach towards productive styling with today's standards. In Pro- ceedings of the 18th international conference on World wide web, WWW '09, pages 1161-1162, 2009.
  10. [Keller and Nussbaumer, 2010] Matthias Keller and Martin Nussbaumer. CSS code quality: A metric for abstractness. In Seventh International Conference on the Quality of Information and Communications Technology (QUATIC), pages 116-121, October 2010.
  11. [Liang et al., 2013] Hsiang-Sheng Liang, Kuan-Hung Kuo, Po-Wei Lee, Yu-Chien Chan, Yu-Chin Lin, and Mike Y. Chen. SeeSS: Seeing what i broke -visualizing change impact of cascading style sheets (CSS). In UIST'13, pages 353-356, 2013.
  12. [Lie, 2005] Hkon Wium Lie. Cascading style sheets. Phd thesis, Faculty of Mathematics and Natural Sciences, Uni- versity of Oslo, 2005.
  13. [Marden and Munson, 1999] Philip M. Marden and Ethan V. Munson. Today's style sheet standards: the great vision blinded. Computer, 32(11):123-125, nov 1999.
  14. [Mazinanian et al., 2014] Davood Mazinanian, Nikolaos Tsantalis, and Ali Mesbah. Discovering refactoring opportunities in cascading style sheets. In Proceedings of the ACM SIGSOFT International Symposium on the Foundations of Software Engineering (FSE), page 11 pages, 2014.
  15. [Mesbah and Mirshokraie, 2012] Ali Mesbah and Shabnam Mirshokraie. Automated analysis of CSS rules to support style maintenance. In ICSE'12, pages 408-418, 2012.
  16. [Meyerovich and Bodik, 2010] Leo A. Meyerovich and Rastislav Bodik. Fast and parallel webpage layout. In Proceedings of the 19th International Conference on World Wide Web, WWW '10, pages 711-720, 2010.
  17. [Mozilla, 2014] Mozilla. Firebug, November 2014. https://getfirebug.com/. [Opera, 2014] Opera. Opera Dragonfly, November 2014. http://www.opera.com/dragonfly/. Link
  18. [Quint and Vatton, 2007] Vincent Quint and Irène Vatton. Editing with style. In Proceedings of the 2007 ACM symposium on Document engineering, DocEng '07, pages 151-160, 2007.
  19. [Sinha and Karim, 2013] Nishant Sinha and Rezwana Karim. Compiling mockups to flexible uis. In Proceed- ings of the 2013 9th Joint Meeting on Foundations of Software Engineering, pages 312-322, 2013.

References were extracted automatically from the PDF and may contain errors.

Welcome Future Conferences AI Journal Division IJCAI Proceedings About IJCAI IJCAI Awards