Macquarie University
01whole.pdf (340.22 kB)

Attribute grammars: an executable specification for CSS layout

Download (340.22 kB)
posted on 2022-03-28, 15:23 authored by Scott Buckley
The World Wide Web is a technology used daily by billions of people internationally. The core technologies that make up the Web are specified by the World Wide Web Consortium, and implemented independently by various organisations in the form of web browsers, which are tools to retrieve and view HTML/CSS documents. The task of retrieving, parsing, and rendering an HTML document is very important and very complex. The specification that defines how an HTML page should be rendered (CSS) is more than 150,000 words long. It is well known that all web browsers render HTML differently in subtle ways, and we argue that the size and non-deterministic nature of the specification contributes to this problem. This project demonstrates a new method of a) describing the CSS specification, and b) implementing a CSS-compliant HTML renderer, that employs dynamic attribute grammars to achieve both tasks. Attribute grammars assist in specification by describing the relation-ship between the Document Object Model and its visual representation deterministically, and greatly reduce the gap between specification and implementation by writing the specification in an executable format. Furthermore, we show informally that this executable specification is human-readable, which we argue is because attribute grammars are the natural language to describe CSS.


Table of Contents

1. Introduction -- 2. Related work -- 3. Why CSS needs attribute grammars -- 4. CSS layout with attribute grammars -- 5. Evaluation -- 6. Conclusion.


Bibliography: pages 49-51 Theoretical thesis.

Awarding Institution

Macquarie University

Degree Type

Thesis MRes


MRes, Macquarie University, Faculty of Science and Engineering, Department of Computing

Department, Centre or School

Department of Computing

Year of Award


Principal Supervisor

Matthew Roberts


Copyright Scott Buckley 2014. Copyright disclaimer:




1 online resource (viii, 51 pages)

Former Identifiers