Diff
Modified: trunk/LayoutTests/ChangeLog (97074 => 97075)
--- trunk/LayoutTests/ChangeLog 2011-10-10 18:58:12 UTC (rev 97074)
+++ trunk/LayoutTests/ChangeLog 2011-10-10 19:47:17 UTC (rev 97075)
@@ -1,5 +1,26 @@
2011-10-10 Abhishek Arya <infe...@chromium.org>
+ Style for updated due to inability to locate
+ :before content in presence of listmarkers and runins.
+ https://bugs.webkit.org/show_bug.cgi?id=68624
+
+ Reviewed by Dan Bernstein.
+
+ * fast/lists/inline-before-content-after-list-marker-expected.png: Added.
+ * fast/lists/inline-before-content-after-list-marker-expected.txt: Added.
+ * fast/lists/inline-before-content-after-list-marker.html: Added.
+ * fast/runin/runin-between-list-marker-and-before-content-expected.png: Added.
+ * fast/runin/runin-between-list-marker-and-before-content-expected.txt: Added.
+ * fast/runin/runin-between-list-marker-and-before-content.html: Added.
+ * fast/runin/runin-into-div-with-float-child-expected.png: Added.
+ * fast/runin/runin-into-div-with-float-child-expected.txt: Added.
+ * fast/runin/runin-into-div-with-float-child.html: Added.
+ * fast/runin/runin-not-go-into-float-expected.png: Added.
+ * fast/runin/runin-not-go-into-float-expected.txt: Added.
+ * fast/runin/runin-not-go-into-float.html: Added.
+
+2011-10-10 Abhishek Arya <infe...@chromium.org>
+
Handle insertion into an anonymous table part that
is followed by a non-anonymous block correctly.
https://bugs.webkit.org/show_bug.cgi?id=69536
Added: trunk/LayoutTests/fast/lists/inline-before-content-after-list-marker-expected.png
(Binary files differ)
Property changes on: trunk/LayoutTests/fast/lists/inline-before-content-after-list-marker-expected.png
___________________________________________________________________
Added: svn:mime-type
Added: trunk/LayoutTests/fast/lists/inline-before-content-after-list-marker-expected.txt (0 => 97075)
--- trunk/LayoutTests/fast/lists/inline-before-content-after-list-marker-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/lists/inline-before-content-after-list-marker-expected.txt 2011-10-10 19:47:17 UTC (rev 97075)
@@ -0,0 +1,14 @@
+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (0,0) size 800x56
+ RenderBlock {HTML} at (0,0) size 800x56
+ RenderBody {BODY} at (8,8) size 784x40 [color=#008000]
+ RenderListItem {LI} at (0,0) size 784x40
+ RenderBlock (anonymous) at (0,0) size 784x40
+ RenderListMarker at (-1,0) size 13x40: bullet
+ RenderInline (generated) at (0,0) size 80x40
+ RenderText at (32,0) size 80x40
+ text run at (32,0) width 80: "PA"
+ RenderText {#text} at (112,0) size 80x40
+ text run at (112,0) width 80: "SS"
+ RenderBlock {DIV} at (0,40) size 784x0
Added: trunk/LayoutTests/fast/lists/inline-before-content-after-list-marker.html (0 => 97075)
--- trunk/LayoutTests/fast/lists/inline-before-content-after-list-marker.html (rev 0)
+++ trunk/LayoutTests/fast/lists/inline-before-content-after-list-marker.html 2011-10-10 19:47:17 UTC (rev 97075)
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<!-- Test passes if you see green text only and no "PA" repetition -->
+<html>
+<body style="font-family: ahem; font-size: 40px; -webkit-font-smoothing: none;">
+<style>
+li:before { content: "PA"; }
+</style>
+<li>SS
+<div></div>
+</li>
+<script>
+document.body.offsetTop;
+document.body.style.color = "green";
+</script>
+</body>
+</html>
Added: trunk/LayoutTests/fast/runin/runin-between-list-marker-and-before-content-expected.png
(Binary files differ)
Property changes on: trunk/LayoutTests/fast/runin/runin-between-list-marker-and-before-content-expected.png
___________________________________________________________________
Added: svn:mime-type
Added: trunk/LayoutTests/fast/runin/runin-between-list-marker-and-before-content-expected.txt (0 => 97075)
--- trunk/LayoutTests/fast/runin/runin-between-list-marker-and-before-content-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/runin/runin-between-list-marker-and-before-content-expected.txt 2011-10-10 19:47:17 UTC (rev 97075)
@@ -0,0 +1,15 @@
+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (0,0) size 800x56
+ RenderBlock {HTML} at (0,0) size 800x56
+ RenderBody {BODY} at (8,8) size 784x40
+ RenderListItem {LI} at (0,0) size 784x40 [color=#0000FF]
+ RenderListMarker at (-1,0) size 13x40: bullet
+ RenderInline (run-in) {DIV} at (0,0) size 200x40 [color=#008000]
+ RenderText {#text} at (32,0) size 200x40
+ text run at (32,0) width 200: "RUNIN"
+ RenderInline (generated) at (0,0) size 80x40
+ RenderText at (232,0) size 80x40
+ text run at (232,0) width 80: "AB"
+ RenderText {#text} at (312,0) size 80x40
+ text run at (312,0) width 80: "CD"
Added: trunk/LayoutTests/fast/runin/runin-between-list-marker-and-before-content.html (0 => 97075)
--- trunk/LayoutTests/fast/runin/runin-between-list-marker-and-before-content.html (rev 0)
+++ trunk/LayoutTests/fast/runin/runin-between-list-marker-and-before-content.html 2011-10-10 19:47:17 UTC (rev 97075)
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<!-- Test passes if you see RUNIN between list marker and ABCD. All text should be of same 40px size. -->
+<html>
+<body style="font-family: ahem; font-size: 10px; -webkit-font-smoothing: none;">
+<style>
+li:before { content: "AB"; }
+</style>
+<div style="display: run-in; color: green">RUNIN</div>
+<li style="color: blue">CD</li>
+<script>
+document.body.offsetTop;
+document.body.style.fontSize = "40px";
+</script>
+</body>
+</html>
Added: trunk/LayoutTests/fast/runin/runin-into-div-with-float-child-expected.png
(Binary files differ)
Property changes on: trunk/LayoutTests/fast/runin/runin-into-div-with-float-child-expected.png
___________________________________________________________________
Added: svn:mime-type
Added: trunk/LayoutTests/fast/runin/runin-into-div-with-float-child-expected.txt (0 => 97075)
--- trunk/LayoutTests/fast/runin/runin-into-div-with-float-child-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/runin/runin-into-div-with-float-child-expected.txt 2011-10-10 19:47:17 UTC (rev 97075)
@@ -0,0 +1,17 @@
+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (0,0) size 800x56
+ RenderBlock {HTML} at (0,0) size 800x56
+ RenderBody {BODY} at (8,8) size 784x40
+ RenderBlock {DIV} at (0,0) size 784x40 [color=#008000]
+ RenderInline (run-in) {DIV} at (0,0) size 160x40 [color=#FFA500]
+ RenderText {#text} at (40,0) size 160x40
+ text run at (40,0) width 160: "ABCD"
+ RenderInline (generated) at (0,0) size 160x40 [color=#0000FF]
+ RenderText at (200,0) size 160x40
+ text run at (200,0) width 160: "EFGH"
+ RenderBlock (floating) {DIV} at (0,0) size 40x40
+ RenderText {#text} at (0,0) size 40x40
+ text run at (0,0) width 40: "A"
+ RenderText {#text} at (360,0) size 160x40
+ text run at (360,0) width 160: "IJKL"
Added: trunk/LayoutTests/fast/runin/runin-into-div-with-float-child.html (0 => 97075)
--- trunk/LayoutTests/fast/runin/runin-into-div-with-float-child.html (rev 0)
+++ trunk/LayoutTests/fast/runin/runin-into-div-with-float-child.html 2011-10-10 19:47:17 UTC (rev 97075)
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<!-- You should see green A, followed by orange ABCD, followed by blue EFGH and green IJKL. None of these should be repeated and all should be of 40px size. -->
+<html>
+<body style="font-family: ahem; font-size: 10px; -webkit-font-smoothing: none;">
+<style>
+#test::before {
+ content: "EFGH";
+ color: blue;
+}
+</style>
+<div style="display: run-in; color: orange">ABCD</div><div id="test" style="color: green"><div style="float:left">A</div>IJKL</div>
+<script>
+document.body.offsetTop;
+document.body.style.fontSize = "40px";
+</script>
+</body>
+</html>
Added: trunk/LayoutTests/fast/runin/runin-not-go-into-float-expected.png
(Binary files differ)
Property changes on: trunk/LayoutTests/fast/runin/runin-not-go-into-float-expected.png
___________________________________________________________________
Added: svn:mime-type
Added: trunk/LayoutTests/fast/runin/runin-not-go-into-float-expected.txt (0 => 97075)
--- trunk/LayoutTests/fast/runin/runin-not-go-into-float-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/runin/runin-not-go-into-float-expected.txt 2011-10-10 19:47:17 UTC (rev 97075)
@@ -0,0 +1,18 @@
+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (0,0) size 800x96
+ RenderBlock {HTML} at (0,0) size 800x96
+ RenderBody {BODY} at (8,8) size 784x80
+ RenderBlock {DIV} at (0,0) size 784x80 [color=#0000FF]
+ RenderBlock (generated) at (0,0) size 784x40 [color=#008000]
+ RenderText at (0,0) size 160x40
+ text run at (0,0) width 160: "PASS"
+ RenderBlock (floating) {SPAN} at (0,40) size 160x40
+ RenderInline (generated) at (0,0) size 80x40
+ RenderText at (0,0) size 80x40
+ text run at (0,0) width 80: "EF"
+ RenderText {#text} at (80,0) size 80x40
+ text run at (80,0) width 80: "AB"
+ RenderBlock {DIV} at (0,40) size 784x40
+ RenderText {#text} at (160,0) size 80x40
+ text run at (160,0) width 80: "CD"
Added: trunk/LayoutTests/fast/runin/runin-not-go-into-float.html (0 => 97075)
--- trunk/LayoutTests/fast/runin/runin-not-go-into-float.html (rev 0)
+++ trunk/LayoutTests/fast/runin/runin-not-go-into-float.html 2011-10-10 19:47:17 UTC (rev 97075)
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<!-- PASS on one line, followed by EFABCD on the second line. All text should be of same size 40 px. -->
+<html>
+<body style="font-family: ahem; font-size: 10px; -webkit-font-smoothing: none;">
+<style>
+#target:before {
+ content: "PASS";
+ display: run-in;
+ color: green;
+}
+span:before {
+ content: "EF";
+}
+</style>
+<div id="target" style="color: blue">
+<span style="float: left">AB</span>
+<div id="inner">CD</div>
+</div>
+<script>
+document.body.offsetTop;
+document.body.style.fontSize = "40px";
+</script>
+</body>
+</html>
Modified: trunk/Source/WebCore/ChangeLog (97074 => 97075)
--- trunk/Source/WebCore/ChangeLog 2011-10-10 18:58:12 UTC (rev 97074)
+++ trunk/Source/WebCore/ChangeLog 2011-10-10 19:47:17 UTC (rev 97075)
@@ -1,5 +1,35 @@
2011-10-10 Abhishek Arya <infe...@chromium.org>
+ Style for updated due to inability to locate
+ :before content in presence of listmarkers and runins.
+ https://bugs.webkit.org/show_bug.cgi?id=68624
+
+ Reviewed by Dan Bernstein.
+
+ Tests: fast/lists/inline-before-content-after-list-marker.html
+ fast/runin/runin-between-list-marker-and-before-content.html
+ fast/runin/runin-into-div-with-float-child.html
+ fast/runin/runin-not-go-into-float.html
+
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::handleRunInChild): Fix as per spec that
+ we should not be skipping over floating/positioned renderers to
+ push runins into neighbouring block. This matches Opera renderings.
+ * rendering/RenderObject.cpp: Add const to parameter variable
+ to make call from beforePseudoElementRenderer easier. Also matches
+ CounterNode.h definition.
+ (WebCore::RenderObject::nextInPreOrder):
+ (WebCore::RenderObject::nextInPreOrderAfterChildren):
+ * rendering/RenderObject.h: Same const addition.
+ * rendering/RenderObjectChildList.cpp:
+ (WebCore::RenderObjectChildList::beforePseudoElementRenderer):
+ Remove skipping of floating/positioned renderers, similar to
+ handleRunIn. Revert code change in r94857 and add better next
+ sibling iterator. This addresses the layouttest in r94857 where
+ :before content is in its own anonymous rendertable.
+
+2011-10-10 Abhishek Arya <infe...@chromium.org>
+
Handle insertion into an anonymous table part that
is followed by a non-anonymous block correctly.
https://bugs.webkit.org/show_bug.cgi?id=69536
Modified: trunk/Source/WebCore/rendering/RenderBlock.cpp (97074 => 97075)
--- trunk/Source/WebCore/rendering/RenderBlock.cpp 2011-10-10 18:58:12 UTC (rev 97074)
+++ trunk/Source/WebCore/rendering/RenderBlock.cpp 2011-10-10 19:47:17 UTC (rev 97075)
@@ -1573,13 +1573,9 @@
if (!child->isRenderBlock())
return false;
- // Get the next non-positioned/non-floating RenderBlock.
RenderBlock* blockRunIn = toRenderBlock(child);
RenderObject* curr = blockRunIn->nextSibling();
- while (curr && curr->isFloatingOrPositioned())
- curr = curr->nextSibling();
-
- if (!curr || !curr->isRenderBlock() || !curr->childrenInline() || curr->isRunIn() || curr->isAnonymous())
+ if (!curr || !curr->isRenderBlock() || !curr->childrenInline() || curr->isRunIn() || curr->isAnonymous() || curr->isFloatingOrPositioned())
return false;
RenderBlock* currBlock = toRenderBlock(curr);
Modified: trunk/Source/WebCore/rendering/RenderObject.cpp (97074 => 97075)
--- trunk/Source/WebCore/rendering/RenderObject.cpp 2011-10-10 18:58:12 UTC (rev 97074)
+++ trunk/Source/WebCore/rendering/RenderObject.cpp 2011-10-10 19:47:17 UTC (rev 97075)
@@ -373,7 +373,7 @@
return o;
}
-RenderObject* RenderObject::nextInPreOrder(RenderObject* stayWithin) const
+RenderObject* RenderObject::nextInPreOrder(const RenderObject* stayWithin) const
{
if (RenderObject* o = firstChild())
return o;
@@ -381,7 +381,7 @@
return nextInPreOrderAfterChildren(stayWithin);
}
-RenderObject* RenderObject::nextInPreOrderAfterChildren(RenderObject* stayWithin) const
+RenderObject* RenderObject::nextInPreOrderAfterChildren(const RenderObject* stayWithin) const
{
if (this == stayWithin)
return 0;
Modified: trunk/Source/WebCore/rendering/RenderObject.h (97074 => 97075)
--- trunk/Source/WebCore/rendering/RenderObject.h 2011-10-10 18:58:12 UTC (rev 97074)
+++ trunk/Source/WebCore/rendering/RenderObject.h 2011-10-10 19:47:17 UTC (rev 97075)
@@ -171,9 +171,9 @@
virtual const RenderObjectChildList* virtualChildren() const { return 0; }
RenderObject* nextInPreOrder() const;
- RenderObject* nextInPreOrder(RenderObject* stayWithin) const;
+ RenderObject* nextInPreOrder(const RenderObject* stayWithin) const;
RenderObject* nextInPreOrderAfterChildren() const;
- RenderObject* nextInPreOrderAfterChildren(RenderObject* stayWithin) const;
+ RenderObject* nextInPreOrderAfterChildren(const RenderObject* stayWithin) const;
RenderObject* previousInPreOrder() const;
RenderObject* childAt(unsigned) const;
Modified: trunk/Source/WebCore/rendering/RenderObjectChildList.cpp (97074 => 97075)
--- trunk/Source/WebCore/rendering/RenderObjectChildList.cpp 2011-10-10 18:58:12 UTC (rev 97074)
+++ trunk/Source/WebCore/rendering/RenderObjectChildList.cpp 2011-10-10 19:47:17 UTC (rev 97075)
@@ -300,15 +300,10 @@
// generated inline run-in in the next level of children.
RenderObject* first = const_cast<RenderObject*>(owner);
do {
- // Skip list markers and generated run-ins
first = first->firstChild();
- while (first && first->isListMarker()) {
- if (first->parent() != owner && first->parent()->isAnonymousBlock())
- first = first->parent();
- first = first->nextSibling();
- }
- while (first && first->isRenderInline() && first->isRunIn())
- first = first->nextSibling();
+ // Skip list markers and generated run-ins.
+ while (first && (first->isListMarker() || (first->isRenderInline() && first->isRunIn())))
+ first = first->nextInPreOrderAfterChildren(owner);
} while (first && first->isAnonymous() && first->style()->styleType() == NOPSEUDO);
if (!first)
@@ -318,20 +313,17 @@
return first;
// Check for a possible generated run-in, using run-in positioning rules.
- // Skip inlines and floating / positioned blocks, and place as the first child.
first = owner->firstChild();
if (!first->isRenderBlock())
return 0;
- while (first && first->isFloatingOrPositioned())
+
+ first = first->firstChild();
+ // We still need to skip any list markers that could exist before the run-in.
+ while (first && first->isListMarker())
first = first->nextSibling();
- if (first) {
- first = first->firstChild();
- // We still need to skip any list markers that could exist before the run-in.
- while (first && first->isListMarker())
- first = first->nextSibling();
- if (first && first->style()->styleType() == BEFORE && first->isRenderInline() && first->isRunIn())
- return first;
- }
+ if (first && first->style()->styleType() == BEFORE && first->isRenderInline() && first->isRunIn())
+ return first;
+
return 0;
}