Why fixing something that isn't broken and a well established standard for something longer? 50% = five chars, .5 is two. 47.5% must be parsed and truncated, .47 is already in the right type.
Also, % values in CSS are most of the time based on the cascading or element scope related. If the parent element is already at opacity: .5, would a opacity:50% makes it .5 or .25 ? I honestly think we have bigger fish to catch... Le mercredi 10 juillet 2019 01:30:36 UTC+2, Boris Chiou a écrit : > Hi, > > Summary: Per the recent discussion of the spec, we would like to add > <percentage> to opacity related properties. The following properties will > support not only <number> but also <percentage>: > 1. opacity <https://drafts.csswg.org/css-color/#propdef-opacity> > 2. flood-opacity > <https://drafts.fxtf.org/filter-effects/#FloodOpacityProperty> > 3. fill-opacity <https://drafts.fxtf.org/fill-stroke/#fill-opacity> (also > in SVG2 <https://svgwg.org/svg2-draft/painting.html#FillOpacity>) > 4. stroke-opacity <https://drafts.fxtf.org/fill-stroke/#stroke-opacity> > (also in SVG2 <https://svgwg.org/svg2-draft/painting.html#StrokeOpacity>) > 5. stop-opacity (in SVG2 > <https://svgwg.org/svg2-draft/pservers.html#StopOpacityProperty>) > 6. -moz-window-opacity > Basically, the percentage value is always converted into the equivalent > number. > > Example: if opacity = "50%", the serializations of its specified value and > computed value are both "0.5". > > Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1562086 > Standard: > 1. <alpha-value>: https://drafts.csswg.org/css-color/#typedef-alpha-value > 2. Discussion: https://github.com/w3c/csswg-drafts/issues/3342 > 3. Decision: https://github.com/mozilla/wg-decisions/issues/69 > > Platform coverage: All. > Preference: No. > DevTools bug: No. > > Other browsers: > * Chrome issue: > https://bugs.chromium.org/p/chromium/issues/detail?id=907787 (intent to > implement and ship doc) > <https://docs.google.com/document/d/1fT9WPUnS59h3vbxz2LuPgBUm89ynJ_sPEAuBRn-5Jeo/edit?usp=sharing> > * WebKit: Nope (I didn't find the opened WebKit issue.) > > Web-platform-tests: I will add web-platform-tests for those properties in > the same bug. (It seems Chrome would like to add them, but I didn't see any > update in the Chrome issue recently, so I may add them first.) > 1. opacity: > testing/web-platform/tests/css/css-color/parsing/opacity-valid.html > <https://searchfox.org/mozilla-central/source/testing/web-platform/tests/css/css-color/parsing/opacity-valid.html> > 2. flood-opacity: > testing/web-platform/tests/css/filter-effects/parsing/flood-opacity-valid.svg > <https://searchfox.org/mozilla-central/source/testing/web-platform/tests/css/filter-effects/parsing/flood-opacity-valid.svg> > 3. fill-opacity: > testing/web-platform/tests/svg/painting/parsing/fill-opacity-valid.svg > <https://searchfox.org/mozilla-central/source/testing/web-platform/tests/svg/painting/parsing/fill-opacity-valid.svg> > 4. stroke-opacity: > testing/web-platform/tests/svg/painting/parsing/stroke-opacity-valid.svg > <https://searchfox.org/mozilla-central/source/testing/web-platform/tests/svg/painting/parsing/stroke-opacity-valid.svg> > 5. stop-opacity: > testing/web-platform/tests/svg/pservers/parsing/stop-opacity-valid.svg > <https://searchfox.org/mozilla-central/source/testing/web-platform/tests/svg/pservers/parsing/stop-opacity-valid.svg> > > Secure contexts: No. Just let parser support percentage value on `Opacity` > type. > > Thanks. > > Regards, > Boris Chiou _______________________________________________ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform