Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge r166420 - Clear SVGInlineTextBox fragments when the text changes.
https://bugs.webkit.org/show_bug.cgi?id=130879 Reviewed by Darin Adler. Ported from Blink: https://src.chromium.org/viewvc/blink?revision=150456&view=revision Source/WebCore: This patch modifies SVGInlineTextBox::dirtyLineBoxes to clear all following text boxes when invoked. Typically this method is called when the underlying text string changes, and that change needs to be propagated to all the boxes that use the text beyond the point where the text is first modified. Also cleans up final function keywords for SVGRootInlineBox. Test: svg/custom/unicode-in-tspan-multi-svg-crash.html * rendering/InlineTextBox.h: Added (non-recursive) dirtyOwnLineBoxes() function (WebCore::InlineTextBox::dirtyOwnLineBoxes): Calls dirtyLineBoxes() * rendering/svg/SVGInlineTextBox.h: Added (non-recursive) dirtyOwnLineBoxes() function (WebCore::SVGInlineTextBox::dirtyOwnLineBoxes): * rendering/svg/SVGInlineTextBox.cpp: (WebCore::SVGInlineTextBox::dirtyOwnLineBoxes): Non-recursive part of dirtyLineBoxes() (WebCore::SVGInlineTextBox::dirtyLineBoxes): Calls dirtyOwnLineBoxes() in a loop * rendering/svg/SVGRootInlineBox.h: LayoutTests: When failing, this test will render garbage characters or crash. * svg/custom/unicode-in-tspan-multi-svg-crash-expected.txt: Added. * svg/custom/unicode-in-tspan-multi-svg-crash.html: Added.
- Loading branch information
1 parent
9d2f04c
commit 1dbfdb3
Showing
8 changed files
with
99 additions
and
5 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
1 change: 1 addition & 0 deletions
1
LayoutTests/svg/custom/unicode-in-tspan-multi-svg-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 @@ | ||
Test Passes if there is no crash in Debug or Asan builds. There should be no characters preceding "Test". |
38 changes: 38 additions & 0 deletions
38
LayoutTests/svg/custom/unicode-in-tspan-multi-svg-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,38 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<script> | ||
if (window.testRunner) | ||
testRunner.dumpAsText(false); | ||
|
||
onload = function() { | ||
tSpanElement = document.getElementById('tSpanInFirstRoot'); | ||
tSpanElement.appendChild(document.createTextNode(unescape('%ufe9e%ue28f%ue47e'))); | ||
|
||
document.body.offsetTop; | ||
document.body.style.zoom=0.9; | ||
|
||
document.designMode='on'; | ||
filterInFirstRoot = document.getElementById('filterInFirstRoot'); | ||
useElement = document.getElementById('useElement'); | ||
window.getSelection().setBaseAndExtent(filterInFirstRoot, useElement, 5); | ||
document.execCommand('ForwardDelete'); | ||
document.designMode='off'; | ||
} | ||
</script> | ||
<body> | ||
<svg xmlns="http://www.w3.org/2000/svg"> | ||
<text> | ||
<filter id="filterInFirstRoot"/> | ||
<tspan id="tSpanInFirstRoot"/> | ||
</text> | ||
<path filter="url(#filterInSecondRoot)"/> | ||
</svg> | ||
|
||
<svg xmlns="http://www.w3.org/2000/svg"> | ||
<use id="useElement"/> | ||
<filter id="filterInSecondRoot"/> | ||
</svg> | ||
|
||
<p>Test Passes if there is no crash in Debug or Asan builds. There should be no characters preceding "Test".</p> | ||
</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
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
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