Title: [137786] trunk
Revision
137786
Author
commit-qu...@webkit.org
Date
2012-12-14 15:52:00 -0800 (Fri, 14 Dec 2012)

Log Message

Emphasis mark is printed after inline-block with justify
https://bugs.webkit.org/show_bug.cgi?id=104631

Patch by Yuki Sekiguchi <yuki.sekigu...@access-company.com> on 2012-12-14
Reviewed by Dean Jackson.

Source/WebCore:

Do not print an emphasis mark after an inline-block when justified.

If an inline-block is expanded, it has a space appended to it.
This space should not have any emphasis marks drawn.

Test: fast/inline/justify-emphasis-inline-box.html

* platform/graphics/SimpleFontData.h:
(WebCore::SimpleFontData::zeroWidthSpaceGlyph): Add getter method to get zero width space glyph.
* platform/graphics/WidthIterator.cpp:
(WebCore::WidthIterator::advanceInternal): We use zero width space for the extra space not to draw emphasis marks.

LayoutTests:

Test that emphasis marks are not drawn incorrectly in justified text with inline boxes.

* fast/inline/justify-emphasis-inline-box.html: Added.
* platform/chromium-mac/fast/inline/justify-emphasis-inline-box-expected.png: Added.
* platform/chromium-mac/fast/inline/justify-emphasis-inline-box-expected.txt: Added.
* platform/mac/fast/inline/justify-emphasis-inline-box-expected.txt: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (137785 => 137786)


--- trunk/LayoutTests/ChangeLog	2012-12-14 23:47:29 UTC (rev 137785)
+++ trunk/LayoutTests/ChangeLog	2012-12-14 23:52:00 UTC (rev 137786)
@@ -1,3 +1,17 @@
+2012-12-14  Yuki Sekiguchi  <yuki.sekigu...@access-company.com>
+
+        Emphasis mark is printed after inline-block with justify
+        https://bugs.webkit.org/show_bug.cgi?id=104631
+
+        Reviewed by Dean Jackson.
+
+        Test that emphasis marks are not drawn incorrectly in justified text with inline boxes.
+
+        * fast/inline/justify-emphasis-inline-box.html: Added.
+        * platform/chromium-mac/fast/inline/justify-emphasis-inline-box-expected.png: Added.
+        * platform/chromium-mac/fast/inline/justify-emphasis-inline-box-expected.txt: Added.
+        * platform/mac/fast/inline/justify-emphasis-inline-box-expected.txt: Added.
+
 2012-12-14  Beth Dakin  <bda...@apple.com>
 
         Updating these results again since this failing test has started failing in a new 

Added: trunk/LayoutTests/fast/inline/justify-emphasis-inline-box.html (0 => 137786)


