-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cherry-pick 274097.12@webkit-2024.2-embargoed (5bd3a1c2b0ac). https:/…
…/bugs.webkit.org/show_bug.cgi?id=264631 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): Canonical link: https://commits.webkit.org/274097.12@webkit-2024.2-embargoed Canonical link: https://commits.webkit.org/272448.783@safari-7618-branch Canonical link: https://commits.webkit.org/274313.238@webkitglib/2.44
- Loading branch information
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