Title: [143993] trunk
Revision
143993
Author
commit-qu...@webkit.org
Date
2013-02-25 18:06:12 -0800 (Mon, 25 Feb 2013)

Log Message

Flexbox should ignore firstLetter pseudo element.
https://bugs.webkit.org/show_bug.cgi?id=105126

Patch by Xueqing Huang <huangxueq...@baidu.com> on 2013-02-25
Reviewed by Tony Chang.

Source/WebCore:

The CSS WG decided that first-line and first-letter should not
apply to flex containers.
http://dev.w3.org/csswg/css3-flexbox/issue-cr-2012#issue-13

tests:
css3/flexbox/flexbox-ignore-firstLetter.html
css3/flexbox/flexbox-ignore-container-firstLetter.html

* rendering/RenderBlock.cpp:
(WebCore::findFirstLetterBlock):

LayoutTests:

The CSS WG decided that first-line and first-letter should not
apply to flex containers.
http://dev.w3.org/csswg/css3-flexbox/issues-cr-2012#issue-13

* css3/flexbox/flexbox-ignore-container-firstLetter-expected.txt: Added.
* css3/flexbox/flexbox-ignore-container-firstLetter.html: Added.
* css3/flexbox/flexbox-ignore-firstLetter-expected.txt: Added.
* css3/flexbox/flexbox-ignore-firstLetter.html: Added.
* css3/flexbox/inline-flex-crash-expected.txt:
* css3/flexbox/inline-flex-crash2-expected.txt:

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (143992 => 143993)


--- trunk/LayoutTests/ChangeLog	2013-02-26 01:35:20 UTC (rev 143992)
+++ trunk/LayoutTests/ChangeLog	2013-02-26 02:06:12 UTC (rev 143993)
@@ -1,3 +1,21 @@
+2013-02-25  Xueqing Huang  <huangxueq...@baidu.com>
+
+        Flexbox should ignore firstLetter pseudo element.
+        https://bugs.webkit.org/show_bug.cgi?id=105126
+
+        Reviewed by Tony Chang.
+
+        The CSS WG decided that first-line and first-letter should not
+        apply to flex containers.
+        http://dev.w3.org/csswg/css3-flexbox/issues-cr-2012#issue-13
+
+        * css3/flexbox/flexbox-ignore-container-firstLetter-expected.txt: Added.
+        * css3/flexbox/flexbox-ignore-container-firstLetter.html: Added.
+        * css3/flexbox/flexbox-ignore-firstLetter-expected.txt: Added.
+        * css3/flexbox/flexbox-ignore-firstLetter.html: Added.
+        * css3/flexbox/inline-flex-crash-expected.txt:
+        * css3/flexbox/inline-flex-crash2-expected.txt:
+
 2013-02-25  James Simonsen  <simon...@chromium.org>
 
         [Resource Timing] Update test suite so it can be exported to the W3C

Added: trunk/LayoutTests/css3/flexbox/flexbox-ignore-container-firstLetter-expected.txt (0 => 143993)


--- trunk/LayoutTests/css3/flexbox/flexbox-ignore-container-firstLetter-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/css3/flexbox/flexbox-ignore-container-firstLetter-expected.txt	2013-02-26 02:06:12 UTC (rev 143993)
@@ -0,0 +1,7 @@
+This test flex item should ignore container's firstLetter pseudo element.
+
+The first item.
+
+The second item.
+
+PASS

Added: trunk/LayoutTests/css3/flexbox/flexbox-ignore-container-firstLetter.html (0 => 143993)


--- trunk/LayoutTests/css3/flexbox/flexbox-ignore-container-firstLetter.html	                        (rev 0)
+++ trunk/LayoutTests/css3/flexbox/flexbox-ignore-container-firstLetter.html	2013-02-26 02:06:12 UTC (rev 143993)
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html>
+<link href="" rel="stylesheet">
+<style>
+    .container { display: -webkit-flex }
+    .container::first-letter { line-height: 100px; }
+    p { line-height: 20px; }
+</style>
+
+<script src=""
+<body _onload_="checkLayout('.flexbox')">
+<p>This test flex item should ignore container's firstLetter pseudo element.</p>
+
+<div class="container">
+    <div class="flexbox">
+        <p data-expected-height=20>The first item.</p>
+        <p data-expected-height=20>The second item.</p>
+    </div>
+</div>
+</body>
+</html>

Added: trunk/LayoutTests/css3/flexbox/flexbox-ignore-firstLetter-expected.txt (0 => 143993)


--- trunk/LayoutTests/css3/flexbox/flexbox-ignore-firstLetter-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/css3/flexbox/flexbox-ignore-firstLetter-expected.txt	2013-02-26 02:06:12 UTC (rev 143993)
@@ -0,0 +1,13 @@
+This test flex item should ignore flex container's firstLetter pseudo element.
+
+The first item.
+
+The second item.
+
+PASS
+The first item.
+
+The second item.
+
+PASS
+

