-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Special case treatment of out-of-flow RenderLineBreak
https://bugs.webkit.org/show_bug.cgi?id=264631 rdar://114719845 Reviewed by Alan Baradlay. Out-of-flow RenderLineBreaks have problems when relying on default out-of-flow support of the render tree, see https://bugs.webkit.org/show_bug.cgi?id=270977. To fix the problem we change containerForElement and containingBlock to treat RenderLineBreak that are out-of-flow as if they have position: static. * LayoutTests/fast/css/line-break-fixed-position-container-expected.txt: Added. * LayoutTests/fast/css/line-break-fixed-position-container.html: Added. * Source/WebCore/rendering/RenderObject.cpp: (WebCore::RenderObject::containingBlock const): (WebCore::containerForElement): Originally-landed-as: 274097.12@webkit-2024.2-embargoed (5bd3a1c2b0ac). rdar://128088216 Canonical link: https://commits.webkit.org/278867@main
- Loading branch information
1 parent
fc8a911
commit cfbedad
Showing
3 changed files
with
47 additions
and
2 deletions.
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
LayoutTests/fast/css/line-break-fixed-position-container-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
This test passes if it doesn't crash. | ||
|
36 changes: 36 additions & 0 deletions
36
LayoutTests/fast/css/line-break-fixed-position-container.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<html> | ||
<head> | ||
<style> | ||
/* Fixed position for the line break should be ignored. */ | ||
br { position: fixed; } | ||
|
||
/* Only function of this styling is forcing style invalidation | ||
* on the line break renderer. */ | ||
br::first-line { color: blue; } | ||
</style> | ||
<script> | ||
function test() { | ||
if (window.testRunner) { | ||
window.testRunner.dumpAsText(); | ||
window.testRunner.waitUntilDone(); | ||
} | ||
|
||
setTimeout(function() { | ||
// Only function of this event listener is invalidating event regions | ||
// for the Document and subsequently triggering a complete style rebuild | ||
// which is necessary to exhibit the problem. | ||
window.addEventListener('wheel', function() { }); | ||
|
||
setTimeout(function() { | ||
if (window.testRunner) | ||
window.testRunner.notifyDone(); | ||
}); | ||
}); | ||
} | ||
</script> | ||
</head> | ||
<body onload="test()"> | ||
This test passes if it doesn't crash. | ||
<br/> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters