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

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

Issue 1128093002: Return vertical writing mode aware intrinsic information for SVG (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase 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 bfb309e05a4eff8d5f0fe2dbe715ff016f5f8745..af3cd61721a2fe3bb6672dbed8ef9dc3b353c79c 100644
--- a/Source/core/layout/svg/LayoutSVGRoot.cpp
+++ b/Source/core/layout/svg/LayoutSVGRoot.cpp
@@ -74,6 +74,9 @@ void LayoutSVGRoot::computeIntrinsicRatioInformation(FloatSize& intrinsicSize, d
intrinsicSize.setWidth(floatValueForLength(svg->intrinsicWidth(), 0));
intrinsicSize.setHeight(floatValueForLength(svg->intrinsicHeight(), 0));
+ if (!isHorizontalWritingMode())
+ intrinsicSize = intrinsicSize.transposedSize();
+
if (!intrinsicSize.isEmpty()) {
intrinsicRatio = intrinsicSize.width() / static_cast<double>(intrinsicSize.height());
} else {
@@ -85,6 +88,8 @@ void LayoutSVGRoot::computeIntrinsicRatioInformation(FloatSize& intrinsicSize, d
if (!viewBoxSize.isEmpty()) {
// The viewBox can only yield an intrinsic ratio, not an intrinsic size.
intrinsicRatio = viewBoxSize.width() / static_cast<double>(viewBoxSize.height());
+ if (!isHorizontalWritingMode())
+ intrinsicRatio = 1 / intrinsicRatio;
}
}
}
« 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