Commit Graph

3 Commits

Author SHA1 Message Date
Bastian Neumann
7d63b8b95f LibWeb/CSS: Remove nullpointer dereference in Parser
On platinenmacher.tech there is a document without a window. During
size attribute parsing the window pointer is dereferenced which
causes a crash. This checks for the window to be actually there
before dereferencing.
2024-01-09 18:38:16 +00:00
Sam Atkins
79a30c209d LibWeb: Add SVG-presentation-attribute-parsing mode to CSS parser
When parsing these, <number> is allowed anywhere that would usually
allow a <length>, <length-percentage>, or <angle>. The spec is not
clear on exactly how this should work
(see https://github.com/w3c/svgwg/issues/792 ) so I'm using some
artistic license until things are clearer:
- If we expected a <length>, treat the <number> as pixels.
- If we expected an <angle>, treat the <number> as degrees.
- Only allow direct <number> tokens, not calc() or other functions.

From what I can tell this is what the spec *intended* but I may be very
wrong. In any case, telling the ParsingContext whether we're parsing
one of these attributes is a cleaner approach and more correct than
temporarily enabling quirks mode, which we did previously.
2023-09-26 20:01:55 +02:00
Ali Mohammad Pur
06c6c40df9 LibWeb+LibJS: Move some code around to make CSS/Parser parse faster
This makes it possible to include fewer full definitions of things,
which makes the file about 30% faster to compile.
2023-07-11 09:38:37 +03:30