--- trunk/LayoutTests/fast/inline/justify-emphasis-inline-box.html	                        (rev 0)
+++ trunk/LayoutTests/fast/inline/justify-emphasis-inline-box.html	2012-12-14 23:52:00 UTC (rev 137786)
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+</head>
+<body>
+<!-- There should be no emphasis mark at the top of first line(span's position). -->
+<div style="text-align:justify;-webkit-text-emphasis-style: dot filled; width: 200px; font-family: Ahem">
+<span style="display: inline-block"></span>あaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+</div>
+</body>
+</html>

Modified: trunk/LayoutTests/platform/chromium/TestExpectations (137785 => 137786)


--- trunk/LayoutTests/platform/chromium/TestExpectations	2012-12-14 23:47:29 UTC (rev 137785)
+++ trunk/LayoutTests/platform/chromium/TestExpectations	2012-12-14 23:52:00 UTC (rev 137786)
@@ -4237,3 +4237,6 @@
 webkit.org/b/104848 [ Linux XP SnowLeopard Lion Release ] fast/frames/sandboxed-iframe-attribute-parsing.html [ Pass Failure ]
 webkit.org/b/104848 [ SnowLeopard Debug ] fast/frames/sandboxed-iframe-attribute-parsing.html [ Pass Failure ]
 webkit.org/b/104848 [ Release ] fast/frames/sandboxed-iframe-parsing-space-characters.html [ Pass Failure ]
+
+# New test
+webkit.org/b/104631 fast/inline/justify-emphasis-inline-box.html [ Missing ]

Added: trunk/LayoutTests/platform/chromium-mac/fast/inline/justify-emphasis-inline-box-expected.png (0 => 137786)


--- trunk/LayoutTests/platform/chromium-mac/fast/inline/justify-emphasis-inline-box-expected.png	                        (rev 0)
+++ trunk/LayoutTests/platform/chromium-mac/fast/inline/justify-emphasis-inline-box-expected.png	2012-12-14 23:52:00 UTC (rev 137786)
@@ -0,0 +1,8 @@
+\x89PNG
+
+
+IHDR X\x9Av\x82p)tEXtchec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x8E;6kkks\xF8\xF0\xE1\xB9馛\xBD.\xC0\xD2 \xF0'^~\xF9\xE5\xF9\xF9\xE7\x9F\xE7\xBE\xFB{\xF7.z\x80\xA5'@\x80\xCC_\xFEȡC\x87\xFE\xF4\xFA\xE6\xE6\xA6y\xF3\xE6͛7o~\x87\xCD\xFC]\xFE\xF2\x90\x95\x95\x95?\xBD~\xA1g޼y\xF3\xE6͛_\xBEy\x80\xBF\x8B\x9F\xE12\xC8 #@\x80\x8C2\xC8\xFC\xE5s@\xFE\xD7\xDF	7o޼y\xF3\xE6\xCD/\xDF<\xC0\xDF\xE5\x82\xE7\x80\xDCu\xD7]\xD5.\xC0?\xC4\xF1\xE3\xC7\xBD\xB0C]0@.tp\xB0\xF38\x98\xF8\xF1 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\xCC%\xBA\xE1\xF8\xF1\xE3\xC5\xC0E`e{{{{\xD1K\xAF`d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\x90 @F\x80d\xFE
+o\xF0\x9C\x92\xB6\x96IEND\xAEB`\x82
\ No newline at end of file

Added: trunk/LayoutTests/platform/chromium-mac/fast/inline/justify-emphasis-inline-box-expected.txt (0 => 137786)


--- trunk/LayoutTests/platform/chromium-mac/fast/inline/justify-emphasis-inline-box-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/chromium-mac/fast/inline/justify-emphasis-inline-box-expected.txt	2012-12-14 23:52:00 UTC (rev 137786)
@@ -0,0 +1,10 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x64
+  RenderBlock {HTML} at (0,0) size 800x64
+    RenderBody {BODY} at (8,8) size 784x48
+      RenderBlock {DIV} at (0,0) size 200x48
+        RenderBlock {SPAN} at (0,21) size 0x0
+        RenderText {#text} at (0,8) size 512x40
+          text run at (0,8) width 200: "\x{3042}"
+          text run at (0,32) width 512: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"

Added: trunk/LayoutTests/platform/mac/fast/inline/justify-emphasis-inline-box-expected.txt (0 => 137786)


--- trunk/LayoutTests/platform/mac/fast/inline/justify-emphasis-inline-box-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/mac/fast/inline/justify-emphasis-inline-box-expected.txt	2012-12-14 23:52:00 UTC (rev 137786)
@@ -0,0 +1,10 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x64
+  RenderBlock {HTML} at (0,0) size 800x64
+    RenderBody {BODY} at (8,8) size 784x48
+      RenderBlock {DIV} at (0,0) size 200x48
+        RenderBlock {SPAN} at (0,21) size 0x0
+        RenderText {#text} at (0,8) size 512x40
+          text run at (0,8) width 200: "\x{3042}"
+          text run at (0,32) width 512: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"

Modified: trunk/Source/WebCore/ChangeLog (137785 => 137786)


--- trunk/Source/WebCore/ChangeLog	2012-12-14 23:47:29 UTC (rev 137785)
+++ trunk/Source/WebCore/ChangeLog	2012-12-14 23:52:00 UTC (rev 137786)
@@ -1,3 +1,22 @@
+2012-12-14  Yuki Sekiguchi  <yuki.sekigu...@access-company.com>
+
+        Emphasis mark is printed after inline-block with justify
+        https://bugs.webkit.org/show_bug.cgi?id=104631
+
+        Reviewed by Dean Jackson.
+
+        Do not print an emphasis mark after an inline-block when justified.
+
+        If an inline-block is expanded, it has a space appended to it.
+        This space should not have any emphasis marks drawn.
+
+        Test: fast/inline/justify-emphasis-inline-box.html
+
+        * platform/graphics/SimpleFontData.h:
+        (WebCore::SimpleFontData::zeroWidthSpaceGlyph): Add getter method to get zero width space glyph.
+        * platform/graphics/WidthIterator.cpp:
+        (WebCore::WidthIterator::advanceInternal): We use zero width space for the extra space not to draw emphasis marks.
+
 2012-12-14  Jer Noble  <jer.no...@apple.com>
 
         Unreviewed bug fix after r137782.

Modified: trunk/Source/WebCore/platform/graphics/SimpleFontData.h (137785 => 137786)


--- trunk/Source/WebCore/platform/graphics/SimpleFontData.h	2012-12-14 23:47:29 UTC (rev 137785)
+++ trunk/Source/WebCore/platform/graphics/SimpleFontData.h	2012-12-14 23:52:00 UTC (rev 137786)
@@ -157,6 +157,7 @@
 
     Glyph spaceGlyph() const { return m_spaceGlyph; }
     void setSpaceGlyph(Glyph spaceGlyph) { m_spaceGlyph = spaceGlyph; }
+    Glyph zeroWidthSpaceGlyph() const { return m_zeroWidthSpaceGlyph; }
     void setZeroWidthSpaceGlyph(Glyph spaceGlyph) { m_zeroWidthSpaceGlyph = spaceGlyph; }
     bool isZeroWidthSpaceGlyph(Glyph glyph) const { return glyph == m_zeroWidthSpaceGlyph && glyph; }
 

Modified: trunk/Source/WebCore/platform/graphics/WidthIterator.cpp (137785 => 137786)


--- trunk/Source/WebCore/platform/graphics/WidthIterator.cpp	2012-12-14 23:47:29 UTC (rev 137785)
+++ trunk/Source/WebCore/platform/graphics/WidthIterator.cpp	2012-12-14 23:52:00 UTC (rev 137786)
@@ -223,9 +223,12 @@
                         float expansionAtThisOpportunity = !m_run.applyWordRounding() ? m_expansionPerOpportunity : roundf(previousExpansion) - roundf(m_expansion);
                         m_runWidthSoFar += expansionAtThisOpportunity;
                         if (glyphBuffer) {
-                            if (glyphBuffer->isEmpty())
-                                glyphBuffer->add(fontData->spaceGlyph(), fontData, expansionAtThisOpportunity);
-                            else
+                            if (glyphBuffer->isEmpty()) {
+                                if (m_forTextEmphasis)
+                                    glyphBuffer->add(fontData->zeroWidthSpaceGlyph(), fontData, m_expansionPerOpportunity);
+                                else
+                                    glyphBuffer->add(fontData->spaceGlyph(), fontData, expansionAtThisOpportunity);
+                            } else
                                 glyphBuffer->expandLastAdvance(expansionAtThisOpportunity);
                         }
                         previousExpansion = m_expansion;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to