Title: [249954] trunk
- Revision
- 249954
- Author
- [email protected]
- Date
- 2019-09-17 08:01:23 -0700 (Tue, 17 Sep 2019)
Log Message
[First-letter] Use WeakPtr for the first-letter insertion point.
https://bugs.webkit.org/show_bug.cgi?id=201842
<rdar://problem/51373788>
Reviewed by Antti Koivisto.
Source/WebCore:
The about-to-be-removed first letter renderer's sibling could potentially be destroyed too as the result of the anonymous subtree collapsing logic (when the next sibling is a generated anonymous block and it is not needed anymore.)
Test: fast/text/first-letter-with-columns-crash.html
* rendering/updating/RenderTreeBuilderFirstLetter.cpp:
(WebCore::RenderTreeBuilder::FirstLetter::updateStyle):
LayoutTests:
* fast/text/first-letter-with-columns-crash-expected.txt: Added.
* fast/text/first-letter-with-columns-crash.html: Added.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (249953 => 249954)
--- trunk/LayoutTests/ChangeLog 2019-09-17 11:05:00 UTC (rev 249953)
+++ trunk/LayoutTests/ChangeLog 2019-09-17 15:01:23 UTC (rev 249954)
@@ -1,3 +1,14 @@
+2019-09-17 Zalan Bujtas <[email protected]>
+
+ [First-letter] Use WeakPtr for the first-letter insertion point.
+ https://bugs.webkit.org/show_bug.cgi?id=201842
+ <rdar://problem/51373788>
+
+ Reviewed by Antti Koivisto.
+
+ * fast/text/first-letter-with-columns-crash-expected.txt: Added.
+ * fast/text/first-letter-with-columns-crash.html: Added.
+
2019-09-17 Rob Buis <[email protected]>
Access-Control-Expose-Headers parsed incorrectly
Added: trunk/LayoutTests/fast/text/first-letter-with-columns-crash-expected.txt (0 => 249954)
--- trunk/LayoutTests/fast/text/first-letter-with-columns-crash-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/text/first-letter-with-columns-crash-expected.txt 2019-09-17 15:01:23 UTC (rev 249954)
@@ -0,0 +1 @@
+First letter -PASS if no crash.
Added: trunk/LayoutTests/fast/text/first-letter-with-columns-crash.html (0 => 249954)
--- trunk/LayoutTests/fast/text/first-letter-with-columns-crash.html (rev 0)
+++ trunk/LayoutTests/fast/text/first-letter-with-columns-crash.html 2019-09-17 15:01:23 UTC (rev 249954)
@@ -0,0 +1,23 @@
+<style>
+:first-letter {
+ float: right;
+ content: url()
+}
+
+body {
+ columns: 2;
+}
+</style>
+<body>First letter -PASS if no crash.<span id=outer><span id=inner>
+<script>
+if (window.testRunner)
+ testRunner.dumpAsText();
+outer.addEventListener("DOMSubtreeModified", function() {
+ document.execCommand(false);
+ document.body.style.setProperty("-webkit-columns","initial");
+ inner.setAttribute("foobar","");
+ document.body.style.setProperty("-webkit-writing-mode","vertical-lr");
+
+});
+outer.setAttribute("foobar","");
+</script>
Modified: trunk/Source/WebCore/ChangeLog (249953 => 249954)
--- trunk/Source/WebCore/ChangeLog 2019-09-17 11:05:00 UTC (rev 249953)
+++ trunk/Source/WebCore/ChangeLog 2019-09-17 15:01:23 UTC (rev 249954)
@@ -1,3 +1,18 @@
+2019-09-17 Zalan Bujtas <[email protected]>
+
+ [First-letter] Use WeakPtr for the first-letter insertion point.
+ https://bugs.webkit.org/show_bug.cgi?id=201842
+ <rdar://problem/51373788>
+
+ Reviewed by Antti Koivisto.
+
+ The about-to-be-removed first letter renderer's sibling could potentially be destroyed too as the result of the anonymous subtree collapsing logic (when the next sibling is a generated anonymous block and it is not needed anymore.)
+
+ Test: fast/text/first-letter-with-columns-crash.html
+
+ * rendering/updating/RenderTreeBuilderFirstLetter.cpp:
+ (WebCore::RenderTreeBuilder::FirstLetter::updateStyle):
+
2019-09-17 Carlos Garcia Campos <[email protected]>
[GTK] Cannot create EGL window surface: EGL_BAD_ALLOC
Modified: trunk/Source/WebCore/rendering/updating/RenderTreeBuilderFirstLetter.cpp (249953 => 249954)
--- trunk/Source/WebCore/rendering/updating/RenderTreeBuilderFirstLetter.cpp 2019-09-17 11:05:00 UTC (rev 249953)
+++ trunk/Source/WebCore/rendering/updating/RenderTreeBuilderFirstLetter.cpp 2019-09-17 15:01:23 UTC (rev 249954)
@@ -185,7 +185,6 @@
m_builder.attach(*newFirstLetter, WTFMove(toMove));
}
- RenderObject* nextSibling = firstLetter->nextSibling();
if (RenderTextFragment* remainingText = downcast<RenderBoxModelObject>(*firstLetter).firstLetterRemainingText()) {
ASSERT(remainingText->isAnonymous() || remainingText->textNode()->renderer() == remainingText);
// Replace the old renderer with the new one.
@@ -192,8 +191,9 @@
remainingText->setFirstLetter(*newFirstLetter);
newFirstLetter->setFirstLetterRemainingText(*remainingText);
}
+ WeakPtr<RenderObject> nextSibling = makeWeakPtr(firstLetter->nextSibling());
m_builder.destroy(*firstLetter);
- m_builder.attach(*firstLetterContainer, WTFMove(newFirstLetter), nextSibling);
+ m_builder.attach(*firstLetterContainer, WTFMove(newFirstLetter), nextSibling.get());
return;
}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes