Bug 126674 - CSS word-spacing property does not obey percentages
Summary: CSS word-spacing property does not obey percentages
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Myles C. Maxfield
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-08 17:52 PST by Myles C. Maxfield
Modified: 2014-01-10 16:28 PST (History)
12 users (show)

See Also:


Attachments
Patch (23.37 KB, patch)
2014-01-10 12:18 PST, Myles C. Maxfield
no flags Details | Formatted Diff | Diff
Patch (297.01 KB, patch)
2014-01-10 12:49 PST, Myles C. Maxfield
simon.fraser: review+
buildbot: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from webkit-ews-01 for mac-mountainlion (508.05 KB, application/zip)
2014-01-10 14:22 PST, Build Bot
no flags Details
Archive of layout-test-results from webkit-ews-03 for mac-mountainlion (554.94 KB, application/zip)
2014-01-10 15:33 PST, Build Bot
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Myles C. Maxfield 2014-01-08 17:52:58 PST
According to the CSS3 spec [1]: "<percentage>: Specifies the additional spacing as a percentage of the affected character's advance measure."

[1] http://www.w3.org/TR/css3-text/#word-spacing
Comment 1 Myles C. Maxfield 2014-01-08 17:53:49 PST
Using Lengths for word-spacing and letter-spacing is a good idea.
Comment 2 Myles C. Maxfield 2014-01-10 12:18:07 PST
Created attachment 220874 [details]
Patch
Comment 3 WebKit Commit Bot 2014-01-10 12:21:10 PST
Attachment 220874 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'LayoutTests/ChangeLog', u'LayoutTests/fast/css3-text/css3-word-spacing-percentage/word-spacing-change-font-expected.html', u'LayoutTests/fast/css3-text/css3-word-spacing-percentage/word-spacing-change-font.html', u'LayoutTests/fast/css3-text/css3-word-spacing-percentage/word-spacing-percentage-expected.html', u'LayoutTests/fast/css3-text/css3-word-spacing-percentage/word-spacing-percentage-parse-expected.txt', u'LayoutTests/fast/css3-text/css3-word-spacing-percentage/word-spacing-percentage-parse.html', u'LayoutTests/fast/css3-text/css3-word-spacing-percentage/word-spacing-percentage.html', u'Source/WebCore/ChangeLog', u'Source/WebCore/css/CSSComputedStyleDeclaration.cpp', u'Source/WebCore/css/CSSParser.cpp', u'Source/WebCore/css/DeprecatedStyleBuilder.cpp', u'Source/WebCore/page/animation/CSSPropertyAnimation.cpp', u'Source/WebCore/rendering/RenderBlockLineLayout.cpp', u'Source/WebCore/rendering/RenderText.cpp', u'Source/WebCore/rendering/SimpleLineLayout.cpp', u'Source/WebCore/rendering/line/BreakingContextInlineHeaders.h', u'Source/WebCore/rendering/style/RenderStyle.cpp', u'Source/WebCore/rendering/style/RenderStyle.h', u'Source/WebCore/rendering/style/StyleRareInheritedData.cpp', u'Source/WebCore/rendering/style/StyleRareInheritedData.h', '--commit-queue']" exit_code: 1
ERROR: Source/WebCore/css/CSSParser.cpp:2151:  One space before end of line comments  [whitespace/comments] [5]
Total errors found: 1 in 20 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 4 Myles C. Maxfield 2014-01-10 12:24:41 PST
The comments (style error) are used throughout CSSParser. I am being consistent.
Comment 5 Myles C. Maxfield 2014-01-10 12:49:24 PST
Created attachment 220878 [details]
Patch
Comment 6 Myles C. Maxfield 2014-01-10 12:50:03 PST
This new style error looks like it's caused by the binary (.png) file.
Comment 7 WebKit Commit Bot 2014-01-10 12:51:45 PST
Attachment 220878 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'LayoutTests/ChangeLog', u'LayoutTests/css1/text_properties/word_spacing.html', u'LayoutTests/css2.1/20110323/c541-word-sp-001-expected.html', u'LayoutTests/css2.1/20110323/c541-word-sp-001.htm', u'LayoutTests/fast/css3-text/css3-word-spacing-percentage/word-spacing-change-font-expected.html', u'LayoutTests/fast/css3-text/css3-word-spacing-percentage/word-spacing-change-font.html', u'LayoutTests/fast/css3-text/css3-word-spacing-percentage/word-spacing-percentage-expected.html', u'LayoutTests/fast/css3-text/css3-word-spacing-percentage/word-spacing-percentage-parse-expected.txt', u'LayoutTests/fast/css3-text/css3-word-spacing-percentage/word-spacing-percentage-parse.html', u'LayoutTests/fast/css3-text/css3-word-spacing-percentage/word-spacing-percentage.html', u'LayoutTests/platform/mac/css1/text_properties/word_spacing-expected.png', u'LayoutTests/platform/mac/css1/text_properties/word_spacing-expected.txt', u'Source/WebCore/ChangeLog', u'Source/WebCore/css/CSSComputedStyleDeclaration.cpp', u'Source/WebCore/css/CSSParser.cpp', u'Source/WebCore/css/DeprecatedStyleBuilder.cpp', u'Source/WebCore/page/animation/CSSPropertyAnimation.cpp', u'Source/WebCore/rendering/RenderBlockLineLayout.cpp', u'Source/WebCore/rendering/RenderText.cpp', u'Source/WebCore/rendering/SimpleLineLayout.cpp', u'Source/WebCore/rendering/line/BreakingContextInlineHeaders.h', u'Source/WebCore/rendering/style/RenderStyle.cpp', u'Source/WebCore/rendering/style/RenderStyle.h', u'Source/WebCore/rendering/style/StyleRareInheritedData.cpp', u'Source/WebCore/rendering/style/StyleRareInheritedData.h', '--commit-queue']" exit_code: 1
Traceback (most recent call last):
  File "Tools/Scripts/check-webkit-style", line 48, in <module>
    sys.exit(CheckWebKitStyle().main())
  File "/Volumes/Data/StyleQueue/WebKit/Tools/Scripts/webkitpy/style/main.py", line 154, in main
    patch_checker.check(patch)
  File "/Volumes/Data/StyleQueue/WebKit/Tools/Scripts/webkitpy/style/patchreader.py", line 71, in check
    self._text_file_reader.process_file(file_path=path, line_numbers=None)
  File "/Volumes/Data/StyleQueue/WebKit/Tools/Scripts/webkitpy/style/filereader.py", line 118, in process_file
    lines = self._read_lines(file_path)
  File "/Volumes/Data/StyleQueue/WebKit/Tools/Scripts/webkitpy/style/filereader.py", line 86, in _read_lines
    contents = file.read()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/codecs.py", line 671, in read
    return self.reader.read(size)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/codecs.py", line 477, in read
    newchars, decodedbytes = self.decode(data, self.errors)
