Page MenuHomePhabricator

Bug 1562086 - Add percentage for opacity (i.e. <alpha-value>).
ClosedPublic

Authored by boris on Jul 9 2019, 10:34 PM.

Details

Summary

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

Diff Detail

Repository
rMOZILLACENTRAL mozilla-central
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

boris created this revision.Jul 9 2019, 10:34 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 9 2019, 10:34 PM
phab-bot requested review of this revision.Jul 9 2019, 10:34 PM
phab-bot changed the visibility from "Custom Policy" to "Public (No Login Required)".
phab-bot changed the edit policy from "Custom Policy" to "Restricted Project (Project)".
phab-bot removed a project: Restricted Project.
boris updated this revision to Diff 129601.Jul 9 2019, 10:35 PM
boris updated this revision to Diff 129625.Jul 9 2019, 11:38 PM
emilio accepted this revision.Jul 10 2019, 10:52 PM

Code-wise looks good to me, thanks!

servo/components/style/properties/longhands/box.mako.rs
606–607

Could you file an issue on the spec? Chances are this should really use <alpha-value>. Probably also link it here?

Not sure if it's worth holding off the patch on this issue. Your call.

servo/components/style/values/specified/mod.rs
434
This revision is now accepted and ready to land.Jul 10 2019, 10:52 PM
boris added inline comments.Jul 10 2019, 11:35 PM
servo/components/style/properties/longhands/box.mako.rs
606–607
boris marked 2 inline comments as done.Jul 10 2019, 11:47 PM
boris added inline comments.
servo/components/style/properties/longhands/box.mako.rs
606–607

Ok. I will hold this patch for one or two days. If there is no new comment on this issue, I will land this first.

boris updated this revision to Diff 130354.Jul 10 2019, 11:47 PM
boris updated this revision to Diff 131531.Jul 12 2019, 7:49 PM