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

Unified Diff: Source/core/layout/svg/LayoutSVGRoot.cpp

Issue 1128893002: Don't conflate intrinsic width and height with logical width and height (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased for landing Created 5 years, 7 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 | « LayoutTests/svg/in-html/sizing/svg-inline-vertical-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/svg/LayoutSVGRoot.cpp
diff --git a/Source/core/layout/svg/LayoutSVGRoot.cpp b/Source/core/layout/svg/LayoutSVGRoot.cpp
index af3cd61721a2fe3bb6672dbed8ef9dc3b353c79c..e2f0277b019095c13e0cd549e3b3cb3869c2ed96 100644
--- a/Source/core/layout/svg/LayoutSVGRoot.cpp
+++ b/Source/core/layout/svg/LayoutSVGRoot.cpp
@@ -115,16 +115,8 @@ bool LayoutSVGRoot::isEmbeddedThroughFrameContainingSVGDocument() const
return frame->document()->isSVGDocument();
}
-static inline LayoutUnit resolveLengthAttributeForSVG(const Length& length, float scale, float maxSize)
-{
- return static_cast<LayoutUnit>(valueForLength(length, maxSize) * (length.isFixed() ? scale : 1));
-}
-
LayoutUnit LayoutSVGRoot::computeReplacedLogicalWidth(ShouldComputePreferred shouldComputePreferred) const
{
- SVGSVGElement* svg = toSVGSVGElement(node());
- ASSERT(svg);
-
// When we're embedded through SVGImage (border-image/background-image/<html:img>/...) we're forced to resize to a specific size.
if (!m_containerSize.isEmpty())
return m_containerSize.width();
@@ -135,18 +127,12 @@ LayoutUnit LayoutSVGRoot::computeReplacedLogicalWidth(ShouldComputePreferred sho
if (style()->logicalWidth().isSpecified() || style()->logicalMaxWidth().isSpecified())
return LayoutReplaced::computeReplacedLogicalWidth(shouldComputePreferred);
- if (svg->hasIntrinsicWidth())
- return resolveLengthAttributeForSVG(svg->intrinsicWidth(), style()->effectiveZoom(), containingBlock()->availableLogicalWidth().toFloat());
-
// SVG embedded via SVGImage (background-image/border-image/etc) / Inline SVG.
return LayoutReplaced::computeReplacedLogicalWidth(shouldComputePreferred);
}
LayoutUnit LayoutSVGRoot::computeReplacedLogicalHeight() const
{
- SVGSVGElement* svg = toSVGSVGElement(node());
- ASSERT(svg);
-
// When we're embedded through SVGImage (border-image/background-image/<html:img>/...) we're forced to resize to a specific size.
if (!m_containerSize.isEmpty())
return m_containerSize.height();
@@ -157,9 +143,6 @@ LayoutUnit LayoutSVGRoot::computeReplacedLogicalHeight() const
if (style()->logicalHeight().isSpecified() || style()->logicalMaxHeight().isSpecified())
return LayoutReplaced::computeReplacedLogicalHeight();
- if (svg->hasIntrinsicHeight())
- return resolveLengthAttributeForSVG(svg->intrinsicHeight(), style()->effectiveZoom(), containingBlock()->availableLogicalHeight(IncludeMarginBorderPadding).toFloat());
-
// SVG embedded via SVGImage (background-image/border-image/etc) / Inline SVG.
return LayoutReplaced::computeReplacedLogicalHeight();
}
« no previous file with comments | « LayoutTests/svg/in-html/sizing/svg-inline-vertical-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698