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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutReplaced.cpp

Issue 1587023002: SVG with zero intrinsic size should be respected always (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/svg/custom/object-sizing-zero-intrinsic-width-height-expected.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/LayoutReplaced.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutReplaced.cpp b/third_party/WebKit/Source/core/layout/LayoutReplaced.cpp
index 3e42a90b09d1e94d92945c587cc63ba4d5902a08..c5f778d14a0a874302fb2c7b3e4df3356fb4507a 100644
--- a/third_party/WebKit/Source/core/layout/LayoutReplaced.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutReplaced.cpp
@@ -282,6 +282,9 @@ LayoutUnit LayoutReplaced::computeReplacedLogicalWidth(ShouldComputePreferred sh
bool computedHeightIsAuto = hasAutoHeightOrContainingBlockWithAutoHeight();
bool hasIntrinsicWidth = constrainedSize.width() > 0;
+ if (!hasIntrinsicWidth && contentLayoutObject)
+ hasIntrinsicWidth = contentLayoutObject->style()->logicalWidth().isFixed();
davve 2016/01/18 15:52:48 You rely on the (logical) intrinsic width being co
Shanmuga Pandi 2016/01/20 06:09:34 Instead of LogicalWidth()/Height(), getting hasInt
+
// If 'height' and 'width' both have computed values of 'auto' and the element also has an intrinsic width, then that intrinsic width is the used value of 'width'.
if (computedHeightIsAuto && hasIntrinsicWidth)
return computeReplacedLogicalWidthRespectingMinMaxWidth(constrainedSize.width(), shouldComputePreferred);
@@ -344,6 +347,9 @@ LayoutUnit LayoutReplaced::computeReplacedLogicalHeight() const
bool widthIsAuto = style()->logicalWidth().isAuto();
bool hasIntrinsicHeight = constrainedSize.height() > 0;
+ if (!hasIntrinsicHeight && contentLayoutObject)
+ hasIntrinsicHeight = contentLayoutObject->style()->logicalHeight().isFixed();
+
// If 'height' and 'width' both have computed values of 'auto' and the element also has an intrinsic height, then that intrinsic height is the used value of 'height'.
if (widthIsAuto && hasIntrinsicHeight)
return computeReplacedLogicalHeightRespectingMinMaxHeight(constrainedSize.height());
« no previous file with comments | « third_party/WebKit/LayoutTests/svg/custom/object-sizing-zero-intrinsic-width-height-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698