Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge r165044 - REGRESSION(r164856): Use after free in WebCore::Quali…
…fiedName::operator== / WebCore::StyledElement::attributeChanged https://bugs.webkit.org/show_bug.cgi?id=129550 Reviewed by Andreas Kling. Source/WebCore: We can't store a reference to QualifiedName here because ensureUniqueElementData could delete QualifiedName inside Attribute. Test: fast/dom/uniquing-attributes-via-setAttribute.html * dom/Element.cpp: (WebCore::Element::setAttributeInternal): LayoutTests: Added a regression test. * fast/dom/uniquing-attributes-via-setAttribute-expected.txt: Added. * fast/dom/uniquing-attributes-via-setAttribute.html: Added.
- Loading branch information
1 parent
fa240d4
commit d8d9f12
Showing
5 changed files
with
54 additions
and
1 deletion.
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
3 changes: 3 additions & 0 deletions
3
LayoutTests/fast/dom/uniquing-attributes-via-setAttribute-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,3 @@ | ||
Tests uniquing attributes via setAttribute. WebKit shouldn't crash under GuardMalloc or ASAN builds. | ||
|
||
PASS. WebKit didn't crash. |
24 changes: 24 additions & 0 deletions
24
LayoutTests/fast/dom/uniquing-attributes-via-setAttribute.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,24 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<body> | ||
<p>Tests uniquing attributes via setAttribute. WebKit shouldn't crash under GuardMalloc or ASAN builds.</p> | ||
<div></div> | ||
<script> | ||
|
||
if (window.testRunner) | ||
testRunner.dumpAsText(); | ||
|
||
var div = document.querySelector('div'); | ||
div.setAttribute('name', 'a'); | ||
|
||
var divClone = div.cloneNode(true); | ||
document.body.appendChild(divClone); | ||
|
||
div.setAttribute('name', 'b'); | ||
divClone.setAttribute('name', 'b'); | ||
|
||
document.write("PASS. WebKit didn't crash."); | ||
|
||
</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