Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(437)

Issue 1868013002: Percent height in auto height containers no longer computes as auto (Closed)

Created:
4 years, 8 months ago by rhogan
Modified:
4 years, 8 months ago
CC:
blink-reviews, blink-reviews-layout_chromium.org, chromium-reviews, eae+blinkwatch, jchaffraix+rendering, leviw+renderwatch, pdr+renderingwatchlist_chromium.org, szager+layoutwatch_chromium.org, zoltan1
Base URL:
https://chromium.googlesource.com/chromium/src.git@303728-6
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Percent height in auto height containers no longer computes as auto https://drafts.csswg.org/css2/visudet.html#the-height-property has changed. See http://lists.w3.org/Archives/Public/www-style/2013May/0201.html The section on percentage now reads: "<percentage> Specifies a percentage height. The percentage is calculated with respect to the height of the generated box's containing block. If the height of the containing block is not specified explicitly (i.e., it depends on content height), and this element is not absolutely positioned, the used height is calculated as if 'auto' was specified." The last clause used to read: "the value computes to 'auto'." So remove our attempt to treat percentage height in auto height containers as computed in RenderReplaced::computeReplacedLogicalWidth() and only treat actual computed style of auto as such. Once we remove this feature we find that when calculating used width for replaced elements we can end up in a situation where we need to factor in the 'used height' to our calculation. In certain circumstances, calculating the 'used height' requires the 'used width'. :) When this situation arises, use an estimate of the used width based on the intrinsic width of the replaced object if it's available and failing that use the width made available by its container. This circularity always existed I think and we always had to assume the 'used' width in this situation - it's just easier to surface now. BUG=396717 Committed: https://crrev.com/4f61ad0df953092181eb059d6c119893e4202d34 Cr-Commit-Position: refs/heads/master@{#388878}

Patch Set 1 #

Patch Set 2 : Updated #

Patch Set 3 : Updated #

Total comments: 1

Patch Set 4 : Updated #

Patch Set 5 : Updated #

Unified diffs Side-by-side diffs Delta from patch set Stats (+58 lines, -30 lines) Patch
A third_party/WebKit/LayoutTests/fast/images/percentage-height-image-with-auto-height-container-computes-as-percentage.html View 1 chunk +9 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/fast/images/percentage-height-image-with-auto-height-container-computes-as-percentage-expected.html View 1 chunk +9 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutBox.h View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutBox.cpp View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutReplaced.h View 1 2 3 4 2 chunks +4 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutReplaced.cpp View 1 2 3 4 5 chunks +25 lines, -18 lines 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutVideo.h View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutVideo.cpp View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/layout/svg/LayoutSVGRoot.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/layout/svg/LayoutSVGRoot.cpp View 1 2 2 chunks +2 lines, -2 lines 0 comments Download

Depends on Patchset:

Dependent Patchsets:

Messages

Total messages: 27 (9 generated)
rhogan
4 years, 8 months ago (2016-04-11 17:41:10 UTC) #4
rhogan
4 years, 8 months ago (2016-04-12 19:19:41 UTC) #6
rhogan
Hey guys - any of you got time to take a look?
4 years, 8 months ago (2016-04-14 18:21:46 UTC) #9
leviw_travelin_and_unemployed
This looks like cbiesinger's wheelhouse to me :)
4 years, 8 months ago (2016-04-14 22:24:39 UTC) #11
cbiesinger
I have a hard time seeing how the spec change relates to this code change. ...
4 years, 8 months ago (2016-04-15 21:44:30 UTC) #12
cbiesinger
and one nit: https://codereview.chromium.org/1868013002/diff/40001/third_party/WebKit/Source/core/layout/LayoutReplaced.cpp File third_party/WebKit/Source/core/layout/LayoutReplaced.cpp (right): https://codereview.chromium.org/1868013002/diff/40001/third_party/WebKit/Source/core/layout/LayoutReplaced.cpp#newcode581 third_party/WebKit/Source/core/layout/LayoutReplaced.cpp:581: return width; I would merge this ...
4 years, 8 months ago (2016-04-15 21:44:40 UTC) #13
rhogan
On 2016/04/15 at 21:44:30, cbiesinger wrote: > I have a hard time seeing how the ...
4 years, 8 months ago (2016-04-16 14:08:56 UTC) #14
davve
The circularity is indeed a bit confusing. The line of thinking goes something like "computeReplacedLogicalWidth ...
4 years, 8 months ago (2016-04-18 15:40:58 UTC) #15
rhogan
On 2016/04/18 at 15:40:58, davve wrote: > We call computeReplacedLogicalHeight to get that height, but ...
4 years, 8 months ago (2016-04-18 17:49:29 UTC) #16
cbiesinger
On 2016/04/18 17:49:29, rhogan wrote: > On 2016/04/18 at 15:40:58, davve wrote: > > We ...
4 years, 8 months ago (2016-04-18 21:52:04 UTC) #17
davve
On 2016/04/18 17:49:29, rhogan wrote: > On 2016/04/18 at 15:40:58, davve wrote: > > We ...
4 years, 8 months ago (2016-04-19 15:20:16 UTC) #18
rhogan
On 2016/04/19 at 15:20:16, davve wrote: > On 2016/04/18 17:49:29, rhogan wrote: > > On ...
4 years, 8 months ago (2016-04-19 20:14:44 UTC) #19
davve
On 2016/04/19 20:14:44, rhogan wrote: > > Yes... Which brings us to the possibility of ...
4 years, 8 months ago (2016-04-20 13:26:54 UTC) #20
rhogan
On 2016/04/20 at 13:26:54, davve wrote: > On 2016/04/19 20:14:44, rhogan wrote: > > > ...
4 years, 8 months ago (2016-04-20 18:07:17 UTC) #21
cbiesinger
On 2016/04/20 18:07:17, rhogan wrote: > On 2016/04/20 at 13:26:54, davve wrote: > > On ...
4 years, 8 months ago (2016-04-21 17:41:34 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1868013002/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1868013002/80001
4 years, 8 months ago (2016-04-21 17:42:33 UTC) #24
commit-bot: I haz the power
Committed patchset #5 (id:80001)
4 years, 8 months ago (2016-04-21 20:33:16 UTC) #25
commit-bot: I haz the power
4 years, 8 months ago (2016-04-22 19:38:43 UTC) #27
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/4f61ad0df953092181eb059d6c119893e4202d34
Cr-Commit-Position: refs/heads/master@{#388878}

Powered by Google App Engine
This is Rietveld 408576698