Update ResizeObserver API to match the up-to-date spec as of 2019
Categories
(Core :: Layout, enhancement, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox68 | --- | fixed |
People
(Reporter: boris, Assigned: boris)
References
()
Details
(Keywords: dev-doc-complete)
Attachments
(6 files, 1 obsolete file)
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
52 bytes,
text/x-github-pull-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review |
We have the initial implementation of Resize Observer API in Bug 1272409. However, it implemented for the old spec.
In order to match the current spec, we still need to update it:
- Support
ResizeObserverBoxOptions
,ResizeObserverOptions
,ResizeObserverSize
ResizeObserverEntry
should haveborderBoxSize
andcontentBoxSize
- Support more boxes, e.g. border-box.
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Updated•5 years ago
|
Updated•5 years ago
|
Assignee | ||
Comment 1•5 years ago
|
||
GetNodeDepth() is a special version for ResizeObserver to get the depth
of node (across Shadow DOM). Based on the comment in D27614, it's better
to move it into ResizeObserver.cpp.
Assignee | ||
Comment 2•5 years ago
|
||
In this patch, we support
- content-box (default)
- border-box
And let ResizeObserverEntry expose these box sizes.
Besides, we store the mLastReportedSize as the logical size.
Assignee | ||
Comment 3•5 years ago
|
||
Throw the error in the step function and finish the current test to avoid
triggering timeout if any assert_equals
failed.
Besides, guard
is not clear to me, so using a promise_test to wrap the
window property test.
Assignee | ||
Comment 4•5 years ago
|
||
Updated•5 years ago
|
Comment 5•5 years ago
•
|
||
Note: I noticed that Chrome disagrees with the spec on what happens when the writing mode changes. (and when that causes the logical size to change, vs. when it causes the physical size to change)
Right now Chrome only seems to notify when the physical size (e.g. the width
) changes, even though the logical size may have remained the same (if e.g. width
and height
were swapped simultaneously with the writing-mode change).
I filed https://github.com/w3c/csswg-drafts/issues/3887 to get the spec clarified, because it's not really clear how writing-mode changes are supposed to be handled right now. Here's a testcase: https://jsfiddle.net/dholbert/ce094nxj/
Updated•5 years ago
|
Assignee | ||
Comment 6•5 years ago
|
||
I think it's better to make sure each test is independent from others, so we
create elements inside each test function. (Only change observe.html
because I touch only this file in this bug.)
Assignee | ||
Comment 7•5 years ago
|
||
Assignee | ||
Comment 8•5 years ago
|
||
Comment hidden (obsolete) |
Comment 10•5 years ago
|
||
Pushed by bchiou@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/2e3522f77b0f Move GetNodeDepth into ResizeObserver.cpp r=dholbert https://hg.mozilla.org/integration/autoland/rev/dc3570e93c41 Update ResizeObserver and ResizeObserverEntry. r=smaug,dholbert https://hg.mozilla.org/integration/autoland/rev/01338a1e26b7 Make each test cases independent in resize-observer/observe.html. r=dholbert https://hg.mozilla.org/integration/autoland/rev/b34ea6abce97 Add tests for border-box and different writing modes. r=dholbert https://hg.mozilla.org/integration/autoland/rev/a0c91ab4d347 Unobserve the target if using a different observed box. r=dholbert
Comment 11•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/2e3522f77b0f
https://hg.mozilla.org/mozilla-central/rev/dc3570e93c41
https://hg.mozilla.org/mozilla-central/rev/01338a1e26b7
https://hg.mozilla.org/mozilla-central/rev/b34ea6abce97
https://hg.mozilla.org/mozilla-central/rev/a0c91ab4d347
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/16877 for changes under testing/web-platform/tests
Can't merge web-platform-tests PR due to failing upstream checks: Github PR https://github.com/web-platform-tests/wpt/pull/16877 * Taskcluster (pull_request) (https://tools.taskcluster.net/task-group-inspector/#/IneQkuGBQquD4e5WsvnK3w)
Upstream PR merged
Comment 15•4 years ago
|
||
Resize observer docs finished — see https://github.com/mdn/sprints/issues/1905#issuecomment-526296951
Comment 16•3 years ago
|
||
(Clarifying bug summary a bit; the spec has undergone more changes since this bug was closed, so the goalposts of "matching the up-to-date spec" have been pushed out, and it doesn't seem useful for this bug to track those moving goalposts, implicitly or explicitly.)
Assignee | ||
Updated•2 years ago
|
Description
•