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

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

Issue 2835153002: Fix percent height calc for svg docs. (Closed)
Patch Set: Split percent height test into percent-height.svg Created 3 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
Index: third_party/WebKit/Source/core/layout/svg/LayoutSVGRoot.cpp
diff --git a/third_party/WebKit/Source/core/layout/svg/LayoutSVGRoot.cpp b/third_party/WebKit/Source/core/layout/svg/LayoutSVGRoot.cpp
index 243c005923e330871677136d17fa7ee572c2b617..05d0c153eeb67d51005b22857d1c39d64473ab8c 100644
--- a/third_party/WebKit/Source/core/layout/svg/LayoutSVGRoot.cpp
+++ b/third_party/WebKit/Source/core/layout/svg/LayoutSVGRoot.cpp
@@ -26,6 +26,7 @@
#include "core/frame/LocalFrame.h"
#include "core/layout/HitTestResult.h"
#include "core/layout/LayoutAnalyzer.h"
+#include "core/layout/LayoutView.h"
#include "core/layout/api/LayoutPartItem.h"
#include "core/layout/svg/LayoutSVGText.h"
#include "core/layout/svg/SVGLayoutSupport.h"
@@ -134,6 +135,13 @@ LayoutUnit LayoutSVGRoot::ComputeReplacedLogicalHeight(
return ContainingBlock()->AvailableLogicalHeight(
kIncludeMarginBorderPadding);
+ const Length& logical_height = Style()->LogicalHeight();
+ if (IsDocumentElement() && logical_height.IsPercentOrCalc()) {
+ return ValueForLength(
+ logical_height,
+ GetDocument().GetLayoutView()->ViewLogicalHeightForPercentages());
+ }
+
return LayoutReplaced::ComputeReplacedLogicalHeight(estimated_used_width);
}

Powered by Google App Engine
This is Rietveld 408576698