Title: [118028] branches/chromium/1084
- Revision
- 118028
- Author
- [email protected]
- Date
- 2012-05-22 12:53:10 -0700 (Tue, 22 May 2012)
Log Message
Merge 116325
BUG=126406
Review URL: https://chromiumcodereview.appspot.com/10416046
Modified Paths
Added Paths
Diff
Copied: branches/chromium/1084/LayoutTests/fast/css-generated-content/first-letter-next-sibling-crash-expected.txt (from rev 116325, trunk/LayoutTests/fast/css-generated-content/first-letter-next-sibling-crash-expected.txt) (0 => 118028)
--- branches/chromium/1084/LayoutTests/fast/css-generated-content/first-letter-next-sibling-crash-expected.txt (rev 0)
+++ branches/chromium/1084/LayoutTests/fast/css-generated-content/first-letter-next-sibling-crash-expected.txt 2012-05-22 19:53:10 UTC (rev 118028)
@@ -0,0 +1,2 @@
+WebKit Bug 85759 - Crash in RenderBlock::updateFirstLetterStyle.
+PASS if test does not crash.
Copied: branches/chromium/1084/LayoutTests/fast/css-generated-content/first-letter-next-sibling-crash.html (from rev 116325, trunk/LayoutTests/fast/css-generated-content/first-letter-next-sibling-crash.html) (0 => 118028)
--- branches/chromium/1084/LayoutTests/fast/css-generated-content/first-letter-next-sibling-crash.html (rev 0)
+++ branches/chromium/1084/LayoutTests/fast/css-generated-content/first-letter-next-sibling-crash.html 2012-05-22 19:53:10 UTC (rev 118028)
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<html>
+<style>
+.absolutePosition { position: fixed; }
+.float:before { float: right; content: ''; }
+.float:first-letter { float: right; }
+.inline::first-letter { content: ''; }
+</style>
+<script>
+if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+function startTest() {
+ document.body.offsetTop;
+ var parent = document.getElementById("parent");
+ var child = document.getElementById("child");
+ child.setAttribute('class', 'inline');
+ document.body.offsetTop;
+ parent.removeChild(child);
+ document.body.offsetTop;
+ parent.setAttribute('class', 'inline');
+}
+window._onload_ = startTest;
+</script>
+WebKit Bug 85759 - Crash in RenderBlock::updateFirstLetterStyle.
+<div class="float" id="parent">
+<div class="absolutePosition" id="child"></div>
+PASS if test does not crash.
+</div>
+</html>
Modified: branches/chromium/1084/Source/WebCore/rendering/RenderBlock.cpp (118027 => 118028)
--- branches/chromium/1084/Source/WebCore/rendering/RenderBlock.cpp 2012-05-22 19:39:37 UTC (rev 118027)
+++ branches/chromium/1084/Source/WebCore/rendering/RenderBlock.cpp 2012-05-22 19:53:10 UTC (rev 118028)
@@ -5965,6 +5965,9 @@
remainingText->setFirstLetter(newFirstLetter);
toRenderBoxModelObject(newFirstLetter)->setFirstLetterRemainingText(remainingText);
}
+ // To prevent removal of single anonymous block in RenderBlock::removeChild and causing
+ // |nextSibling| to go stale, we remove the old first letter using removeChildNode first.
+ firstLetterContainer->virtualChildren()->removeChildNode(firstLetterContainer, firstLetter);
firstLetter->destroy();
firstLetter = newFirstLetter;
firstLetterContainer->addChild(firstLetter, nextSibling);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes