Title: [172524] trunk
Revision
172524
Author
zol...@webkit.org
Date
2014-08-13 11:00:27 -0700 (Wed, 13 Aug 2014)

Log Message

[CSS3-Text] Add rendering support for the none value of text-justify property
https://bugs.webkit.org/show_bug.cgi?id=135349

Reviewed by David Hyatt.

Source/WebCore:

Spec: http://dev.w3.org/csswg/css-text-3/#valdef-text-justify.none

Test: fast/css3-text/css3-text-justify/text-justify-none.html

* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlockFlow::computeInlineDirectionPositionsForSegment):

LayoutTests:

* fast/css3-text/css3-text-justify/text-justify-none-expected.html: Added.
* fast/css3-text/css3-text-justify/text-justify-none.html: Added.
* platform/mac/TestExpectations:

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (172523 => 172524)


--- trunk/LayoutTests/ChangeLog	2014-08-13 17:24:34 UTC (rev 172523)
+++ trunk/LayoutTests/ChangeLog	2014-08-13 18:00:27 UTC (rev 172524)
@@ -1,3 +1,14 @@
+2014-08-13  Zoltan Horvath  <zol...@webkit.org>
+
+        [CSS3-Text] Add rendering support for the none value of text-justify property
+        https://bugs.webkit.org/show_bug.cgi?id=135349
+
+        Reviewed by David Hyatt.
+
+        * fast/css3-text/css3-text-justify/text-justify-none-expected.html: Added.
+        * fast/css3-text/css3-text-justify/text-justify-none.html: Added.
+        * platform/mac/TestExpectations:
+
 2014-08-13  Eric Carlson  <eric.carl...@apple.com>
 
         Media document sends incorrect referer header

Added: trunk/LayoutTests/fast/css3-text/css3-text-justify/text-justify-none-expected.html (0 => 172524)


--- trunk/LayoutTests/fast/css3-text/css3-text-justify/text-justify-none-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css3-text/css3-text-justify/text-justify-none-expected.html	2014-08-13 18:00:27 UTC (rev 172524)
@@ -0,0 +1,25 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<style>
+.test {
+    width: 400px;
+    border: 1px solid black;
+}
+</style>
+</head>
+<body>
+
+<p>This test checks that the 'none' value for text-justify property works properly.<br>
+All of the lines with the value should <b>NOT</b> be justified.</p>
+
+<p>text-align: justify</p>
+<div class='test' style="text-align: justify;">
+The Culture has achieved artificial intelligences where each Mind has thought processing capabilities many orders of magnitude beyond that of human beings, and data storage drives which, if written out on paper and stored...</div>
+
+<p>text-align: justify, text-justify: none</p>
+<div class='test'>
+The Culture has achieved artificial intelligences where each Mind has thought processing capabilities many orders of magnitude beyond that of human beings, and data storage drives which, if written out on paper and stored...</div>
+
+</body>
+</html>

Added: trunk/LayoutTests/fast/css3-text/css3-text-justify/text-justify-none.html (0 => 172524)


--- trunk/LayoutTests/fast/css3-text/css3-text-justify/text-justify-none.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css3-text/css3-text-justify/text-justify-none.html	2014-08-13 18:00:27 UTC (rev 172524)
@@ -0,0 +1,27 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<style>
+.test {
+    width: 400px;
+    border: 1px solid black;
+    text-align: justify;
+}
+</style>
+</head>
+<body>
+
+<p>This test checks that the 'none' value for text-justify property works properly.<br>
+All of the lines with the value should <b>NOT</b> be justified.</p>
+
+<p>text-align: justify</p>
+<div class='test'>
+The Culture has achieved artificial intelligences where each Mind has thought processing capabilities many orders of magnitude beyond that of human beings, and data storage drives which, if written out on paper and stored...
+</div>
+
+<p>text-align: justify, text-justify: none</p>
+<div class='test' style='-webkit-text-justify: none;'>
+The Culture has achieved artificial intelligences where each Mind has thought processing capabilities many orders of magnitude beyond that of human beings, and data storage drives which, if written out on paper and stored...
+</div>
+</body>
+</html>

Modified: trunk/LayoutTests/platform/mac/TestExpectations (172523 => 172524)


--- trunk/LayoutTests/platform/mac/TestExpectations	2014-08-13 17:24:34 UTC (rev 172523)
+++ trunk/LayoutTests/platform/mac/TestExpectations	2014-08-13 18:00:27 UTC (rev 172524)
@@ -741,7 +741,7 @@
 
 # CSS3 Text support is not yet enabled (needs ENABLE_CSS3_TEXT).
 webkit.org/b/76173 fast/css3-text/css3-text-align-last
-webkit.org/b/99945 fast/css3-text/css3-text-justify [ Failure ]
+webkit.org/b/99945 fast/css3-text/css3-text-justify [ Skip ]
 webkit.org/b/112755 fast/css3-text/css3-text-indent [ Failure ImageOnlyFailure ]
 webkit.org/b/58491 editing/pasteboard/insert-text-decoration.html [ Skip ]
 

Modified: trunk/Source/WebCore/ChangeLog (172523 => 172524)


--- trunk/Source/WebCore/ChangeLog	2014-08-13 17:24:34 UTC (rev 172523)
+++ trunk/Source/WebCore/ChangeLog	2014-08-13 18:00:27 UTC (rev 172524)
@@ -1,3 +1,17 @@
+2014-08-13  Zoltan Horvath  <zol...@webkit.org>
+
+        [CSS3-Text] Add rendering support for the none value of text-justify property
+        https://bugs.webkit.org/show_bug.cgi?id=135349
+
+        Reviewed by David Hyatt.
+
+        Spec: http://dev.w3.org/csswg/css-text-3/#valdef-text-justify.none
+
+        Test: fast/css3-text/css3-text-justify/text-justify-none.html
+
+        * rendering/RenderBlockLineLayout.cpp:
+        (WebCore::RenderBlockFlow::computeInlineDirectionPositionsForSegment):
+
 2014-08-13  Eric Carlson  <eric.carl...@apple.com>
 
         Media document sends incorrect referer header

Modified: trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp (172523 => 172524)


--- trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp	2014-08-13 17:24:34 UTC (rev 172523)
+++ trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp	2014-08-13 18:00:27 UTC (rev 172524)
@@ -348,12 +348,16 @@
 ETextAlign RenderBlockFlow::textAlignmentForLine(bool endsWithSoftBreak) const
 {
     ETextAlign alignment = style().textAlign();
+#if ENABLE(CSS3_TEXT)
+    TextJustify textJustify = style().textJustify();
+    if (alignment == JUSTIFY &&  textJustify == TextJustifyNone)
+        return style().direction() == LTR ? LEFT : RIGHT;
+#endif
+
     if (endsWithSoftBreak)
         return alignment;
 
-#if !ENABLE(CSS3_TEXT)
-    return (alignment == JUSTIFY) ? TASTART : alignment;
-#else
+#if ENABLE(CSS3_TEXT)
     if (alignment != JUSTIFY)
         return alignment;
 
@@ -372,11 +376,13 @@
     case TextAlignLastJustify:
         return JUSTIFY;
     case TextAlignLastAuto:
-        if (style().textJustify() == TextJustifyDistribute)
+        if (textJustify == TextJustifyDistribute)
             return JUSTIFY;
         return TASTART;
     }
     return alignment;
+#else
+    return (alignment == JUSTIFY) ? TASTART : alignment;
 #endif
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to