Bug 144696

Summary: `width: 1%` on nested table cell causes its table to hog horizontal space
Product: WebKit Reporter: Chris Rebert <webkit>
Component: TablesAssignee: zalan <zalan>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, dbates, eoconnor, esprehn+autocc, glenn, kondapallykalyan, mmaxfield, simon.fraser, thorton, webkit-bug-importer, zalan
Priority: P2 Keywords: HasReduction, InRadar
Version: WebKit Nightly Build   
Hardware: Mac (Intel)   
OS: OS X 10.11   
URL: http://jsfiddle.net/eejzdf4a/
Bug Depends on:    
Bug Blocks: 159753    
Attachments:
Description Flags
Screenshot of example demonstrating bug
none
Copy of the JS Fiddle example
none
Patch
none
Archive of layout-test-results from ews126 for ios-simulator-wk2
none
Patch none

Description Chris Rebert 2015-05-06 10:50:26 PDT
Created attachment 252491 [details]
Screenshot of example demonstrating bug

Platform: OS X Yosemite
Safari Version: 8.0.5 (10600.5.17)

Summary:
Adding a `width: 1%;` style to a nested table cell causes its sibling cell to hog horizontal space.
Firefox and IE11/Edge don't suffer from this problem.

To reproduce:
1. Open http://jsfiddle.net/eejzdf4a/ in Safari.
2. Look at the Result pane in the lower-right of the window.

Expected results:
In the portion of the example titled "Wonky", the green and yellow cells
should each take up a somewhat equal amount of horizontal space.
The green and yellow cells should have the same boundaries that they do
in the portion of the example titled '"Fixed" by removing the one-percent class'.
(See the Firefox screenshot. IE11/Edge gives the same result as Firefox.)

Actual results:
In the portion of the example titled "Wonky", the green cell takes up a
very small amount of horizontal space, whereas the yellow cell
takes up almost all of the horizontal space.
The green and yellow cells have different boundaries than they do
in the portion of the example titled '"Fixed" by removing the one-percent class'.
(See the Safari screenshot.)

Bootstrap bug report:
    https://github.com/twbs/bootstrap/issues/16372
Original corresponding Chrome bug report:
    https://code.google.com/p/chromium/issues/detail?id=427994
Other, more complex example of the bug, that uses Bootstrap:
    http://jsfiddle.net/rq3shh3t/2/
Comment 1 Chris Rebert 2015-05-06 10:53:55 PDT
Created attachment 252493 [details]
Copy of the JS Fiddle example
Comment 2 Chris Rebert 2015-05-06 11:17:16 PDT
Also filed this in Radar:

<rdar://problem/20839572>
Comment 3 Myles C. Maxfield 2015-07-20 15:27:15 PDT
<rdar://problem/20839572>
Comment 4 Chris Rebert 2016-05-19 10:25:30 PDT
Fixed in Chrome: https://codereview.chromium.org/1921973005
Comment 5 zalan 2016-05-19 10:27:18 PDT
(In reply to comment #4)
> Fixed in Chrome: https://codereview.chromium.org/1921973005
Awesome! I'll take a look at it.
Thanks for the headsup.
Comment 6 zalan 2016-05-20 15:06:03 PDT
Created attachment 279505 [details]
Patch
Comment 7 Tim Horton 2016-05-20 15:41:50 PDT
Comment on attachment 279505 [details]
Patch

rs=me on the merge, hyatt said it was ok too
Comment 8 Build Bot 2016-05-20 15:59:51 PDT
Comment on attachment 279505 [details]
Patch

Attachment 279505 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: http://webkit-queues.webkit.org/results/1355742

New failing tests:
fast/table/max-width-integer-overflow.html
fast/table/border-collapsing/cached-change-tbody-border-width.html
fast/table/border-collapsing/cached-change-row-border-width.html
Comment 9 Build Bot 2016-05-20 15:59:54 PDT
Created attachment 279510 [details]
Archive of layout-test-results from ews126 for ios-simulator-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews126  Port: ios-simulator-wk2  Platform: Mac OS X 10.11.4
Comment 10 zalan 2016-05-20 16:06:15 PDT
Created attachment 279511 [details]
Patch
Comment 11 WebKit Commit Bot 2016-05-20 16:55:32 PDT
Comment on attachment 279511 [details]
Patch

Clearing flags on attachment: 279511

Committed r201234: <http://trac.webkit.org/changeset/201234>
Comment 12 WebKit Commit Bot 2016-05-20 16:55:44 PDT
All reviewed patches have been landed.  Closing bug.
Comment 13 Chris Rebert 2016-05-28 13:28:38 PDT
Wonderful! Thanks zalan!

Updated the Wall accordingly: https://github.com/twbs/bootstrap/pull/19958