[csswg-drafts] Resize Observer spec and Chrome-implementation disagree on what happens when the writing-mode changes (#3887)

dholbert has just created a new issue for https://github.com/w3c/csswg-drafts:

== Resize Observer spec and Chrome-implementation disagree on what happens when the writing-mode changes ==
The ResizeObserver `isActive` check (to answer "was there a resize") is defined here:
https://drafts.csswg.org/resize-observer/#dom-resizeobservation-isactive
...and right now, it says `Return true if currentSize is not equal to this.lastReportedSize.` (where the sizes are basically [an `inlineSize, blockSize` coordinate pair](https://drafts.csswg.org/resize-observer/#calculate-box-size).

Right now, the spec text doesn't explain how to handle the possibility that `currentSize` and `lastReportedSize` may have different writing modes.  So implicitly, this would suggest that the writing-mode could change and no notification would be fired as long as "old inlineSize" == "new inlineSize".  But this disagrees with what Chrome's implementation does in this circumstance.

This needs to be clarified & either Chrome or the spec need to be fixed to agree.

Here's a live example that demonstrates that Chrome disagrees with the spec:
https://jsfiddle.net/dholbert/ce094nxj/

Basically:
* there are two 300x200 divs, whose writing-mode changes when you hover them.
* the first one's **physical** dimensions never change (which means its inline-size and block-size change whenever its hovered).
* the second one's **logical** dimensions never change (i.e. its inline-size and block-size are static regardless of writing-mode, and its height/width are swapped when hovered).

According to the spec, the observer must fire when I hover the first div, and it must not fire when I hover the second div.  But Chrome's implementation does the opposite of this.

I don't have particularly strong feelings about which behavior is best, but this will influence our implementation strategy in Firefox so I want to try to get it right up front. @atotic, what do you think we should do here?

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3887 using your GitHub account

Received on Thursday, 2 May 2019 21:49:25 UTC