style: Add percentage for opacity (i.e. <alpha-value>).

The following properties accept <alpha-value> [1], which is
"<number> | <percentage>", so we update the parser, spec links, and
their web-platform-tests.
1. opacity
2. flood-opacity
3. fill-opacity
4. stroke-opacity
5. stop-opacity
6. -moz-window-opacity

Besides, shape-image-threshold [2] still only accepts <number>, so we need
to support a different version of `Opacity::parse()`.

[1] https://drafts.csswg.org/css-color/#typedef-alpha-value
[2] https://drafts.csswg.org/css-shapes/#shape-image-threshold-property

Differential Revision: https://phabricator.services.mozilla.com/D37493
This commit is contained in:
Boris Chiou 2019-07-12 19:49:32 +00:00 committed by Emilio Cobos Álvarez
parent 65bf72f131
commit 87231e676d
No known key found for this signature in database
GPG key ID: E1152D0994E4BF8A
5 changed files with 43 additions and 14 deletions

View file

@ -601,8 +601,10 @@ ${helpers.predefined_type(
spec="https://drafts.csswg.org/css-will-change/#will-change",
)}
// The spec issue for the parse_method: https://github.com/w3c/csswg-drafts/issues/4102.
${helpers.predefined_type(
"shape-image-threshold", "Opacity", "0.0",
parse_method="parse_number",
products="gecko",
animation_value_type="ComputedValue",
spec="https://drafts.csswg.org/css-shapes/#shape-image-threshold-property",

View file

@ -13,7 +13,7 @@ ${helpers.predefined_type(
"1.0",
animation_value_type="ComputedValue",
flags="CREATES_STACKING_CONTEXT CAN_ANIMATE_ON_COMPOSITOR",
spec="https://drafts.csswg.org/css-color/#opacity",
spec="https://drafts.csswg.org/css-color/#transparency",
servo_restyle_damage = "reflow_out_of_flow",
)}

View file

@ -52,7 +52,7 @@ ${helpers.predefined_type(
"Default::default()",
products="gecko",
animation_value_type="ComputedValue",
spec="https://www.w3.org/TR/SVG11/painting.html#FillOpacityProperty",
spec="https://svgwg.org/svg2-draft/painting.html#FillOpacity",
)}
${helpers.predefined_type(
@ -123,7 +123,7 @@ ${helpers.predefined_type(
"Default::default()",
products="gecko",
animation_value_type="ComputedValue",
spec="https://www.w3.org/TR/SVG11/painting.html#StrokeOpacityProperty",
spec="https://svgwg.org/svg2-draft/painting.html#StrokeOpacity",
)}
${helpers.predefined_type(

View file

@ -40,7 +40,7 @@ ${helpers.predefined_type(
"1.0",
products="gecko",
animation_value_type="ComputedValue",
spec="https://www.w3.org/TR/SVGTiny12/painting.html#propdef-stop-opacity",
spec="https://svgwg.org/svg2-draft/pservers.html#StopOpacityProperty",
)}
// Section 15 - Filter Effects
@ -60,7 +60,7 @@ ${helpers.predefined_type(
"1.0",
products="gecko",
animation_value_type="ComputedValue",
spec="https://www.w3.org/TR/SVG/filters.html#FloodOpacityProperty",
spec="https://drafts.fxtf.org/filter-effects/#FloodOpacityProperty",
)}
${helpers.predefined_type(