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

Unified Diff: Source/core/rendering/svg/RenderSVGRoot.cpp

Issue 82083002: Move viewport unit resolution to style recalc time (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: rename browser zoom to page zoom Created 6 years, 12 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 | « Source/core/rendering/style/RenderStyle.cpp ('k') | Source/core/svg/SVGSVGElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/svg/RenderSVGRoot.cpp
diff --git a/Source/core/rendering/svg/RenderSVGRoot.cpp b/Source/core/rendering/svg/RenderSVGRoot.cpp
index a4355cd4d9a64fa26624811b990ef5e4b1af31da..5ef015ca7ec23ef07e790a8e1e15c1241a2276b8 100644
--- a/Source/core/rendering/svg/RenderSVGRoot.cpp
+++ b/Source/core/rendering/svg/RenderSVGRoot.cpp
@@ -38,6 +38,7 @@
#include "core/svg/SVGElement.h"
#include "core/svg/SVGSVGElement.h"
#include "core/svg/graphics/SVGImage.h"
+#include "platform/LengthFunctions.h"
#include "platform/graphics/GraphicsContext.h"
using namespace std;
@@ -79,9 +80,9 @@ void RenderSVGRoot::computeIntrinsicRatioInformation(FloatSize& intrinsicSize, d
// resolving both values to user units.
if (intrinsicWidthAttribute.isFixed() || intrinsicHeightAttribute.isFixed()) {
if (intrinsicWidthAttribute.isFixed())
- intrinsicSize.setWidth(floatValueForLength(intrinsicWidthAttribute, 0, 0));
+ intrinsicSize.setWidth(floatValueForLength(intrinsicWidthAttribute, 0));
if (intrinsicHeightAttribute.isFixed())
- intrinsicSize.setHeight(floatValueForLength(intrinsicHeightAttribute, 0, 0));
+ intrinsicSize.setHeight(floatValueForLength(intrinsicHeightAttribute, 0));
if (!intrinsicSize.isEmpty())
intrinsicRatio = intrinsicSize.width() / static_cast<double>(intrinsicSize.height());
return;
@@ -128,9 +129,9 @@ bool RenderSVGRoot::isEmbeddedThroughFrameContainingSVGDocument() const
return frame->document()->isSVGDocument();
}
-static inline LayoutUnit resolveLengthAttributeForSVG(const Length& length, float scale, float maxSize, RenderView* renderView)
+static inline LayoutUnit resolveLengthAttributeForSVG(const Length& length, float scale, float maxSize)
{
- return static_cast<LayoutUnit>(valueForLength(length, maxSize, renderView) * (length.isFixed() ? scale : 1));
+ return static_cast<LayoutUnit>(valueForLength(length, maxSize) * (length.isFixed() ? scale : 1));
}
LayoutUnit RenderSVGRoot::computeReplacedLogicalWidth(ShouldComputePreferred shouldComputePreferred) const
@@ -146,7 +147,7 @@ LayoutUnit RenderSVGRoot::computeReplacedLogicalWidth(ShouldComputePreferred sho
return RenderReplaced::computeReplacedLogicalWidth(shouldComputePreferred);
if (svg->widthAttributeEstablishesViewport())
- return resolveLengthAttributeForSVG(svg->intrinsicWidth(SVGSVGElement::IgnoreCSSProperties), style()->effectiveZoom(), containingBlock()->availableLogicalWidth(), view());
+ return resolveLengthAttributeForSVG(svg->intrinsicWidth(SVGSVGElement::IgnoreCSSProperties), style()->effectiveZoom(), containingBlock()->availableLogicalWidth());
// SVG embedded through object/embed/iframe.
if (isEmbeddedThroughFrameContainingSVGDocument())
@@ -180,7 +181,7 @@ LayoutUnit RenderSVGRoot::computeReplacedLogicalHeight() const
} else
RenderBlock::removePercentHeightDescendant(const_cast<RenderSVGRoot*>(this));
- return resolveLengthAttributeForSVG(height, style()->effectiveZoom(), containingBlock()->availableLogicalHeight(IncludeMarginBorderPadding), view());
+ return resolveLengthAttributeForSVG(height, style()->effectiveZoom(), containingBlock()->availableLogicalHeight(IncludeMarginBorderPadding));
}
// SVG embedded through object/embed/iframe.
« no previous file with comments | « Source/core/rendering/style/RenderStyle.cpp ('k') | Source/core/svg/SVGSVGElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698