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

Issue 325183002: Make preferred widths for replaced content independent on available width (Closed)

Created:
6 years, 6 months ago by davve
Modified:
6 years, 6 months ago
Reviewers:
pdr.
CC:
blink-reviews, blink-reviews-rendering, zoltan1, eae+blinkwatch, leviw+renderwatch, jchaffraix+rendering, pdr., rune+blink
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Visibility:
Public.

Description

Make replaced preferred widths independent on available width Prior to this patch, a replaced element with intrinsic ratio but with no intrinsic width nor height and with 'width', 'height' both computed values of 'auto', would have preferred width and preferred minimal width that depended on the available width of the container. After this patch, such a replaced element will have zero preferred width and zero preferred minimal width. Example: <!doctype html> <div style="width: 200px"> <svg viewBox="0 0 1 1" style="background: blue"> </svg> <div> <svg> becomes a 200x200 blue rectangle, intrinsic ratio (1) comes from viewBox attribute. Preferred minimal width and preferred width would be 200px prior to patch. Changing the width of <div> would require recalculating preferred widths on <svg>, something we rather not do, and does not currently do. (See RenderReplaced::needsPreferredWidthsRecalculation()). This means preferred minimal widths was left with stale values after changes to the container. The new behavior matches Firefox but is not yet in spec, possibly because the sizing of such replaced element is undefined in CSS 2.1, even though there is a suggestion, followed by Blink, in the spec. BUG=382922 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=176456

Patch Set 1 #

Patch Set 2 : Test setting preferred widths to zero instead of default object size #

Patch Set 3 : Move firstContainingBlockWithLogicalWidth removal to other CL; focus on bug at hand #

Patch Set 4 : Narrow fix impact and add test #

Patch Set 5 : Add one more test #

Total comments: 4

Patch Set 6 : Address review comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+68 lines, -0 lines) Patch
M LayoutTests/TestExpectations View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download
A LayoutTests/svg/custom/size-follows-container-size.html View 1 2 3 4 5 1 chunk +30 lines, -0 lines 0 comments Download
A LayoutTests/svg/custom/stf-container-with-intrinsic-ratio-svg.html View 1 2 3 4 5 1 chunk +34 lines, -0 lines 0 comments Download
M Source/core/rendering/RenderReplaced.cpp View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
davve
I would have included ojan as reviewer but apparently he only wants "code-yellow" reviews currently. ...
6 years, 6 months ago (2014-06-18 09:13:53 UTC) #1
pdr.
LGTM with nits https://codereview.chromium.org/325183002/diff/70001/LayoutTests/svg/custom/size-follows-container-size.html File LayoutTests/svg/custom/size-follows-container-size.html (right): https://codereview.chromium.org/325183002/diff/70001/LayoutTests/svg/custom/size-follows-container-size.html#newcode14 LayoutTests/svg/custom/size-follows-container-size.html:14: onload = setTimeout(function() { Can you ...
6 years, 6 months ago (2014-06-18 17:48:43 UTC) #2
davve
Thanks for the review! https://codereview.chromium.org/325183002/diff/70001/LayoutTests/svg/custom/size-follows-container-size.html File LayoutTests/svg/custom/size-follows-container-size.html (right): https://codereview.chromium.org/325183002/diff/70001/LayoutTests/svg/custom/size-follows-container-size.html#newcode14 LayoutTests/svg/custom/size-follows-container-size.html:14: onload = setTimeout(function() { On ...
6 years, 6 months ago (2014-06-18 19:16:47 UTC) #3
davve
The CQ bit was checked by davve@opera.com
6 years, 6 months ago (2014-06-18 19:16:57 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/davve@opera.com/325183002/90001
6 years, 6 months ago (2014-06-18 19:17:18 UTC) #5
commit-bot: I haz the power
6 years, 6 months ago (2014-06-18 21:55:25 UTC) #6
Message was sent while issue was closed.
Change committed as 176456

Powered by Google App Engine
This is Rietveld 408576698