forked from WebKit/WebKit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't crash when RenderStyle is NULL for elements like optgroup when
rendering https://bugs.webkit.org/show_bug.cgi?id=248575 Reviewed by Simon Fraser. * LayoutTests/fast/rendering/render-style-null-optgroup-crash-expected.txt: Added. * LayoutTests/fast/rendering/render-style-null-optgroup-crash.html: Added. * Source/WebCore/rendering/RenderListBox.cpp: (WebCore::RenderListBox::paintItemForeground): (WebCore::RenderListBox::paintItemBackground): Canonical link: https://commits.webkit.org/257295@main
- Loading branch information
Showing
3 changed files
with
35 additions
and
8 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
LayoutTests/fast/rendering/render-style-null-optgroup-crash-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 @@ | ||
PASS |
22 changes: 22 additions & 0 deletions
22
LayoutTests/fast/rendering/render-style-null-optgroup-crash.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,22 @@ | ||
<style> | ||
.class4:optional,*:focus-within { auto;display: contents } | ||
</style> | ||
<script> | ||
function f1() { | ||
try { x = document.caretRangeFromPoint(); } catch { } | ||
try { y = x.commonAncestorContainer; } catch { } | ||
try { z.selectionDirection = "backward"; } catch { } | ||
try { y.innerHTML = "PASS"; } catch { } | ||
} | ||
|
||
if (window.testRunner) { | ||
testRunner.dumpAsText(); | ||
} | ||
|
||
</script> | ||
<iframe translate="yes"> | ||
</iframe> | ||
<details open="" onfocusin="f1()"> | ||
<select autofocus="" multiple="" required=""> | ||
<optgroup webkitdropzone="copy"> | ||
<textarea id="z" rows="1024"> |
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