Closed Bug 1381232 Opened 7 years ago Closed 7 years ago

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

Categories

(Core :: CSS Parsing and Computation, enhancement, P3)

enhancement

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: chenpighead, Unassigned)

References

(Blocks 1 open bug, )

Details

Attachments

(1 file)

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
Priority: -- → P3
getComputedStyle(document.getElementById('img1')).filter
"opacity(0.3)"

Fixed by Stylo?
Flags: needinfo?(jeremychen)
Status: NEW → RESOLVED
Closed: 7 years 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.
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.

Attachment

General

Created:
Updated:
Size: