Title: [99343] branches/chromium/874
- Revision
- 99343
- Author
- [email protected]
- Date
- 2011-11-04 18:20:20 -0700 (Fri, 04 Nov 2011)
Log Message
Merge 98010
BUG=100177
Review URL: http://codereview.chromium.org/8474016
Modified Paths
Added Paths
Diff
Copied: branches/chromium/874/LayoutTests/fast/css-generated-content/after-with-first-letter-float-crash-expected.txt (from rev 98010, trunk/LayoutTests/fast/css-generated-content/after-with-first-letter-float-crash-expected.txt) (0 => 99343)
--- branches/chromium/874/LayoutTests/fast/css-generated-content/after-with-first-letter-float-crash-expected.txt (rev 0)
+++ branches/chromium/874/LayoutTests/fast/css-generated-content/after-with-first-letter-float-crash-expected.txt 2011-11-05 01:20:20 UTC (rev 99343)
@@ -0,0 +1 @@
+PASS, if the script does not cause a crash or ASSERT failure
Copied: branches/chromium/874/LayoutTests/fast/css-generated-content/after-with-first-letter-float-crash.html (from rev 98010, trunk/LayoutTests/fast/css-generated-content/after-with-first-letter-float-crash.html) (0 => 99343)
--- branches/chromium/874/LayoutTests/fast/css-generated-content/after-with-first-letter-float-crash.html (rev 0)
+++ branches/chromium/874/LayoutTests/fast/css-generated-content/after-with-first-letter-float-crash.html 2011-11-05 01:20:20 UTC (rev 99343)
@@ -0,0 +1,19 @@
+<html>
+ <body>
+ <style type="text/css">
+ div::first-letter { float: right; content: "AB" }
+ div::after { display: table; content: "CD" }
+ </style>
+ <div></div>
+ PASS, if the script does not cause a crash or ASSERT failure
+ <script>
+ function runTest() {
+ document.body.offsetTop;
+ document.body.style.color = "blue";
+ if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+ }
+ window._onload_ = runTest;
+ </script>
+ </body>
+</html>
Modified: branches/chromium/874/Source/WebCore/rendering/RenderBlock.cpp (99342 => 99343)
--- branches/chromium/874/Source/WebCore/rendering/RenderBlock.cpp 2011-11-05 01:00:34 UTC (rev 99342)
+++ branches/chromium/874/Source/WebCore/rendering/RenderBlock.cpp 2011-11-05 01:20:20 UTC (rev 99343)
@@ -5483,6 +5483,7 @@
RenderObject* firstLetter = currChild->parent();
RenderObject* firstLetterContainer = firstLetter->parent();
RenderStyle* pseudoStyle = styleForFirstLetter(firstLetterBlock, firstLetterContainer);
+ ASSERT(firstLetter->isFloating() || firstLetter->isInline());
if (Node::diff(firstLetter->style(), pseudoStyle) == Node::Detach) {
// The first-letter renderer needs to be replaced. Create a new renderer of the right type.
@@ -5513,7 +5514,7 @@
next = next->nextSibling();
}
if (remainingText) {
- ASSERT(remainingText->node()->renderer() == remainingText);
+ ASSERT(remainingText->isAnonymous() || remainingText->node()->renderer() == remainingText);
// Replace the old renderer with the new one.
remainingText->setFirstLetter(newFirstLetter);
}
Modified: branches/chromium/874/Source/WebCore/rendering/RenderObjectChildList.cpp (99342 => 99343)
--- branches/chromium/874/Source/WebCore/rendering/RenderObjectChildList.cpp 2011-11-05 01:00:34 UTC (rev 99342)
+++ branches/chromium/874/Source/WebCore/rendering/RenderObjectChildList.cpp 2011-11-05 01:20:20 UTC (rev 99343)
@@ -283,9 +283,13 @@
if (!(object->isTable() || object->isTableSection() || object->isTableRow()))
return object;
+ // If there is a :first-letter style applied on the :before or :after content,
+ // then we want the parent of the first-letter block
RenderObject* beforeAfterParent = object;
- while (beforeAfterParent && !(beforeAfterParent->isText() || beforeAfterParent->isImage()))
+ while (beforeAfterParent && !(beforeAfterParent->isText() || beforeAfterParent->isImage())
+ && (beforeAfterParent->style()->styleType() != FIRST_LETTER))
beforeAfterParent = beforeAfterParent->firstChild();
+
return beforeAfterParent ? beforeAfterParent->parent() : 0;
}
@@ -446,14 +450,6 @@
ASSERT(genChild->isListMarker() || genChild->style()->styleType() == FIRST_LETTER);
}
}
-
- // Update style on the remaining text fragment after the first-letter.
- if (beforeAfterParent->style()->styleType() == FIRST_LETTER) {
- if (RenderObject* nextSibling = beforeAfterParent->nextSibling()) {
- if (nextSibling->isText() && nextSibling->style()->styleType() == child->style()->styleType())
- nextSibling->setStyle(pseudoElementStyle);
- }
- }
}
return; // We've updated the generated content. That's all we needed to do.
}
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes