Stylo serialize computed <number-percentage> values to <number> values for filter property, Gecko doesn't

RESOLVED WORKSFORME

Status

()

P3
normal
RESOLVED WORKSFORME
a year ago
a year ago

People

(Reporter: jeremychen, Unassigned)

Tracking

(Blocks: 1 bug)

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment)

Here's a test case:
```
data:text/html, <img alt="Test_Form.jpg" id="img1" src="Test_Form.jpg" style="width: 300px; filter:opacity(30%);" />
```

The results of running "getComputedStyle(document.getElementById('img1')).filter" are:

opacity(0.3) in Chrome and Safari,
opacity(30%) in Firefox and Edge.


We serialize computed <number-percentage> values as-is for filter function parameters of filter property. However, the spec issue [1] seems prefer to serializing <number-percentage> to one number value, so maybe we should consider to do so.
    
This change should only affects the serialization of CSSOM I think.


[1] https://github.com/w3c/csswg-drafts/issues/1546
Comment hidden (mozreview-request)
Priority: -- → P3
getComputedStyle(document.getElementById('img1')).filter
"opacity(0.3)"

Fixed by Stylo?
Flags: needinfo?(jeremychen)
Status: NEW → RESOLVED
Last Resolved: a year ago
Resolution: --- → WORKSFORME
(In reply to Jet Villegas (:jet) from comment #2)
> getComputedStyle(document.getElementById('img1')).filter
> "opacity(0.3)"
> 
> Fixed by Stylo?

Yes, this is fixed by Stylo, and the original bug is filed for making Gecko to match Stylo.

For the record, this issue is still sustained in Gecko.

If we want to resolve this, probably worth to set the dependency to stylo-behavior-changes.
Blocks: 1365771
Flags: needinfo?(jeremychen)
Summary: consider serialize computed <number-percentage> values to <number> values for filter property → Stylo serialize computed <number-percentage> values to <number> values for filter property, Gecko doesn't
You need to log in before you can comment on or make changes to this bug.