Closed Bug 1355107 Opened 7 years ago Closed 7 years ago

Compute image-orientation property as specification says

Categories

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

enhancement

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: chenpighead, Unassigned)

References

()

Details

We [1] seem doing the "rounding half up" instead of "rounding away from 0" for the computed values of image-orientation. However, the spec [2] says 

"The computed value of the property is calculated... rounding away from 0 (that is, 45deg is rounded to 90deg, while -45deg is rounded to -90deg)..."

Some reftests might need to be fixed as well.


[1] http://searchfox.org/mozilla-central/rev/eace920a0372051a11d8d275bd9b8f14f3024ecd/layout/style/nsStyleStruct.h#2024-2029
[2] https://drafts.csswg.org/css-images-3/#the-image-orientation
Note that the spec also says that the rounding happens before the mod 2pi bit.  I have not yet convinced myself whether the ordering there matters or not, as long as we round things that are > 3pi/2 after modding to 0.
See Also: → 1341758
Double checked the spec and still confused about the compute/round pieces...

I've filed a spec issue for this: https://github.com/w3c/csswg-drafts/issues/1206
Priority: -- → P3
(In reply to Jeremy Chen [:jeremychen] UTC+8 (away 24 Oct – 12 Nov) from comment #2)
> Double checked the spec and still confused about the compute/round pieces...
> 
> I've filed a spec issue for this:
> https://github.com/w3c/csswg-drafts/issues/1206

The spec issue has been resolved, and now it is specified [1] as

```
The computed value of the property is calculated by moduloing the value by 1turn (so that it lies in the half-open range [0turn, 1turn)), then rounding it to the nearest quarter-turn, rounding away from 0 (so 45deg rounds to 90deg, etc). 
```

The implementation has been fixed [2] to align the spec (as part of the patch in bug 1355380), so resolve this bug.


[1] https://drafts.csswg.org/css-images-3/#valdef-image-orientation-angle
[2] http://searchfox.org/mozilla-central/rev/1c4da216e00ac95b38a3f236e010b31cdfaae03b/layout/style/nsStyleStruct.h#1988-1997
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.