Bug 1527949 - Include the block container's block-end padding when computing its overflow area. r=emilio

Per spec, the scrollable overflow area is the union of the box's own
content and padding areas.
https://drafts.csswg.org/css-overflow-3/#scrollable

In this part, we add block container's block-end padding to its
children's block-end edge.

This patch reverts some of the test references modification in
https://hg.mozilla.org/mozilla-central/rev/905ef8691d96dce44120ba562d67754ceac8ff81

Differential Revision: https://phabricator.services.mozilla.com/D108890
This commit is contained in:
Ting-Yu Lin 2021-03-26 01:06:13 +00:00
Родитель 0de3133d7b
Коммит c3ee9188d2
8 изменённых файлов: 22 добавлений и 19 удалений

Просмотреть файл

@ -2053,6 +2053,19 @@ void nsBlockFrame::ConsiderBlockEndEdgeOfChildren(
// REVIEW: For now, we do this for both visual and scrollable area,
// although when we make scrollable overflow area not be a subset of
// visual, we can change this.
if (Style()->GetPseudoType() == PseudoStyleType::scrolledContent) {
// If we are a scrolled inner frame, add our block-end padding to our
// children's block-end edge.
//
// Note: aBEndEdgeOfChildren already includes our own block-start padding
// because it is relative to our block-start edge of our border-box, which
// is the same as our padding-box here.
MOZ_ASSERT(GetLogicalUsedBorderAndPadding(wm) == GetLogicalUsedPadding(wm),
"A scrolled inner frame shouldn't have any border!");
aBEndEdgeOfChildren += GetLogicalUsedPadding(wm).BEnd(wm);
}
// XXX Currently, overflow areas are stored as physical rects, so we have
// to handle writing modes explicitly here. If we change overflow rects
// to be stored logically, this can be simplified again.

Просмотреть файл

@ -1,9 +0,0 @@
<!DOCTYPE HTML>
<html>
<body>
<div style="overflow:auto; width:300px; height:300px; background:green;">
<div style="height:100px;"></div>
<div style="height:200px; margin-left:100px; margin-right:100px; width:100px; background:yellow;"></div>
</div>
</body>
</html>

Просмотреть файл

@ -13,7 +13,8 @@
background: aqua;
}
#gap {
height: 35px;
/* In test file: #content's margin-bottom: 35px + #scroll's padding-bottom: 7px */
height: 42px;
}
</style>

Просмотреть файл

@ -1181,7 +1181,7 @@ fuzzy-if(skiaContent,0-1,0-45) fuzzy-if(webrender,0-10,0-8) == 456219-2.html 456
== 456484-1.html 456484-1-ref.html
== 457398-1.html 457398-1-ref.html
== 457398-2.html 457398-2-ref.html
== 458296-1a.html 458296-1a-ref.html
== 458296-1a.html 458296-1-ref.html
== 458296-1b.html 458296-1-ref.html
== 458296-1c.html 458296-1-ref.html
== 458296-1d.html 458296-1-ref.html
@ -1649,7 +1649,7 @@ fuzzy-if(skiaContent,0-1,0-65536) == 654950-1.html 654950-1-ref.html # Quartz al
fuzzy-if(skiaContent,0-10,0-919) fuzzy-if(webrender&&cocoaWidget,2-2,4-4) fuzzy-if(swgl&&cocoaWidget,2-2,148-148) == 660682-1.html 660682-1-ref.html
fuzzy-if(d2d,0-1,0-256) fuzzy-if(skiaContent,0-1,0-68000) == chrome://reftest/content/bugs/664127-1.xhtml chrome://reftest/content/bugs/664127-1-ref.xhtml
== 665597-1.html 665597-1-ref.html
== 665597-2.html 665597-2-ref.html
!= 665597-2.html 665597-2-ref.html
== 667079-1.html 667079-1-ref.html
== chrome://reftest/content/bugs/668319-1.xhtml about:blank
!= chrome://reftest/content/bugs/669015-1.xhtml chrome://reftest/content/bugs/669015-1-notref.xhtml

Просмотреть файл

@ -32,7 +32,7 @@
<body>
<div id="scroll">
<div id="inner">
<div style="width: 100px; height: 100px"></div>
<div style="width: 100px; height: 110px"></div>
<div id="sticky"></div>
</div>
</div>

Просмотреть файл

@ -1,2 +1,3 @@
[inset-box-shadow-scroll.html]
expected: FAIL
fuzzy:
if (os == "win") and not webrender: maxDifference=53-149;totalPixels=1066-1066

Просмотреть файл

@ -1,2 +1,3 @@
[inset-box-shadow-stacking-context-scroll.html]
expected: FAIL
fuzzy:
if (os == "win") and not webrender: maxDifference=53-149;totalPixels=1066-1066

Просмотреть файл

@ -1,4 +0,0 @@
[position-sticky-overflow-padding.html]
[Ancestor overflow padding does not allow a sticky element to escape its container]
expected: FAIL