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

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

Issue 1679743006: Expand IntrinsicSizingInfo for SVG (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@propagate-whether-svg-has
Patch Set: Created 4 years, 10 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
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 ce8a09d2ae5cc0fc947652224c6166d9947a88bc..4cc557758c1781999b5abd644be3d20fbf48382b 100644
--- a/third_party/WebKit/Source/core/layout/LayoutReplaced.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutReplaced.cpp
@@ -32,7 +32,6 @@
#include "core/paint/PaintInfo.h"
#include "core/paint/PaintLayer.h"
#include "core/paint/ReplacedPainter.h"
-#include "core/svg/SVGSVGElement.h"
#include "platform/LengthFunctions.h"
namespace blink {
@@ -543,28 +542,6 @@ void LayoutReplaced::computeIntrinsicSizingInfo(IntrinsicSizingInfo& intrinsicSi
intrinsicSizingInfo.aspectRatio = intrinsicSizingInfo.size.width() / intrinsicSizingInfo.size.height();
}
-static bool hasIntrinsicWidthForLayoutBox(LayoutBox* layoutObject)
-{
- if (layoutObject && layoutObject->isSVGRoot()) {
- SVGSVGElement* svg = toSVGSVGElement(layoutObject->node());
- ASSERT(svg);
- return svg->hasIntrinsicWidth();
- }
-
- return false;
-}
-
-static bool hasIntrinsicHeightForLayoutBox(LayoutBox* layoutObject)
-{
- if (layoutObject && layoutObject->isSVGRoot()) {
- SVGSVGElement* svg = toSVGSVGElement(layoutObject->node());
- ASSERT(svg);
- return svg->hasIntrinsicHeight();
- }
-
- return false;
-}
-
LayoutUnit LayoutReplaced::computeReplacedLogicalWidth(ShouldComputePreferred shouldComputePreferred) const
{
if (style()->logicalWidth().isSpecified() || style()->logicalWidth().isIntrinsic())
@@ -579,15 +556,13 @@ LayoutUnit LayoutReplaced::computeReplacedLogicalWidth(ShouldComputePreferred sh
if (style()->logicalWidth().isAuto()) {
bool computedHeightIsAuto = hasAutoHeightOrContainingBlockWithAutoHeight();
- // TODO(shanmuga.m@samsung.com): hasIntrinsicWidth/Height information should be obtained
- // from LayoutBox::computeIntrinsicSizingInfo().
- bool hasIntrinsicWidth = constrainedSize.width() > 0 || hasIntrinsicWidthForLayoutBox(contentLayoutObject);
+ bool hasIntrinsicWidth = !intrinsicSizingInfo.emptyWidth;
fs 2016/02/09 18:37:54 Maybe consider adding accessors on IntrinsicSizing
davve 2016/02/11 08:52:37 Turned it around to avoid "empty" prefix. Hopefull
// 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(LayoutUnit(constrainedSize.width()), shouldComputePreferred);
- bool hasIntrinsicHeight = constrainedSize.height() > 0 || hasIntrinsicHeightForLayoutBox(contentLayoutObject);
+ bool hasIntrinsicHeight = !intrinsicSizingInfo.emptyHeight;
if (intrinsicSizingInfo.aspectRatio) {
// If 'height' and 'width' both have computed values of 'auto' and the element has no intrinsic width, but does have an intrinsic height and intrinsic ratio;
@@ -644,9 +619,7 @@ LayoutUnit LayoutReplaced::computeReplacedLogicalHeight() const
FloatSize constrainedSize = constrainIntrinsicSizeToMinMax(intrinsicSizingInfo);
bool widthIsAuto = style()->logicalWidth().isAuto();
- // TODO(shanmuga.m@samsung.com): hasIntrinsicWidth/Height information should be obtained
- // from LayoutBox::computeIntrinsicSizingInfo().
- bool hasIntrinsicHeight = constrainedSize.height() > 0 || hasIntrinsicHeightForLayoutBox(contentLayoutObject);
+ bool hasIntrinsicHeight = !intrinsicSizingInfo.emptyHeight;
// 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)

Powered by Google App Engine
This is Rietveld 408576698