Title: [101039] branches/chromium/912
- Revision
- 101039
- Author
- cev...@google.com
- Date
- 2011-11-22 19:08:07 -0800 (Tue, 22 Nov 2011)
Log Message
Merge 100677
BUG=100958
Review URL: http://codereview.chromium.org/8674006
Modified Paths
Added Paths
Diff
Copied: branches/chromium/912/LayoutTests/fast/css-generated-content/positioned-generated-content-under-run-in-crash-expected.txt (from rev 100677, trunk/LayoutTests/fast/css-generated-content/positioned-generated-content-under-run-in-crash-expected.txt) (0 => 101039)
--- branches/chromium/912/LayoutTests/fast/css-generated-content/positioned-generated-content-under-run-in-crash-expected.txt (rev 0)
+++ branches/chromium/912/LayoutTests/fast/css-generated-content/positioned-generated-content-under-run-in-crash-expected.txt 2011-11-23 03:08:07 UTC (rev 101039)
@@ -0,0 +1,2 @@
+PASS, if no exceptions or crash observed
+
Copied: branches/chromium/912/LayoutTests/fast/css-generated-content/positioned-generated-content-under-run-in-crash.html (from rev 100677, trunk/LayoutTests/fast/css-generated-content/positioned-generated-content-under-run-in-crash.html) (0 => 101039)
--- branches/chromium/912/LayoutTests/fast/css-generated-content/positioned-generated-content-under-run-in-crash.html (rev 0)
+++ branches/chromium/912/LayoutTests/fast/css-generated-content/positioned-generated-content-under-run-in-crash.html 2011-11-23 03:08:07 UTC (rev 101039)
@@ -0,0 +1,22 @@
+<style>
+.testclass::before { position: absolute; content: ""; }
+.testclass { display: run-in; }
+</style>
+PASS, if no exceptions or crash observed
+<script>
+function runTest()
+{
+ test1 = document.createElement('div');
+ test1.setAttribute('class', 'testclass');
+ document.documentElement.appendChild(test1);
+ test2 = document.createElement('b');
+ test2.setAttribute('class', 'testclass');
+ document.documentElement.appendChild(test2);
+ test3 = document.createElement('div');
+ document.documentElement.appendChild(test3);
+ if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+}
+window._onload_ = runTest;
+</script>
+
Modified: branches/chromium/912/Source/WebCore/rendering/RenderBlock.cpp (101038 => 101039)
--- branches/chromium/912/Source/WebCore/rendering/RenderBlock.cpp 2011-11-23 02:58:26 UTC (rev 101038)
+++ branches/chromium/912/Source/WebCore/rendering/RenderBlock.cpp 2011-11-23 03:08:07 UTC (rev 101039)
@@ -1595,6 +1595,16 @@
RenderBlock* currBlock = toRenderBlock(curr);
+ // First we destroy any :before/:after content. It will be regenerated by the new inline.
+ // Exception is if the run-in itself is generated.
+ if (child->style()->styleType() != BEFORE && child->style()->styleType() != AFTER) {
+ RenderObject* generatedContent;
+ if (child->getCachedPseudoStyle(BEFORE) && (generatedContent = child->beforePseudoElementRenderer()))
+ generatedContent->destroy();
+ if (child->getCachedPseudoStyle(AFTER) && (generatedContent = child->afterPseudoElementRenderer()))
+ generatedContent->destroy();
+ }
+
// Remove the old child.
children()->removeChildNode(this, blockRunIn);
@@ -1603,16 +1613,11 @@
RenderInline* inlineRunIn = new (renderArena()) RenderInline(runInNode ? runInNode : document());
inlineRunIn->setStyle(blockRunIn->style());
- bool runInIsGenerated = child->style()->styleType() == BEFORE || child->style()->styleType() == AFTER;
-
- // Move the nodes from the old child to the new child, but skip any :before/:after content. It has already
- // been regenerated by the new inline.
+ // Move the nodes from the old child to the new child
for (RenderObject* runInChild = blockRunIn->firstChild(); runInChild;) {
RenderObject* nextSibling = runInChild->nextSibling();
- if (runInIsGenerated || (runInChild->style()->styleType() != BEFORE && runInChild->style()->styleType() != AFTER)) {
- blockRunIn->children()->removeChildNode(blockRunIn, runInChild, false);
- inlineRunIn->addChild(runInChild); // Use addChild instead of appendChildNode since it handles correct placement of the children relative to :after-generated content.
- }
+ blockRunIn->children()->removeChildNode(blockRunIn, runInChild, false);
+ inlineRunIn->addChild(runInChild); // Use addChild instead of appendChildNode since it handles correct placement of the children relative to :after-generated content.
runInChild = nextSibling;
}
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes