DescriptionMake 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 #
Messages
Total messages: 6 (0 generated)
|