Bug 148978

Summary: [css-grid] Percentage columns shouldn't include border and padding
Product: WebKit Reporter: Manuel Rego Casasnovas <rego>
Component: Layout and RenderingAssignee: Manuel Rego Casasnovas <rego>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, commit-queue, esprehn+autocc, glenn, jfernandez, kondapallykalyan, svillar
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 149002    
Bug Blocks: 60731    
Attachments:
Description Flags
Patch
none
Patch
none
Patch for landing
none
Rebased patch for landing none

Description Manuel Rego Casasnovas 2015-09-08 14:18:41 PDT
If you've a column with 100%, the size of the column is calculated including the border and padding of the grid container. This is not right and leads to weird results.

Example to reproduce the issue:
<div style="display: -webkit-grid; border: 5px solid black; padding: 25px; -webkit-grid: 100% / 100%; width: 200px; height: 200px;">
  <div style="background: lime;">item</div>
</div>

The height of the item is kept to 200px as it should, however the width goes to 260px (200 + 5 + 25 + 25 + 5) instead of 200px.

This was already reported and fixed in Blink:
https://code.google.com/p/chromium/issues/detail?id=529203
Comment 1 Rego GTK+ EWS Bot 2015-09-08 14:21:02 PDT
Created attachment 260792 [details]
Patch
Comment 2 Manuel Rego Casasnovas 2015-09-08 14:22:09 PDT
Created attachment 260793 [details]
Patch
Comment 3 WebKit Commit Bot 2015-09-09 02:58:07 PDT
Comment on attachment 260793 [details]
Patch

Rejecting attachment 260793 [details] from commit-queue.

Failed to run "['/Volumes/Data/EWS/WebKit/Tools/Scripts/webkit-patch', '--status-host=webkit-queues.webkit.org', '--bot-id=webkit-cq-03', 'apply-attachment', '--no-update', '--non-interactive', 260793, '--port=mac']" exit_code: 2 cwd: /Volumes/Data/EWS/WebKit

Last 500 characters of output:
 -- saving rejects to file Source/WebCore/rendering/RenderGrid.cpp.rej
patching file LayoutTests/ChangeLog
Hunk #1 succeeded at 1 with fuzz 3.
patching file LayoutTests/fast/css-grid-layout/grid-percent-track-margin-border-padding-expected.txt
patching file LayoutTests/fast/css-grid-layout/grid-percent-track-margin-border-padding.html

Failed to run "[u'/Volumes/Data/EWS/WebKit/Tools/Scripts/svn-apply', '--force', '--reviewer', u'Sergio Villar Senin']" exit_code: 1 cwd: /Volumes/Data/EWS/WebKit

Full output: http://webkit-queues.webkit.org/results/154060
Comment 4 Manuel Rego Casasnovas 2015-09-09 03:05:42 PDT
Created attachment 260853 [details]
Patch for landing
Comment 5 WebKit Commit Bot 2015-09-09 04:23:17 PDT
Comment on attachment 260853 [details]
Patch for landing

Clearing flags on attachment: 260853

Committed r189538: <http://trac.webkit.org/changeset/189538>
Comment 6 WebKit Commit Bot 2015-09-09 04:23:21 PDT
All reviewed patches have been landed.  Closing bug.
Comment 7 WebKit Commit Bot 2015-09-09 08:39:55 PDT
Re-opened since this is blocked by bug 149002
Comment 8 Alex Christensen 2015-09-09 08:41:50 PDT
Sorry. r189536 wouldn't rollout without rolling this out, too, because this touched RenderGrid.cpp after that patch. This might be good.
Comment 9 Manuel Rego Casasnovas 2015-09-09 13:10:42 PDT
Created attachment 260869 [details]
Rebased patch for landing
Comment 10 WebKit Commit Bot 2015-09-09 14:11:12 PDT
Comment on attachment 260869 [details]
Rebased patch for landing

Clearing flags on attachment: 260869

Committed r189550: <http://trac.webkit.org/changeset/189550>
Comment 11 WebKit Commit Bot 2015-09-09 14:11:18 PDT
All reviewed patches have been landed.  Closing bug.