DescriptionMake SVGLength wrap a CSSPrimitiveValue.
This patch is needed to facilitate improvements to SVG attribute parsing, in turn demanded by the reconciliation of CSS and SVG attributes and properties from the SVG 2.0 spec. One parser to rule them all is a better approach than writing SVG specific parsers for what are essentially the same types as CSS.
The only significant difference between the primitive types in CSS and SVG are related to dimensionless lengths, those for which the user defines no units, just a number. In CSS these are disallowed except when in quirks mode, while for SVG a pure number is considered in "user units" (see http://www.w3.org/TR/SVG/types.html#InterfaceSVGLength). Basically, the user could be using their own dimensioning system and rather than defining some kind of customization method, the spec just assumes things without units are the user's responsibility. This works because the SVG viewport defines the mapping from SVG user units into document units.
To address this difference, we add a new CSSPrimitive UnitType for SVG user units and assign it to lengths created in SVG parsing mode that have no other unit.
R=fs@opera.com,pdr@chromium.org,timloh@chromium.org
BUG=467464
Committed: https://crrev.com/13b78a5ac7b5c84c3cc12e7b1a1b07620f0a3f98
Cr-Commit-Position: refs/heads/master@{#358153}
Patch Set 1 #
Total comments: 2
Patch Set 2 : SVG Only Unitless length parsing #Patch Set 3 : Reviewable version #
Total comments: 5
Patch Set 4 : Review comments addressed #
Total comments: 9
Patch Set 5 : Fixed the initial types on properties #
Total comments: 29
Patch Set 6 : Review comments and tests addressed #
Total comments: 4
Patch Set 7 : Rebased TestExpectations #Patch Set 8 : Fix crashes. #Patch Set 9 : Error on calc and invalid types #Patch Set 10 : Added expectation #Messages
Total messages: 72 (26 generated)
|