-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
ResizeObserver content rect calculation must not work on non-replaced inline elements #40259
Copy link
Copy link
Closed
Labels
A-content/domInteracting with the DOM from web contentInteracting with the DOM from web contentA-layout/query
Description
This is described at https://drafts.csswg.org/resize-observer/#content-rect-h and tested by
servo/tests/wpt/tests/resize-observer/notify.html
Lines 195 to 233 in a6aa21b
| function test6() { | |
| let helper = new ResizeTestHelper( | |
| "test6: inline element notifies once with 0x0.", | |
| [ | |
| { | |
| setup: observer => { | |
| observer.observe(inline); | |
| }, | |
| notify: (entries, observer) => { | |
| assert_equals(entries.length, 1, "observing inline element triggers notification"); | |
| assert_equals(entries[0].target, inline, "observing inline element triggers notification"); | |
| assert_equals(entries[0].contentRect.width, 0); | |
| assert_equals(entries[0].contentRect.height, 0); | |
| return true; // Delay next step | |
| } | |
| }, | |
| { | |
| setup: observer => { | |
| inline.style.width = "66px"; | |
| }, | |
| notify: (entries, observer) => { | |
| assert_unreached("resizing inline element should not cause resize notifications"); | |
| }, | |
| timeout: () => { | |
| // expected | |
| } | |
| }, | |
| { // "inline element that becomes block should notify", | |
| setup: observer => { | |
| inline.style.display = "block"; | |
| }, | |
| notify: (entries, observer) => { | |
| assert_equals(entries.length, 1, "inline element becoming a non-zero sized block triggers a notification"); | |
| assert_equals(entries[0].target, inline, "inline element becoming a non-zero sized block triggers a notification"); | |
| } | |
| } | |
| ]); | |
| return helper.start(); | |
| } |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-content/domInteracting with the DOM from web contentInteracting with the DOM from web contentA-layout/query