Title: [97086] branches/chromium/874
Revision
97086
Author
infe...@chromium.org
Date
2011-10-10 14:21:41 -0700 (Mon, 10 Oct 2011)

Log Message

Merge 97075 - Style for updated due to inability to locate

:before content in presence of listmarkers and runins.

BUG=97599
Review URL: http://codereview.chromium.org/8216022

Modified Paths

Added Paths

Diff

Copied: branches/chromium/874/LayoutTests/fast/lists/inline-before-content-after-list-marker-expected.png (from rev 97075, trunk/LayoutTests/fast/lists/inline-before-content-after-list-marker-expected.png)


(Binary files differ)

Copied: branches/chromium/874/LayoutTests/fast/lists/inline-before-content-after-list-marker-expected.txt (from rev 97075, trunk/LayoutTests/fast/lists/inline-before-content-after-list-marker-expected.txt) (0 => 97086)


--- branches/chromium/874/LayoutTests/fast/lists/inline-before-content-after-list-marker-expected.txt	                        (rev 0)
+++ branches/chromium/874/LayoutTests/fast/lists/inline-before-content-after-list-marker-expected.txt	2011-10-10 21:21:41 UTC (rev 97086)
@@ -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

Copied: branches/chromium/874/LayoutTests/fast/lists/inline-before-content-after-list-marker.html (from rev 97075, trunk/LayoutTests/fast/lists/inline-before-content-after-list-marker.html) (0 => 97086)


--- branches/chromium/874/LayoutTests/fast/lists/inline-before-content-after-list-marker.html	                        (rev 0)
+++ branches/chromium/874/LayoutTests/fast/lists/inline-before-content-after-list-marker.html	2011-10-10 21:21:41 UTC (rev 97086)
@@ -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>

Copied: branches/chromium/874/LayoutTests/fast/runin/runin-between-list-marker-and-before-content-expected.png (from rev 97075, trunk/LayoutTests/fast/runin/runin-between-list-marker-and-before-content-expected.png)


(Binary files differ)

Copied: branches/chromium/874/LayoutTests/fast/runin/runin-between-list-marker-and-before-content-expected.txt (from rev 97075, trunk/LayoutTests/fast/runin/runin-between-list-marker-and-before-content-expected.txt) (0 => 97086)


--- branches/chromium/874/LayoutTests/fast/runin/runin-between-list-marker-and-before-content-expected.txt	                        (rev 0)
+++ branches/chromium/874/LayoutTests/fast/runin/runin-between-list-marker-and-before-content-expected.txt	2011-10-10 21:21:41 UTC (rev 97086)
@@ -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"

Copied: branches/chromium/874/LayoutTests/fast/runin/runin-between-list-marker-and-before-content.html (from rev 97075, trunk/LayoutTests/fast/runin/runin-between-list-marker-and-before-content.html) (0 => 97086)


--- branches/chromium/874/LayoutTests/fast/runin/runin-between-list-marker-and-before-content.html	                        (rev 0)
+++ branches/chromium/874/LayoutTests/fast/runin/runin-between-list-marker-and-before-content.html	2011-10-10 21:21:41 UTC (rev 97086)
@@ -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>

Copied: branches/chromium/874/LayoutTests/fast/runin/runin-into-div-with-float-child-expected.png (from rev 97075, trunk/LayoutTests/fast/runin/runin-into-div-with-float-child-expected.png)


(Binary files differ)

Copied: branches/chromium/874/LayoutTests/fast/runin/runin-into-div-with-float-child-expected.txt (from rev 97075, trunk/LayoutTests/fast/runin/runin-into-div-with-float-child-expected.txt) (0 => 97086)


--- branches/chromium/874/LayoutTests/fast/runin/runin-into-div-with-float-child-expected.txt	                        (rev 0)
+++ branches/chromium/874/LayoutTests/fast/runin/runin-into-div-with-float-child-expected.txt	2011-10-10 21:21:41 UTC (rev 97086)
@@ -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"

Copied: branches/chromium/874/LayoutTests/fast/runin/runin-into-div-with-float-child.html (from rev 97075, trunk/LayoutTests/fast/runin/runin-into-div-with-float-child.html) (0 => 97086)


