Title: [99026] branches/chromium/912
- Revision
- 99026
- Author
- cev...@google.com
- Date
- 2011-11-01 18:51:12 -0700 (Tue, 01 Nov 2011)
Log Message
Merge 98010
BUG=100177
Review URL: http://codereview.chromium.org/8437038
Modified Paths
Added Paths
Diff
Copied: branches/chromium/912/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 => 99026)
--- branches/chromium/912/LayoutTests/fast/css-generated-content/after-with-first-letter-float-crash-expected.txt (rev 0)
+++ branches/chromium/912/LayoutTests/fast/css-generated-content/after-with-first-letter-float-crash-expected.txt 2011-11-02 01:51:12 UTC (rev 99026)
@@ -0,0 +1 @@
+PASS, if the script does not cause a crash or ASSERT failure
Copied: branches/chromium/912/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 => 99026)
--- branches/chromium/912/LayoutTests/fast/css-generated-content/after-with-first-letter-float-crash.html (rev 0)
+++ branches/chromium/912/LayoutTests/fast/css-generated-content/after-with-first-letter-float-crash.html 2011-11-02 01:51:12 UTC (rev 99026)
@@ -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/912/Source/WebCore/rendering/RenderBlock.cpp (99025 => 99026)
--- branches/chromium/912/Source/WebCore/rendering/RenderBlock.cpp 2011-11-02 01:42:16 UTC (rev 99025)
+++ branches/chromium/912/Source/WebCore/rendering/RenderBlock.cpp 2011-11-02 01:51:12 UTC (rev 99026)
@@ -5569,6 +5569,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.
@@ -5599,7 +5600,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/912/Source/WebCore/rendering/RenderObjectChildList.cpp (99025 => 99026)
--- branches/chromium/912/Source/WebCore/rendering/RenderObjectChildList.cpp 2011-11-02 01:42:16 UTC (rev 99025)
+++ branches/chromium/912/Source/WebCore/rendering/RenderObjectChildList.cpp 2011-11-02 01:51:12 UTC (rev 99026)
@@ -286,9 +286,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;
}
@@ -449,14 +453,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
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes