Bug 142608

Summary: Disallow ruby base from having leading or trailing expansions
Product: WebKit Reporter: Myles C. Maxfield <mmaxfield>
Component: New BugsAssignee: Myles C. Maxfield <mmaxfield>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, buildbot, commit-queue, dino, esprehn+autocc, glenn, hyatt, jonlee, kondapallykalyan, rniwa, simon.fraser, thorton
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 143273, 143292    
Bug Blocks: 143354    
Attachments:
Description Flags
No tests
none
Archive of layout-test-results from ews105 for mac-mavericks-wk2
none
Archive of layout-test-results from ews102 for mac-mavericks
none
WIP
none
WIP
none
WIP
none
WIP
none
Some tests
none
Some more tests
none
Simpler RTL test
none
WIP
none
WIP
none
RTL Complex test
none
WIP
none
Very close to being finished
none
Patch
none
Archive of layout-test-results from ews101 for mac-mavericks
none
Archive of layout-test-results from ews107 for mac-mavericks-wk2
none
Patch
none
Patch
none
WIP
none
Patch
none
Patch
hyatt: review+, buildbot: commit-queue-
Archive of layout-test-results from ews100 for mac-mavericks
none
Archive of layout-test-results from ews107 for mac-mavericks-wk2
none
Patch for landing
buildbot: commit-queue-
Archive of layout-test-results from ews101 for mac-mavericks
none
Archive of layout-test-results from ews104 for mac-mavericks-wk2
none
Patch for landing commit-queue: commit-queue-

Description Myles C. Maxfield 2015-03-11 21:01:41 PDT
Disallow ruby base from having leading nor trailing expansions
Comment 1 Myles C. Maxfield 2015-03-11 21:02:29 PDT
Created attachment 248483 [details]
No tests
Comment 2 Myles C. Maxfield 2015-03-11 21:07:40 PDT
Comment on attachment 248483 [details]
No tests

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

> Source/WebCore/rendering/RenderBlockLineLayout.cpp:801
> +        textAlign = CENTER;

This is where we could implement part of ruby-align
Comment 3 WebKit Commit Bot 2015-03-11 21:08:33 PDT
Attachment 248483 [details] did not pass style-queue:


ERROR: Source/WebCore/ChangeLog:8:  You should remove the 'No new tests' and either add and list tests, or explain why no new tests were possible.  [changelog/nonewtests] [5]
Total errors found: 1 in 3 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 4 Build Bot 2015-03-11 21:43:04 PDT
Comment on attachment 248483 [details]
No tests

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

New failing tests:
fast/ruby/positioned-ruby-text.html
fast/ruby/ruby-justification.html
Comment 5 Build Bot 2015-03-11 21:43:07 PDT
Created attachment 248488 [details]
Archive of layout-test-results from ews105 for mac-mavericks-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews105  Port: mac-mavericks-wk2  Platform: Mac OS X 10.9.5
Comment 6 Build Bot 2015-03-11 21:59:16 PDT
Comment on attachment 248483 [details]
No tests

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

New failing tests:
fast/ruby/positioned-ruby-text.html
fast/ruby/ruby-justification.html
Comment 7 Build Bot 2015-03-11 21:59:19 PDT
Created attachment 248490 [details]
Archive of layout-test-results from ews102 for mac-mavericks

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews102  Port: mac-mavericks  Platform: Mac OS X 10.9.5
Comment 8 Myles C. Maxfield 2015-03-12 08:17:17 PDT
Doesn't work with all-latin text, where expansion opportunities are not inserted at the end of every run.
Comment 9 Myles C. Maxfield 2015-03-13 10:22:39 PDT
Created attachment 248589 [details]
WIP
Comment 10 Myles C. Maxfield 2015-03-16 16:52:47 PDT
Created attachment 248769 [details]
WIP
Comment 11 Myles C. Maxfield 2015-03-16 17:21:11 PDT
Created attachment 248770 [details]
WIP
Comment 12 Myles C. Maxfield 2015-03-16 20:09:14 PDT
Created attachment 248789 [details]
WIP
Comment 13 Myles C. Maxfield 2015-03-16 20:09:29 PDT
Created attachment 248792 [details]
Some tests
Comment 14 Myles C. Maxfield 2015-03-17 13:13:38 PDT
Created attachment 248862 [details]
Some more tests
Comment 15 Myles C. Maxfield 2015-03-17 19:25:53 PDT
Created attachment 248900 [details]
Simpler RTL test
Comment 16 Myles C. Maxfield 2015-03-17 19:27:25 PDT
Created attachment 248901 [details]
WIP
Comment 17 Myles C. Maxfield 2015-03-18 11:33:19 PDT
Created attachment 248946 [details]
WIP
Comment 18 Myles C. Maxfield 2015-03-18 22:43:49 PDT
Created attachment 249017 [details]
RTL Complex test
Comment 19 Myles C. Maxfield 2015-03-18 22:50:34 PDT
Created attachment 249018 [details]
WIP
Comment 20 Myles C. Maxfield 2015-03-20 14:49:15 PDT
Created attachment 249137 [details]
Very close to being finished
Comment 21 Myles C. Maxfield 2015-03-20 20:34:04 PDT
Created attachment 249158 [details]
Patch
Comment 22 Build Bot 2015-03-20 21:39:40 PDT
Comment on attachment 249158 [details]
Patch

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

New failing tests:
fast/ruby/ruby-expansion-cjk-4.html
Comment 23 Build Bot 2015-03-20 21:39:48 PDT
Created attachment 249160 [details]
Archive of layout-test-results from ews101 for mac-mavericks

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews101  Port: mac-mavericks  Platform: Mac OS X 10.9.5
Comment 24 Build Bot 2015-03-20 21:45:24 PDT
Comment on attachment 249158 [details]
Patch

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

New failing tests:
fast/ruby/ruby-expansion-cjk-4.html
Comment 25 Build Bot 2015-03-20 21:45:29 PDT
Created attachment 249161 [details]
Archive of layout-test-results from ews107 for mac-mavericks-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews107  Port: mac-mavericks-wk2  Platform: Mac OS X 10.9.5
Comment 26 Myles C. Maxfield 2015-03-21 00:57:47 PDT
Created attachment 249168 [details]
Patch
Comment 27 Myles C. Maxfield 2015-03-21 12:03:34 PDT
Created attachment 249176 [details]
Patch
Comment 28 Myles C. Maxfield 2015-03-21 16:29:44 PDT
Win appears to be a false negative
Comment 29 Dave Hyatt 2015-03-24 12:38:10 PDT
Comment on attachment 249176 [details]
Patch

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

r-

> Source/WebCore/platform/graphics/WidthIterator.cpp:66
> +        if (run.forcesLeadingExpansion() && !m_isAfterExpansion && !FontCascade::initialExpansionOpportunity(m_run.text(), m_run.ltr() ? LTR : RTL))
> +            ++expansionOpportunityCount;
> +        if (run.forcesTrailingExpansion() && !isAfterExpansion)
> +            ++expansionOpportunityCount;
> +        else if (m_run.forbidsTrailingExpansion() && isAfterExpansion)
> +            --expansionOpportunityCount;

Seems like with some cleanup, this could could move inside FontCascade::expansionOpportunityCount? Maybe I am not understanding the code completely though.

> Source/WebCore/platform/graphics/mac/ComplexTextController.cpp:154
> +        if (run.forcesLeadingExpansion() && !m_afterExpansion && !FontCascade::initialExpansionOpportunity(m_run.text(), m_run.ltr() ? LTR : RTL))
> +            ++expansionOpportunityCount;
> +        if (run.forcesTrailingExpansion() && !isAfterExpansion)
> +            ++expansionOpportunityCount;
> +        else if (m_run.forbidsTrailingExpansion() && isAfterExpansion)
> +            --expansionOpportunityCount;

Same here. You had to repeat the same code. If you could shift this into FontCascade::expansionOpportunityCount, you could avoid duplicating code.

> Source/WebCore/rendering/RenderBlockLineLayout.cpp:740
> +                if (textBox.forceLeadingExpansion() && !FontCascade::initialExpansionOpportunity(renderText.stringView(), run->box()->direction()))
> +                    ++opportunitiesInRun;
> +                if (textBox.forceTrailingExpansion() && !isAfterExpansion)
> +                    ++opportunitiesInRun;

Why don't you need the forbidsTrailingExpansion() case that removes an opportunity that you had in the other code that was just after FontCascade::expansionOpporunityCount?

> Source/WebCore/rendering/RenderBlockLineLayout.cpp:761
>              if (is<RenderRubyRun>(run->renderer()) && textAlign == JUSTIFY && run != trailingSpaceRun && downcast<RenderRubyRun>(run->renderer()).rubyBase()) {

Seems like this code has gotten substantial enough to warrant its own helper function.
Comment 30 Myles C. Maxfield 2015-03-27 18:45:35 PDT
Created attachment 249633 [details]
WIP
Comment 31 Myles C. Maxfield 2015-03-30 17:39:56 PDT
Created attachment 249786 [details]
Patch
Comment 32 WebKit Commit Bot 2015-03-30 17:44:00 PDT
Attachment 249786 [details] did not pass style-queue:


ERROR: Source/WebCore/platform/text/TextHelpers.h:31:  enum members should use InterCaps with an initial capital letter.  [readability/enum_casing] [4]
Total errors found: 1 in 59 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 33 Myles C. Maxfield 2015-04-02 09:45:50 PDT
Created attachment 249987 [details]
Patch
Comment 34 Dave Hyatt 2015-04-02 09:55:05 PDT
Comment on attachment 249987 [details]
Patch

r=me
Comment 35 Build Bot 2015-04-02 10:37:43 PDT
Comment on attachment 249987 [details]
Patch

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

New failing tests:
fast/ruby/ruby-expansion-cjk-4.html
Comment 36 Build Bot 2015-04-02 10:37:47 PDT
Created attachment 249991 [details]
Archive of layout-test-results from ews100 for mac-mavericks

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews100  Port: mac-mavericks  Platform: Mac OS X 10.9.5
Comment 37 Build Bot 2015-04-02 10:45:16 PDT
Comment on attachment 249987 [details]
Patch

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

New failing tests:
fast/ruby/ruby-expansion-cjk-4.html
Comment 38 Build Bot 2015-04-02 10:45:21 PDT
Created attachment 249992 [details]
Archive of layout-test-results from ews107 for mac-mavericks-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews107  Port: mac-mavericks-wk2  Platform: Mac OS X 10.9.5
Comment 39 Myles C. Maxfield 2015-04-02 10:50:34 PDT
Created attachment 249994 [details]
Patch for landing
Comment 40 Build Bot 2015-04-02 11:42:12 PDT
Comment on attachment 249994 [details]
Patch for landing

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

New failing tests:
fast/ruby/ruby-expansion-cjk-4.html
Comment 41 Build Bot 2015-04-02 11:42:17 PDT
Created attachment 249998 [details]
Archive of layout-test-results from ews101 for mac-mavericks

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews101  Port: mac-mavericks  Platform: Mac OS X 10.9.5
Comment 42 Build Bot 2015-04-02 11:49:47 PDT
Comment on attachment 249994 [details]
Patch for landing

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

New failing tests:
fast/ruby/ruby-expansion-cjk-4.html
Comment 43 Build Bot 2015-04-02 11:49:52 PDT
Created attachment 250000 [details]
Archive of layout-test-results from ews104 for mac-mavericks-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews104  Port: mac-mavericks-wk2  Platform: Mac OS X 10.9.5
Comment 44 Myles C. Maxfield 2015-04-02 11:55:11 PDT
Created attachment 250001 [details]
Patch for landing
Comment 45 WebKit Commit Bot 2015-04-02 13:15:40 PDT
Comment on attachment 250001 [details]
Patch for landing

Rejecting attachment 250001 [details] from commit-queue.

Failed to run "['/Volumes/Data/EWS/WebKit/Tools/Scripts/webkit-patch', '--status-host=webkit-queues.appspot.com', '--bot-id=webkit-cq-01', 'validate-changelog', '--check-oops', '--non-interactive', 250001, '--port=mac']" exit_code: 1 cwd: /Volumes/Data/EWS/WebKit

ChangeLog entry in LayoutTests/ChangeLog contains OOPS!.

Full output: http://webkit-queues.appspot.com/results/5119113663873024
Comment 46 Myles C. Maxfield 2015-04-02 13:30:15 PDT
Committed r182286: <http://trac.webkit.org/changeset/182286>
Comment 47 Brent Fulgham 2015-04-02 16:51:56 PDT
These are tests are failing on Windows. Please add a skip (if relevant), or roll the patch out.
Comment 48 Brent Fulgham 2015-04-02 17:31:24 PDT
Actually, these tests are failing on EFL, GTK, and Windows. Do these changes rely on something Mac-specific?