OLD | NEW |
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. | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. |
4 * All rights reserved. | 4 * All rights reserved. |
5 * | 5 * |
6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
10 * | 10 * |
11 * This library is distributed in the hope that it will be useful, | 11 * This library is distributed in the hope that it will be useful, |
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
14 * Library General Public License for more details. | 14 * Library General Public License for more details. |
15 * | 15 * |
16 * You should have received a copy of the GNU Library General Public License | 16 * You should have received a copy of the GNU Library General Public License |
17 * along with this library; see the file COPYING.LIB. If not, write to | 17 * along with this library; see the file COPYING.LIB. If not, write to |
18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
19 * Boston, MA 02110-1301, USA. | 19 * Boston, MA 02110-1301, USA. |
20 */ | 20 */ |
21 | 21 |
22 #include "core/layout/LayoutView.h" | 22 #include "core/layout/LayoutView.h" |
23 | 23 |
24 #include <inttypes.h> | |
25 #include "core/dom/Document.h" | 24 #include "core/dom/Document.h" |
26 #include "core/dom/Element.h" | 25 #include "core/dom/Element.h" |
27 #include "core/editing/FrameSelection.h" | 26 #include "core/editing/FrameSelection.h" |
28 #include "core/frame/FrameView.h" | 27 #include "core/frame/FrameView.h" |
29 #include "core/frame/LocalFrame.h" | 28 #include "core/frame/LocalFrame.h" |
30 #include "core/frame/Settings.h" | 29 #include "core/frame/Settings.h" |
31 #include "core/html/HTMLIFrameElement.h" | 30 #include "core/html/HTMLIFrameElement.h" |
32 #include "core/layout/HitTestResult.h" | 31 #include "core/layout/HitTestResult.h" |
33 #include "core/layout/LayoutGeometryMap.h" | 32 #include "core/layout/LayoutGeometryMap.h" |
34 #include "core/layout/LayoutPart.h" | 33 #include "core/layout/LayoutPart.h" |
35 #include "core/layout/ViewFragmentationContext.h" | 34 #include "core/layout/ViewFragmentationContext.h" |
36 #include "core/layout/api/LayoutAPIShim.h" | 35 #include "core/layout/api/LayoutAPIShim.h" |
37 #include "core/layout/api/LayoutPartItem.h" | 36 #include "core/layout/api/LayoutPartItem.h" |
38 #include "core/layout/api/LayoutViewItem.h" | 37 #include "core/layout/api/LayoutViewItem.h" |
39 #include "core/layout/compositing/PaintLayerCompositor.h" | 38 #include "core/layout/compositing/PaintLayerCompositor.h" |
40 #include "core/page/Page.h" | 39 #include "core/page/Page.h" |
41 #include "core/paint/PaintLayer.h" | 40 #include "core/paint/PaintLayer.h" |
42 #include "core/paint/ViewPainter.h" | 41 #include "core/paint/ViewPainter.h" |
43 #include "core/svg/SVGDocumentExtensions.h" | 42 #include "core/svg/SVGDocumentExtensions.h" |
44 #include "platform/Histogram.h" | 43 #include "platform/Histogram.h" |
45 #include "platform/RuntimeEnabledFeatures.h" | |
46 #include "platform/geometry/FloatQuad.h" | 44 #include "platform/geometry/FloatQuad.h" |
47 #include "platform/geometry/TransformState.h" | 45 #include "platform/geometry/TransformState.h" |
48 #include "platform/graphics/paint/PaintController.h" | 46 #include "platform/graphics/paint/PaintController.h" |
49 #include "platform/instrumentation/tracing/TraceEvent.h" | 47 #include "platform/instrumentation/tracing/TraceEvent.h" |
50 #include "platform/instrumentation/tracing/TracedValue.h" | 48 #include "platform/instrumentation/tracing/TracedValue.h" |
51 #include "public/platform/Platform.h" | 49 #include "public/platform/Platform.h" |
52 #include "wtf/PtrUtil.h" | 50 #include "wtf/PtrUtil.h" |
| 51 #include <inttypes.h> |
53 | 52 |
54 namespace blink { | 53 namespace blink { |
55 | 54 |
56 namespace { | 55 namespace { |
57 | 56 |
58 class HitTestLatencyRecorder { | 57 class HitTestLatencyRecorder { |
59 public: | 58 public: |
60 HitTestLatencyRecorder(bool allowsChildFrameContent) | 59 HitTestLatencyRecorder(bool allowsChildFrameContent) |
61 : m_start(WTF::monotonicallyIncreasingTime()), | 60 : m_start(WTF::monotonicallyIncreasingTime()), |
62 m_allowsChildFrameContent(allowsChildFrameContent) {} | 61 m_allowsChildFrameContent(allowsChildFrameContent) {} |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 | 180 |
182 void LayoutView::updateLogicalWidth() { | 181 void LayoutView::updateLogicalWidth() { |
183 setLogicalWidth(LayoutUnit(viewLogicalWidthForBoxSizing())); | 182 setLogicalWidth(LayoutUnit(viewLogicalWidthForBoxSizing())); |
184 } | 183 } |
185 | 184 |
186 bool LayoutView::isChildAllowed(LayoutObject* child, | 185 bool LayoutView::isChildAllowed(LayoutObject* child, |
187 const ComputedStyle&) const { | 186 const ComputedStyle&) const { |
188 return child->isBox(); | 187 return child->isBox(); |
189 } | 188 } |
190 | 189 |
191 bool LayoutView::canHaveChildren() const { | |
192 FrameOwner* owner = frame()->owner(); | |
193 if (!owner) | |
194 return true; | |
195 if (!RuntimeEnabledFeatures::displayNoneIFrameCreatesNoLayoutObjectEnabled()) | |
196 return true; | |
197 return !owner->isDisplayNone(); | |
198 } | |
199 | |
200 void LayoutView::layoutContent() { | 190 void LayoutView::layoutContent() { |
201 ASSERT(needsLayout()); | 191 ASSERT(needsLayout()); |
202 | 192 |
203 LayoutBlockFlow::layout(); | 193 LayoutBlockFlow::layout(); |
204 | 194 |
205 #if DCHECK_IS_ON() | 195 #if DCHECK_IS_ON() |
206 checkLayoutState(); | 196 checkLayoutState(); |
207 #endif | 197 #endif |
208 } | 198 } |
209 | 199 |
(...skipping 849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1059 bool LayoutView::paintedOutputOfObjectHasNoEffectRegardlessOfSize() const { | 1049 bool LayoutView::paintedOutputOfObjectHasNoEffectRegardlessOfSize() const { |
1060 // Frame scroll corner is painted using LayoutView as the display item client. | 1050 // Frame scroll corner is painted using LayoutView as the display item client. |
1061 if (!RuntimeEnabledFeatures::rootLayerScrollingEnabled() && | 1051 if (!RuntimeEnabledFeatures::rootLayerScrollingEnabled() && |
1062 (frameView()->horizontalScrollbar() || frameView()->verticalScrollbar())) | 1052 (frameView()->horizontalScrollbar() || frameView()->verticalScrollbar())) |
1063 return false; | 1053 return false; |
1064 | 1054 |
1065 return LayoutBlockFlow::paintedOutputOfObjectHasNoEffectRegardlessOfSize(); | 1055 return LayoutBlockFlow::paintedOutputOfObjectHasNoEffectRegardlessOfSize(); |
1066 } | 1056 } |
1067 | 1057 |
1068 } // namespace blink | 1058 } // namespace blink |
OLD | NEW |