Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
ShadowRoot with leading or trailing white space cause a crash
https://bugs.webkit.org/show_bug.cgi?id=149782 Reviewed by Chris Dumez. Source/WebCore: Fixed the crash by adding a null pointer check since a TextNode that appears as a direct child of a ShadowRoot doesn't have a parent element. Test: fast/shadow-dom/shadow-root-with-child-whitespace-text-crash.html * style/RenderTreePosition.cpp: (WebCore::RenderTreePosition::previousSiblingRenderer): LayoutTests: Added a regression test. * fast/shadow-dom/shadow-root-with-child-whitespace-text-crash-expected.txt: Added. * fast/shadow-dom/shadow-root-with-child-whitespace-text-crash.html: Added. Canonical link: https://commits.webkit.org/167933@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@190585 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
5 changed files
with
51 additions
and
2 deletions.
There are no files selected for viewing
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
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,3 @@ | ||
This tests creating a shadow root with leading and trailing white spaces. WebKit should not crash. You should see PASS below. | ||
|
||
PASS |
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,17 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<body> | ||
<p> | ||
This tests creating a shadow root with leading and trailing white spaces. | ||
WebKit should not crash. You should see PASS below. | ||
</p> | ||
<div id="host">PASS</div> | ||
<script> | ||
if (window.testRunner) | ||
testRunner.dumpAsText(); | ||
|
||
var host = document.getElementById('host'); | ||
host.attachShadow({mode: 'closed'}).innerHTML = ' <slot></slot> '; | ||
</script> | ||
</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
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