UnicodeDecodeError: 'utf8' codec can't decode byte 0x89 in position 0: invalid start byte


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 8 Myles C. Maxfield 2014-01-10 12:53:59 PST
Relevant style bug is here: https://bugs.webkit.org/show_bug.cgi?id=126702
Comment 9 Myles C. Maxfield 2014-01-10 12:57:56 PST
Comment on attachment 220878 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=220878&action=review

> LayoutTests/css1/text_properties/word_spacing.html:19
> +.ten {word-spacing: -0.2em;}

Image uses wrong scrollbars

> LayoutTests/css2.1/20110323/c541-word-sp-001.htm:15
>     .eleven {word-spacing: -1em;}

Rename eleven to ten
Comment 10 Simon Fraser (smfr) 2014-01-10 13:25:20 PST
Comment on attachment 220878 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=220878&action=review

> Source/WebCore/rendering/RenderText.cpp:686
>      const Font& f = style.font(); // FIXME: This ignores first-line.
> -    float wordSpacing = style.wordSpacing();
> +    float wordSpacing = f.wordSpacing();

Please rename "f" to something longer.

> Source/WebCore/rendering/SimpleLineLayout.cpp:143
> +    if (style.wordSpacing().getFloatValue() || style.letterSpacing())

!isZero()?

> LayoutTests/ChangeLog:23
> +        * platform/mac/css1/text_properties/word_spacing-expected.png:

You should figure out why this doesn't have a mock scrollbar.
Comment 11 Myles C. Maxfield 2014-01-10 13:54:10 PST
Comment on attachment 220878 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=220878&action=review

>> Source/WebCore/rendering/RenderText.cpp:686
>> +    float wordSpacing = f.wordSpacing();
> 
> Please rename "f" to something longer.

Done.

>> Source/WebCore/rendering/SimpleLineLayout.cpp:143
>> +    if (style.wordSpacing().getFloatValue() || style.letterSpacing())
> 
> !isZero()?

Done.
Comment 12 Build Bot 2014-01-10 14:21:58 PST
Comment on attachment 220878 [details]
Patch

Attachment 220878 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.appspot.com/results/4625311215910912

New failing tests:
fast/css3-text/css3-word-spacing-percentage/word-spacing-change-font.html
Comment 13 Build Bot 2014-01-10 14:22:01 PST
Created attachment 220888 [details]
Archive of layout-test-results from webkit-ews-01 for mac-mountainlion

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: webkit-ews-01  Port: mac-mountainlion  Platform: Mac OS X 10.8.5
Comment 14 Build Bot 2014-01-10 15:33:22 PST
Comment on attachment 220878 [details]
Patch

Attachment 220878 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.appspot.com/results/6408786050809856

New failing tests:
fast/css3-text/css3-word-spacing-percentage/word-spacing-change-font.html
Comment 15 Build Bot 2014-01-10 15:33:25 PST
Created attachment 220899 [details]
Archive of layout-test-results from webkit-ews-03 for mac-mountainlion

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: webkit-ews-03  Port: mac-mountainlion  Platform: Mac OS X 10.8.5
Comment 16 Myles C. Maxfield 2014-01-10 16:18:28 PST
Comment on attachment 220878 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=220878&action=review

>> LayoutTests/ChangeLog:23
>> +        * platform/mac/css1/text_properties/word_spacing-expected.png:
> 
> You should figure out why this doesn't have a mock scrollbar.

filed https://bugs.webkit.org/show_bug.cgi?id=126787 (this occurs on ToT)
Comment 17 Myles C. Maxfield 2014-01-10 16:28:33 PST
http://trac.webkit.org/changeset/161696