Skip to content

Commit d0c8022

Browse files
authored
layout: Use content area rect for content box queries. (servo#40115)
Using the margin rect when querying the content box of an element doesn't make sense. Testing: Fixes various test failures in resize-observer tests and some image tests. Fixes: servo#40110 Signed-off-by: Josh Matthews <[email protected]>
1 parent 7e2e7b5 commit d0c8022

File tree

3 files changed

+1
-103
lines changed

3 files changed

+1
-103
lines changed

components/layout/fragment_tree/box_fragment.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ impl BoxFragment {
313313
}
314314

315315
pub(crate) fn cumulative_content_box_rect(&self) -> PhysicalRect<Au> {
316-
self.offset_by_containing_block(&self.margin_rect())
316+
self.offset_by_containing_block(&self.content_rect)
317317
}
318318

319319
pub(crate) fn cumulative_padding_box_rect(&self) -> PhysicalRect<Au> {

tests/wpt/meta/html/semantics/embedded-content/the-img-element/naturalWidth-naturalHeight-width-height.tentative.html.ini

Lines changed: 0 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,7 @@
11
[naturalWidth-naturalHeight-width-height.tentative.html]
2-
[raster image]
3-
expected: FAIL
4-
5-
[raster image with width/height attributes]
6-
expected: FAIL
7-
82
[raster image with width/height attributes (when not rendered)]
93
expected: FAIL
104

11-
[non existent image with width/height attributes, no natural dimensions]
12-
expected: FAIL
13-
145
[non existent image with width/height attributes, no natural dimensions (when not rendered)]
156
expected: FAIL
167

@@ -116,18 +107,6 @@
116107
[SVG image, with natural height, and aspect ratio from viewBox (when not rendered)]
117108
expected: FAIL
118109

119-
[SVG image, with natural width of 0, and aspect ratio from viewBox]
120-
expected: FAIL
121-
122-
[SVG image, with natural height of 0, and aspect ratio from viewBox]
123-
expected: FAIL
124-
125-
[SVG image, with natural width being negative, and aspect ratio from viewBox]
126-
expected: FAIL
127-
128-
[SVG image, with natural height being negative, and aspect ratio from viewBox]
129-
expected: FAIL
130-
131110
[SVG image, no natural dimensions, viewBox with 0 width/height]
132111
expected: FAIL
133112

@@ -182,30 +161,9 @@
182161
[SVG image, with natural height, viewBox with 0 height (when not rendered)]
183162
expected: FAIL
184163

185-
[SVG image, with natural width and height]
186-
expected: FAIL
187-
188-
[SVG image, with natural width and height, and aspect ratio from viewBox]
189-
expected: FAIL
190-
191-
[SVG image, with natural width and height of 0, and aspect ratio from viewBox]
192-
expected: FAIL
193-
194-
[SVG image, with natural width and height being negative, and aspect ratio from viewBox]
195-
expected: FAIL
196-
197-
[raster image (with srcset/1x)]
198-
expected: FAIL
199-
200-
[raster image with width/height attributes (with srcset/1x)]
201-
expected: FAIL
202-
203164
[raster image with width/height attributes (with srcset/1x) (when not rendered)]
204165
expected: FAIL
205166

206-
[non existent image with width/height attributes, no natural dimensions (with srcset/1x)]
207-
expected: FAIL
208-
209167
[non existent image with width/height attributes, no natural dimensions (with srcset/1x) (when not rendered)]
210168
expected: FAIL
211169

@@ -311,18 +269,6 @@
311269
[SVG image, with natural height, and aspect ratio from viewBox (with srcset/1x) (when not rendered)]
312270
expected: FAIL
313271

314-
[SVG image, with natural width of 0, and aspect ratio from viewBox (with srcset/1x)]
315-
expected: FAIL
316-
317-
[SVG image, with natural height of 0, and aspect ratio from viewBox (with srcset/1x)]
318-
expected: FAIL
319-
320-
[SVG image, with natural width being negative, and aspect ratio from viewBox (with srcset/1x)]
321-
expected: FAIL
322-
323-
[SVG image, with natural height being negative, and aspect ratio from viewBox (with srcset/1x)]
324-
expected: FAIL
325-
326272
[SVG image, no natural dimensions, viewBox with 0 width/height (with srcset/1x)]
327273
expected: FAIL
328274

@@ -377,33 +323,12 @@
377323
[SVG image, with natural height, viewBox with 0 height (with srcset/1x) (when not rendered)]
378324
expected: FAIL
379325

380-
[SVG image, with natural width and height (with srcset/1x)]
381-
expected: FAIL
382-
383-
[SVG image, with natural width and height, and aspect ratio from viewBox (with srcset/1x)]
384-
expected: FAIL
385-
386-
[SVG image, with natural width and height of 0, and aspect ratio from viewBox (with srcset/1x)]
387-
expected: FAIL
388-
389-
[SVG image, with natural width and height being negative, and aspect ratio from viewBox (with srcset/1x)]
390-
expected: FAIL
391-
392-
[raster image (with srcset/2x)]
393-
expected: FAIL
394-
395326
[raster image (with srcset/2x) (when not rendered)]
396327
expected: FAIL
397328

398-
[raster image with width/height attributes (with srcset/2x)]
399-
expected: FAIL
400-
401329
[raster image with width/height attributes (with srcset/2x) (when not rendered)]
402330
expected: FAIL
403331

404-
[non existent image with width/height attributes, no natural dimensions (with srcset/2x)]
405-
expected: FAIL
406-
407332
[non existent image with width/height attributes, no natural dimensions (with srcset/2x) (when not rendered)]
408333
expected: FAIL
409334

@@ -509,18 +434,6 @@
509434
[SVG image, with natural height, and aspect ratio from viewBox (with srcset/2x) (when not rendered)]
510435
expected: FAIL
511436

512-
[SVG image, with natural width of 0, and aspect ratio from viewBox (with srcset/2x)]
513-
expected: FAIL
514-
515-
[SVG image, with natural height of 0, and aspect ratio from viewBox (with srcset/2x)]
516-
expected: FAIL
517-
518-
[SVG image, with natural width being negative, and aspect ratio from viewBox (with srcset/2x)]
519-
expected: FAIL
520-
521-
[SVG image, with natural height being negative, and aspect ratio from viewBox (with srcset/2x)]
522-
expected: FAIL
523-
524437
[SVG image, no natural dimensions, viewBox with 0 width/height (with srcset/2x)]
525438
expected: FAIL
526439

@@ -575,20 +488,8 @@
575488
[SVG image, with natural height, viewBox with 0 height (with srcset/2x) (when not rendered)]
576489
expected: FAIL
577490

578-
[SVG image, with natural width and height (with srcset/2x)]
579-
expected: FAIL
580-
581491
[SVG image, with natural width and height (with srcset/2x) (when not rendered)]
582492
expected: FAIL
583493

584-
[SVG image, with natural width and height, and aspect ratio from viewBox (with srcset/2x)]
585-
expected: FAIL
586-
587494
[SVG image, with natural width and height, and aspect ratio from viewBox (with srcset/2x) (when not rendered)]
588495
expected: FAIL
589-
590-
[SVG image, with natural width and height of 0, and aspect ratio from viewBox (with srcset/2x)]
591-
expected: FAIL
592-
593-
[SVG image, with natural width and height being negative, and aspect ratio from viewBox (with srcset/2x)]
594-
expected: FAIL

tests/wpt/meta/resize-observer/scrollbars-2.html.ini

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)