Skip to content

Commit 26a0c7c

Browse files
Jack Leewebkit-commit-queue
authored andcommitted
ASSERTION FAILED: hasLayer() in RenderLayer::enclosingOverflowClipLayer
https://bugs.webkit.org/show_bug.cgi?id=205474 Patch by Jack Lee <shihchieh_lee@apple.com> on 2020-01-06 Reviewed by Simon Fraser. Source/WebCore: Test: fast/css/sticky/sticky-tablecol-crash.html * rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelObject::enclosingClippingBoxForStickyPosition const): (WebCore::RenderBoxModelObject::constrainingRectForStickyPosition const): (WebCore::RenderBoxModelObject::stickyPositionOffset const): LayoutTests: * fast/css/sticky/sticky-tablecol-crash-expected.txt: Added. * fast/css/sticky/sticky-tablecol-crash.html: Added. Canonical link: https://commits.webkit.org/218956@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254086 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent 798b820 commit 26a0c7c

5 files changed

Lines changed: 55 additions & 4 deletions

File tree

LayoutTests/ChangeLog

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
2020-01-06 Jack Lee <shihchieh_lee@apple.com>
2+
3+
ASSERTION FAILED: hasLayer() in RenderLayer::enclosingOverflowClipLayer
4+
https://bugs.webkit.org/show_bug.cgi?id=205474
5+
6+
Reviewed by Simon Fraser.
7+
8+
* fast/css/sticky/sticky-tablecol-crash-expected.txt: Added.
9+
* fast/css/sticky/sticky-tablecol-crash.html: Added.
10+
111
2020-01-06 Antoine Quint <graouts@apple.com>
212

313
REGRESSION: [ iOS ] imported/w3c/web-platform-tests/dom/events/Event-dispatch-on-disabled-elements.html is failing
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Tests position:sticky on a table column.
2+
3+
The test passes if WebKit doesn't crash or hit an assertion.
4+
5+
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<style>
2+
body {
3+
height: 1000px;
4+
}
5+
col {
6+
position: sticky;
7+
}
8+
</style>
9+
<body onload="runTest()">
10+
<script>
11+
if (window.testRunner)
12+
testRunner.dumpAsText();
13+
14+
function runTest() {
15+
tableCol.scrollIntoViewIfNeeded(true);
16+
}
17+
</script>
18+
<table>
19+
<col id="tableCol"></col>
20+
<p>Tests position:sticky on a table column.</p>
21+
<p>The test passes if WebKit doesn't crash or hit an assertion.</p>
22+
</body>

Source/WebCore/ChangeLog

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
2020-01-06 Jack Lee <shihchieh_lee@apple.com>
2+
3+
ASSERTION FAILED: hasLayer() in RenderLayer::enclosingOverflowClipLayer
4+
https://bugs.webkit.org/show_bug.cgi?id=205474
5+
6+
Reviewed by Simon Fraser.
7+
8+
Test: fast/css/sticky/sticky-tablecol-crash.html
9+
10+
* rendering/RenderBoxModelObject.cpp:
11+
(WebCore::RenderBoxModelObject::enclosingClippingBoxForStickyPosition const):
12+
(WebCore::RenderBoxModelObject::constrainingRectForStickyPosition const):
13+
(WebCore::RenderBoxModelObject::stickyPositionOffset const):
14+
115
2020-01-06 Alex Christensen <achristensen@webkit.org>
216

317
Allow wildcard scheme in UserContentURLPattern

Source/WebCore/rendering/RenderBoxModelObject.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,8 @@ const RenderBox& RenderBoxModelObject::enclosingClippingBoxForStickyPosition(con
445445
{
446446
ASSERT(isStickilyPositioned());
447447

448-
auto* clipLayer = layer()->enclosingOverflowClipLayer(ExcludeSelf);
448+
RenderLayer* clipLayer = hasLayer() ? layer()->enclosingOverflowClipLayer(ExcludeSelf) : nullptr;
449+
449450
if (enclosingClippingLayer)
450451
*enclosingClippingLayer = clipLayer;
451452

@@ -536,7 +537,8 @@ void RenderBoxModelObject::computeStickyPositionConstraints(StickyPositionViewpo
536537

537538
FloatRect RenderBoxModelObject::constrainingRectForStickyPosition() const
538539
{
539-
RenderLayer* enclosingClippingLayer = layer()->enclosingOverflowClipLayer(ExcludeSelf);
540+
RenderLayer* enclosingClippingLayer = hasLayer() ? layer()->enclosingOverflowClipLayer(ExcludeSelf) : nullptr;
541+
540542
if (enclosingClippingLayer) {
541543
RenderBox& enclosingClippingBox = downcast<RenderBox>(enclosingClippingLayer->renderer());
542544
LayoutRect clipRect = enclosingClippingBox.overflowClipRect(LayoutPoint(), nullptr); // FIXME: make this work in regions.
@@ -560,8 +562,6 @@ FloatRect RenderBoxModelObject::constrainingRectForStickyPosition() const
560562

561563
LayoutSize RenderBoxModelObject::stickyPositionOffset() const
562564
{
563-
ASSERT(hasLayer());
564-
565565
FloatRect constrainingRect = constrainingRectForStickyPosition();
566566
StickyPositionViewportConstraints constraints;
567567
computeStickyPositionConstraints(constraints, constrainingRect);

0 commit comments

Comments
 (0)