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

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: rebased.. Created 7 years 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: Source/core/rendering/RenderView.cpp
diff --git a/Source/core/rendering/RenderView.cpp b/Source/core/rendering/RenderView.cpp
index 4013220cc35a91993daa39a7f72f3cd4a0db553c..42832f5b88781897be4d2458a6fb7fb5389894a9 100644
--- a/Source/core/rendering/RenderView.cpp
+++ b/Source/core/rendering/RenderView.cpp
@@ -321,10 +321,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);
}
@@ -1214,26 +1211,24 @@ bool RenderView::backgroundIsKnownToBeOpaqueInRect(const LayoutRect&) const
return m_frameView->hasOpaqueBackground();
}
-LayoutUnit RenderView::viewportPercentageWidth(float percentage) const
+double RenderView::viewportWidthPercent() const
{
- return viewLogicalWidth(ScrollableArea::IncludeScrollbars) * percentage / 100.f;
+ return viewLogicalWidth(ScrollableArea::IncludeScrollbars) / 100.f;
}
-LayoutUnit RenderView::viewportPercentageHeight(float percentage) const
+double RenderView::viewportHeightPercent() const
{
- return viewLogicalHeight(ScrollableArea::IncludeScrollbars) * percentage / 100.f;
+ return viewLogicalHeight(ScrollableArea::IncludeScrollbars) / 100.f;
}
-LayoutUnit RenderView::viewportPercentageMin(float percentage) const
+double RenderView::viewportMinPercent() const
{
- return std::min(viewLogicalWidth(ScrollableArea::IncludeScrollbars), viewLogicalHeight(ScrollableArea::IncludeScrollbars))
- * percentage / 100.f;
+ return std::min(viewLogicalWidth(ScrollableArea::IncludeScrollbars), viewLogicalHeight(ScrollableArea::IncludeScrollbars)) / 100.f;
}
-LayoutUnit RenderView::viewportPercentageMax(float percentage) const
+double RenderView::viewportMaxPercent() const
{
- return std::max(viewLogicalWidth(ScrollableArea::IncludeScrollbars), viewLogicalHeight(ScrollableArea::IncludeScrollbars))
- * percentage / 100.f;
+ return std::max(viewLogicalWidth(ScrollableArea::IncludeScrollbars), viewLogicalHeight(ScrollableArea::IncludeScrollbars)) / 100.f;
}
FragmentationDisabler::FragmentationDisabler(RenderObject* root)

Powered by Google App Engine
This is Rietveld 408576698