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

Side by Side Diff: Source/core/rendering/RenderView.cpp

Issue 15927026: Enabled using viewport on desktop browsers behind experimental flag (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: WIP Created 7 years, 5 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 10 matching lines...) Expand all
21 #include "config.h" 21 #include "config.h"
22 #include "core/rendering/RenderView.h" 22 #include "core/rendering/RenderView.h"
23 23
24 #include "core/dom/Document.h" 24 #include "core/dom/Document.h"
25 #include "core/dom/Element.h" 25 #include "core/dom/Element.h"
26 #include "core/html/HTMLFrameOwnerElement.h" 26 #include "core/html/HTMLFrameOwnerElement.h"
27 #include "core/html/HTMLIFrameElement.h" 27 #include "core/html/HTMLIFrameElement.h"
28 #include "core/page/Frame.h" 28 #include "core/page/Frame.h"
29 #include "core/page/FrameView.h" 29 #include "core/page/FrameView.h"
30 #include "core/page/Page.h" 30 #include "core/page/Page.h"
31 #include "core/page/Settings.h"
31 #include "core/platform/graphics/filters/custom/CustomFilterGlobalContext.h" 32 #include "core/platform/graphics/filters/custom/CustomFilterGlobalContext.h"
32 #include "core/platform/graphics/FloatQuad.h" 33 #include "core/platform/graphics/FloatQuad.h"
33 #include "core/platform/graphics/GraphicsContext.h" 34 #include "core/platform/graphics/GraphicsContext.h"
34 #include "core/platform/graphics/transforms/TransformState.h" 35 #include "core/platform/graphics/transforms/TransformState.h"
35 #include "core/rendering/ColumnInfo.h" 36 #include "core/rendering/ColumnInfo.h"
36 #include "core/rendering/FlowThreadController.h" 37 #include "core/rendering/FlowThreadController.h"
37 #include "core/rendering/HitTestResult.h" 38 #include "core/rendering/HitTestResult.h"
38 #include "core/rendering/RenderGeometryMap.h" 39 #include "core/rendering/RenderGeometryMap.h"
39 #include "core/rendering/RenderLayer.h" 40 #include "core/rendering/RenderLayer.h"
40 #include "core/rendering/RenderLayerBacking.h" 41 #include "core/rendering/RenderLayerBacking.h"
(...skipping 902 matching lines...) Expand 10 before | Expand all | Expand 10 after
943 bool RenderView::rootBackgroundIsEntirelyFixed() const 944 bool RenderView::rootBackgroundIsEntirelyFixed() const
944 { 945 {
945 RenderObject* rootObject = document()->documentElement() ? document()->docum entElement()->renderer() : 0; 946 RenderObject* rootObject = document()->documentElement() ? document()->docum entElement()->renderer() : 0;
946 if (!rootObject) 947 if (!rootObject)
947 return false; 948 return false;
948 949
949 RenderObject* rootRenderer = rootObject->rendererForRootBackground(); 950 RenderObject* rootRenderer = rootObject->rendererForRootBackground();
950 return rootRenderer->hasEntirelyFixedBackground(); 951 return rootRenderer->hasEntirelyFixedBackground();
951 } 952 }
952 953
954 bool RenderView::useDesktopStyleLayout() const
955 {
956 Page* page = document()->page();
957
958 if (!page)
959 return false;
960
961 return !page->settings()->layoutFallbackWidth();
962 }
963
953 LayoutRect RenderView::backgroundRect(RenderBox* backgroundRenderer) const 964 LayoutRect RenderView::backgroundRect(RenderBox* backgroundRenderer) const
954 { 965 {
955 if (!hasColumns()) 966 if (!hasColumns())
956 return unscaledDocumentRect(); 967 return unscaledDocumentRect();
957 968
958 ColumnInfo* columnInfo = this->columnInfo(); 969 ColumnInfo* columnInfo = this->columnInfo();
959 LayoutRect backgroundRect(0, 0, columnInfo->desiredColumnWidth(), columnInfo ->columnHeight() * columnInfo->columnCount()); 970 LayoutRect backgroundRect(0, 0, columnInfo->desiredColumnWidth(), columnInfo ->columnHeight() * columnInfo->columnCount());
960 if (!isHorizontalWritingMode()) 971 if (!isHorizontalWritingMode())
961 backgroundRect = backgroundRect.transposedRect(); 972 backgroundRect = backgroundRect.transposedRect();
962 backgroundRenderer->flipForWritingMode(backgroundRect); 973 backgroundRenderer->flipForWritingMode(backgroundRect);
963 974
964 return backgroundRect; 975 return backgroundRect;
965 } 976 }
966 977
967 IntRect RenderView::documentRect() const 978 IntRect RenderView::documentRect() const
968 { 979 {
969 FloatRect overflowRect(unscaledDocumentRect()); 980 FloatRect overflowRect(unscaledDocumentRect());
970 if (hasTransform()) 981 if (hasTransform())
971 overflowRect = layer()->currentTransform().mapRect(overflowRect); 982 overflowRect = layer()->currentTransform().mapRect(overflowRect);
972 return IntRect(overflowRect); 983 return IntRect(overflowRect);
973 } 984 }
974 985
975 int RenderView::viewHeight() const 986 int RenderView::viewHeight() const
976 { 987 {
977 int height = 0; 988 int height = 0;
978 if (!shouldUsePrintingLayout() && m_frameView) { 989 if (!shouldUsePrintingLayout() && m_frameView) {
979 height = m_frameView->layoutHeight(); 990 height = m_frameView->layoutHeight();
980 height = m_frameView->useFixedLayout() ? ceilf(style()->effectiveZoom() * float(height)) : height; 991 height = !useDesktopStyleLayout() ? ceilf(style()->effectiveZoom() * flo at(height)) : height;
aelias_OOO_until_Jul13 2013/07/31 22:31:21 This is a legacy of one of the other WebKit ports,
981 } 992 }
993
982 return height; 994 return height;
983 } 995 }
984 996
985 int RenderView::viewWidth() const 997 int RenderView::viewWidth() const
986 { 998 {
987 int width = 0; 999 int width = 0;
988 if (!shouldUsePrintingLayout() && m_frameView) { 1000 if (!shouldUsePrintingLayout() && m_frameView) {
989 width = m_frameView->layoutWidth(); 1001 width = m_frameView->layoutWidth();
990 width = m_frameView->useFixedLayout() ? ceilf(style()->effectiveZoom() * float(width)) : width; 1002 width = !useDesktopStyleLayout() ? ceilf(style()->effectiveZoom() * floa t(width)) : width;
991 } 1003 }
1004
992 return width; 1005 return width;
993 } 1006 }
994 1007
995 int RenderView::viewLogicalHeight() const 1008 int RenderView::viewLogicalHeight() const
996 { 1009 {
997 int height = style()->isHorizontalWritingMode() ? viewHeight() : viewWidth() ; 1010 int height = style()->isHorizontalWritingMode() ? viewHeight() : viewWidth() ;
998 1011
999 if (hasColumns() && !style()->hasInlineColumnAxis()) { 1012 if (hasColumns() && !style()->hasInlineColumnAxis()) {
1000 if (int pageLength = m_frameView->pagination().pageLength) 1013 if (int pageLength = m_frameView->pagination().pageLength)
1001 height = pageLength; 1014 height = pageLength;
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
1148 #endif 1161 #endif
1149 1162
1150 if (layoutState) 1163 if (layoutState)
1151 layoutState->m_isPaginated = m_fragmenting; 1164 layoutState->m_isPaginated = m_fragmenting;
1152 1165
1153 if (m_flowThreadState != RenderObject::NotInsideFlowThread) 1166 if (m_flowThreadState != RenderObject::NotInsideFlowThread)
1154 m_root->setFlowThreadStateIncludingDescendants(m_flowThreadState); 1167 m_root->setFlowThreadStateIncludingDescendants(m_flowThreadState);
1155 } 1168 }
1156 1169
1157 } // namespace WebCore 1170 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698