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

Unified Diff: Source/core/rendering/RenderView.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/RenderView.h ('k') | Source/core/rendering/RootInlineBox.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderView.cpp
diff --git a/Source/core/rendering/RenderView.cpp b/Source/core/rendering/RenderView.cpp
index 05955691af573fc99f2d0102d0b46c6a62b72e2f..cc1be67964c43f88cdfddff09b90bfaf0426367c 100644
--- a/Source/core/rendering/RenderView.cpp
+++ b/Source/core/rendering/RenderView.cpp
@@ -320,10 +320,7 @@ void RenderView::layout()
if ((child->isBox() && toRenderBox(child)->hasRelativeLogicalHeight())
|| child->style()->logicalHeight().isPercent()
|| child->style()->logicalMinHeight().isPercent()
- || child->style()->logicalMaxHeight().isPercent()
- || child->style()->logicalHeight().isViewportPercentage()
- || child->style()->logicalMinHeight().isViewportPercentage()
- || child->style()->logicalMaxHeight().isViewportPercentage())
+ || child->style()->logicalMaxHeight().isPercent())
layoutScope.setChildNeedsLayout(child);
}
@@ -1213,26 +1210,16 @@ bool RenderView::backgroundIsKnownToBeOpaqueInRect(const LayoutRect&) const
return m_frameView->hasOpaqueBackground();
}
-LayoutUnit RenderView::viewportPercentageWidth(float percentage) const
+double RenderView::layoutViewportWidth() const
{
- return viewLogicalWidth(ScrollableArea::IncludeScrollbars) * percentage / 100.f;
+ float scale = m_frameView ? m_frameView->frame().pageZoomFactor() : 1;
+ return viewWidth(ScrollableArea::IncludeScrollbars) / scale;
}
-LayoutUnit RenderView::viewportPercentageHeight(float percentage) const
+double RenderView::layoutViewportHeight() const
{
- return viewLogicalHeight(ScrollableArea::IncludeScrollbars) * percentage / 100.f;
-}
-
-LayoutUnit RenderView::viewportPercentageMin(float percentage) const
-{
- return std::min(viewLogicalWidth(ScrollableArea::IncludeScrollbars), viewLogicalHeight(ScrollableArea::IncludeScrollbars))
- * percentage / 100.f;
-}
-
-LayoutUnit RenderView::viewportPercentageMax(float percentage) const
-{
- return std::max(viewLogicalWidth(ScrollableArea::IncludeScrollbars), viewLogicalHeight(ScrollableArea::IncludeScrollbars))
- * percentage / 100.f;
+ float scale = m_frameView ? m_frameView->frame().pageZoomFactor() : 1;
+ return viewHeight(ScrollableArea::IncludeScrollbars) / scale;
}
FragmentationDisabler::FragmentationDisabler(RenderObject* root)
« no previous file with comments | « Source/core/rendering/RenderView.h ('k') | Source/core/rendering/RootInlineBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698