Commit graph

7 commits

Author SHA1 Message Date
davidot
1ab6cb1ee9 LibWeb: Make SVG::AttributeParser use the new double parser
Because the result will be a float anyway get rid of the int parsing.
Also the grammar of SVG numbers matches the double parser grammar except
it can't have a sign but that should have been checked by the caller.
2022-10-23 15:48:45 +02:00
Simon Danner
f7dbcb652a LibWeb: SVG parse signed numbers in eliptical arc 2022-02-21 16:32:24 +01:00
Sam Atkins
44b64cb8b0 LibWeb: Make SVG AttributeParser::parse_path_data() static
This is mostly a style thing, but it matches the other APIs.
2022-02-11 21:38:27 +01:00
Sam Atkins
ab440b3e50 LibWeb: Use StringView instead of String in SVG::AttributeParser
This saves copying the string data, since the AttributeParser is always
temporary.
2022-02-11 21:38:27 +01:00
Sam Atkins
116a1f485c LibWeb: Add SVG <polyline> element and test case :^) 2022-02-11 21:38:27 +01:00
Sam Atkins
9424c67ed5 LibWeb: Expose SVG length/coordinate parsing methods
This is all still quite ad-hoc. Eventually these will both need to
support units (like with CSS Lengths) but for now we can continue only
using numbers.
2022-02-11 21:38:27 +01:00
Sam Atkins
82308fb71a LibWeb: Move SVG::PathDataParser into its own file and rename it
I've chosen the name `AttributeParser` since it parses data from
attributes. Rather than duplicate the parsing of numbers and other
basic types, let's make use of this existing parsing code for parsing
the data for `<line>`, `<polyline>`, etc.
2022-02-11 21:38:27 +01:00