--- branches/chromium/874/LayoutTests/fast/runin/runin-into-div-with-float-child.html	                        (rev 0)
+++ branches/chromium/874/LayoutTests/fast/runin/runin-into-div-with-float-child.html	2011-10-10 21:21:41 UTC (rev 97086)
@@ -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>

Copied: branches/chromium/874/LayoutTests/fast/runin/runin-not-go-into-float-expected.png (from rev 97075, trunk/LayoutTests/fast/runin/runin-not-go-into-float-expected.png)


(Binary files differ)

Copied: branches/chromium/874/LayoutTests/fast/runin/runin-not-go-into-float-expected.txt (from rev 97075, trunk/LayoutTests/fast/runin/runin-not-go-into-float-expected.txt) (0 => 97086)


--- branches/chromium/874/LayoutTests/fast/runin/runin-not-go-into-float-expected.txt	                        (rev 0)
+++ branches/chromium/874/LayoutTests/fast/runin/runin-not-go-into-float-expected.txt	2011-10-10 21:21:41 UTC (rev 97086)
@@ -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"

Copied: branches/chromium/874/LayoutTests/fast/runin/runin-not-go-into-float.html (from rev 97075, trunk/LayoutTests/fast/runin/runin-not-go-into-float.html) (0 => 97086)


--- branches/chromium/874/LayoutTests/fast/runin/runin-not-go-into-float.html	                        (rev 0)
+++ branches/chromium/874/LayoutTests/fast/runin/runin-not-go-into-float.html	2011-10-10 21:21:41 UTC (rev 97086)
@@ -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: branches/chromium/874/Source/WebCore/rendering/RenderBlock.cpp (97085 => 97086)


--- branches/chromium/874/Source/WebCore/rendering/RenderBlock.cpp	2011-10-10 21:17:17 UTC (rev 97085)
+++ branches/chromium/874/Source/WebCore/rendering/RenderBlock.cpp	2011-10-10 21:21:41 UTC (rev 97086)
@@ -1557,13 +1557,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: branches/chromium/874/Source/WebCore/rendering/RenderObject.cpp (97085 => 97086)


--- branches/chromium/874/Source/WebCore/rendering/RenderObject.cpp	2011-10-10 21:17:17 UTC (rev 97085)
+++ branches/chromium/874/Source/WebCore/rendering/RenderObject.cpp	2011-10-10 21:21:41 UTC (rev 97086)
@@ -381,7 +381,7 @@
     return o;
 }
 
-RenderObject* RenderObject::nextInPreOrder(RenderObject* stayWithin) const
+RenderObject* RenderObject::nextInPreOrder(const RenderObject* stayWithin) const
 {
     if (RenderObject* o = firstChild())
         return o;
@@ -389,7 +389,7 @@
     return nextInPreOrderAfterChildren(stayWithin);
 }
 
-RenderObject* RenderObject::nextInPreOrderAfterChildren(RenderObject* stayWithin) const
+RenderObject* RenderObject::nextInPreOrderAfterChildren(const RenderObject* stayWithin) const
 {
     if (this == stayWithin)
         return 0;

Modified: branches/chromium/874/Source/WebCore/rendering/RenderObject.h (97085 => 97086)


--- branches/chromium/874/Source/WebCore/rendering/RenderObject.h	2011-10-10 21:17:17 UTC (rev 97085)
+++ branches/chromium/874/Source/WebCore/rendering/RenderObject.h	2011-10-10 21:21:41 UTC (rev 97086)
@@ -164,9 +164,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: branches/chromium/874/Source/WebCore/rendering/RenderObjectChildList.cpp (97085 => 97086)


--- branches/chromium/874/Source/WebCore/rendering/RenderObjectChildList.cpp	2011-10-10 21:17:17 UTC (rev 97085)
+++ branches/chromium/874/Source/WebCore/rendering/RenderObjectChildList.cpp	2011-10-10 21:21:41 UTC (rev 97086)
@@ -297,15 +297,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)
@@ -315,20 +310,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;
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to