Pierre Genevès, CNRS
Nabil Layaïda, INRIA
Vincent Quint, INRIA
LIG Laboratory and INRIA Grenoble, France
International Conference on World Wide Web, April 2012
|
|
CSS appears very simple at first sight:
CSS has intricate facets:
div p.contents ~ img
:nth-child(even)
Web designers' heaven... but web developpers' hell
Today, CSS debugging technique = testing
What would be "correctness" for CSS anyway?
What would be an "incorrect" CSS?
Main objective: Find analysis methods that
Main difficulties
Possible outputs:
|
Chosen logic:
Required adaptations:
XML trees are seen as labeled binary trees (wlog)
Programs $\alpha \in \{ 1, 2, \overline{1}, \overline{2}\}$ for navigation
A formula can be:
Sample CSS rule: | div p {color: red;} |
Logical formula: | $p \wedge \langle\text{color}\rangle \text{'red'} \wedge \mu X. \langle\overline{1}\rangle\text{div} \vee \langle\overline{2}\rangle X \vee \langle \overline{1}\rangle X$ |
Main principles:
Sample CSS
|
|
$\left.\begin{array}{l}
\phi_\text{prop}(\text{<}\text{font-size}\text{>}\text{'8px'})\\
\phi_\text{CSS}(\text{<}\text{font-size}\text{>}) \\
\phi_\text{Schema} \end{array}\right\} \phi$
|
|
|
Sample CSS
|
|
$\left.\begin{array}{l}
\phi_\text{prop}(\text{<}\text{font-size}\text{>}\text{'8px'})\\
\phi_\text{CSS}(\text{<}\text{font-size}\text{>}) \\
\phi_\text{Schema} \end{array}\right\} \phi$
|
|
|
There does not exist any document for which the font-size may go too small.
Sample CSS
|
|
$\left.\begin{array}{l}
\phi_\text{prop}(\text{<}\text{color}\text{>},\text{<}\text{bg-color}\text{>})\\
\phi_\text{CSS}(\text{<}\text{color}\text{>},\text{<}\text{bg-color}\text{>})
\\ \phi_\text{Schema} \end{array}\right\} \phi$
|
|
|
Further information:
Web site: | http://wam.inrialpes.fr/websolver |
These slides: | http://wam.inrialpes.fr/talks/2012/WWW12/slides.htm |
Email: | pierre.geneves@inria.fr |
cases1-3(v,p) $\stackrel{\text{def}}{=} \left\{\begin{array}{ll} \langle p\rangle \text{'}v\text{'} \vee \neg \langle p\rangle \text{'}v\text{'} \wedge \neg \langle p\rangle \text{'inherit'} \wedge \text{initialvalue}(p,v) \\ ~~\vee \langle p\rangle \text{'inherit'} \wedge \neg \langle\overline{1}\rangle \top \wedge \neg \langle\overline{2}\rangle \top \wedge \text{initialvalue}(p,v)\end{array}\right.$ |
$\text{initialvalue}(p,v) \stackrel{\text{def}}{=}p$ has initial value $v$ (cf. CSS recommendation) |
obtained(v,p) $\stackrel{\text{def}}{=} $ cases1-3(v,p) $\vee \langle p\rangle \text{'inherit'} \wedge $ $\mu X. \langle \overline{1}\rangle\big($ cases1-3(v,p) $\vee \langle p\rangle \text{'inherit'} \wedge X \big) \vee \langle\overline{2}\rangle X$ |