Added: trunk/LayoutTests/css3/flexbox/flexbox-ignore-firstLetter.html (0 => 143993)


--- trunk/LayoutTests/css3/flexbox/flexbox-ignore-firstLetter.html	                        (rev 0)
+++ trunk/LayoutTests/css3/flexbox/flexbox-ignore-firstLetter.html	2013-02-26 02:06:12 UTC (rev 143993)
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+<link href="" rel="stylesheet">
+<style>
+    div::first-letter { line-height: 100px; }
+    p { line-height: 20px; }
+</style>
+
+<script src=""
+<body _onload_="checkLayout('.flexbox'); checkLayout('.inline-flexbox')">
+<p>This test flex item should ignore flex container's firstLetter pseudo element.</p>
+
+<div class="flexbox">
+    <p data-expected-height=20>The first item.</p>
+    <p data-expected-height=20>The second item.</p>
+</div>
+<div class="inline-flexbox">
+    <p data-expected-height=20>The first item.</p>
+    <p data-expected-height=20>The second item.</p>
+</div>
+</body>
+</html>

Modified: trunk/LayoutTests/css3/flexbox/inline-flex-crash-expected.txt (143992 => 143993)


--- trunk/LayoutTests/css3/flexbox/inline-flex-crash-expected.txt	2013-02-26 01:35:20 UTC (rev 143992)
+++ trunk/LayoutTests/css3/flexbox/inline-flex-crash-expected.txt	2013-02-26 02:06:12 UTC (rev 143993)
@@ -1,5 +1,3 @@
 This test passes if it doesn't crash.
 
-AA
-
-؅
+AA؅

Modified: trunk/LayoutTests/css3/flexbox/inline-flex-crash2-expected.txt (143992 => 143993)


--- trunk/LayoutTests/css3/flexbox/inline-flex-crash2-expected.txt	2013-02-26 01:35:20 UTC (rev 143992)
+++ trunk/LayoutTests/css3/flexbox/inline-flex-crash2-expected.txt	2013-02-26 02:06:12 UTC (rev 143993)
@@ -1,5 +1,3 @@
 This test passes if it doesn't crash.
 
-AAAA
-
-A
+AAAAA

Modified: trunk/Source/WebCore/ChangeLog (143992 => 143993)


--- trunk/Source/WebCore/ChangeLog	2013-02-26 01:35:20 UTC (rev 143992)
+++ trunk/Source/WebCore/ChangeLog	2013-02-26 02:06:12 UTC (rev 143993)
@@ -1,3 +1,21 @@
+2013-02-25  Xueqing Huang  <huangxueq...@baidu.com>
+
+        Flexbox should ignore firstLetter pseudo element.
+        https://bugs.webkit.org/show_bug.cgi?id=105126
+
+        Reviewed by Tony Chang.
+
+        The CSS WG decided that first-line and first-letter should not
+        apply to flex containers.
+        http://dev.w3.org/csswg/css3-flexbox/issue-cr-2012#issue-13
+
+        tests:
+        css3/flexbox/flexbox-ignore-firstLetter.html
+        css3/flexbox/flexbox-ignore-container-firstLetter.html       
+
+        * rendering/RenderBlock.cpp:
+        (WebCore::findFirstLetterBlock):
+
 2013-02-25  Simon Fraser  <simon.fra...@apple.com>
 
         Lots of unnecessary DidLayout notifications when scrolling zoomed page with iframes

Modified: trunk/Source/WebCore/rendering/RenderBlock.cpp (143992 => 143993)


--- trunk/Source/WebCore/rendering/RenderBlock.cpp	2013-02-26 01:35:20 UTC (rev 143992)
+++ trunk/Source/WebCore/rendering/RenderBlock.cpp	2013-02-26 02:06:12 UTC (rev 143993)
@@ -6489,13 +6489,13 @@
     RenderObject* firstLetterBlock = start;
     while (true) {
         bool canHaveFirstLetterRenderer = firstLetterBlock->style()->hasPseudoStyle(FIRST_LETTER)
-            && firstLetterBlock->canHaveGeneratedChildren();
+            && firstLetterBlock->canHaveGeneratedChildren() && !firstLetterBlock->isFlexibleBox();
         if (canHaveFirstLetterRenderer)
             return firstLetterBlock;
 
         RenderObject* parentBlock = firstLetterBlock->parent();
         if (firstLetterBlock->isReplaced() || !parentBlock || parentBlock->firstChild() != firstLetterBlock || 
-            !parentBlock->isBlockFlow())
+            !parentBlock->isBlockFlow() || parentBlock->isFlexibleBox())
             return 0;
         firstLetterBlock = parentBlock;
     } 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to