OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> | 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> |
3 * 1999 Lars Knoll <knoll@kde.org> | 3 * 1999 Lars Knoll <knoll@kde.org> |
4 * 1999 Antti Koivisto <koivisto@kde.org> | 4 * 1999 Antti Koivisto <koivisto@kde.org> |
5 * 2000 Dirk Mueller <mueller@kde.org> | 5 * 2000 Dirk Mueller <mueller@kde.org> |
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) | 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) |
8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) | 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) |
9 * Copyright (C) 2009 Google Inc. All rights reserved. | 9 * Copyright (C) 2009 Google Inc. All rights reserved. |
10 * | 10 * |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 visitor->trace(m_children); | 205 visitor->trace(m_children); |
206 visitor->trace(m_viewportScrollableArea); | 206 visitor->trace(m_viewportScrollableArea); |
207 visitor->trace(m_scrollAnchor); | 207 visitor->trace(m_scrollAnchor); |
208 Widget::trace(visitor); | 208 Widget::trace(visitor); |
209 ScrollableArea::trace(visitor); | 209 ScrollableArea::trace(visitor); |
210 } | 210 } |
211 | 211 |
212 void FrameView::reset() | 212 void FrameView::reset() |
213 { | 213 { |
214 m_hasPendingLayout = false; | 214 m_hasPendingLayout = false; |
215 m_doFullPaintInvalidation = false; | |
216 m_layoutSchedulingEnabled = true; | 215 m_layoutSchedulingEnabled = true; |
217 m_inSynchronousPostLayout = false; | 216 m_inSynchronousPostLayout = false; |
218 m_layoutCount = 0; | 217 m_layoutCount = 0; |
219 m_nestedLayoutCount = 0; | 218 m_nestedLayoutCount = 0; |
220 m_postLayoutTasksTimer.stop(); | 219 m_postLayoutTasksTimer.stop(); |
221 m_updateWidgetsTimer.stop(); | 220 m_updateWidgetsTimer.stop(); |
222 m_firstLayout = true; | 221 m_firstLayout = true; |
223 m_safeToPropagateScrollToParent = true; | 222 m_safeToPropagateScrollToParent = true; |
224 m_lastViewportSize = IntSize(); | 223 m_lastViewportSize = IntSize(); |
225 m_lastZoomFactor = 1.0f; | 224 m_lastZoomFactor = 1.0f; |
(...skipping 775 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1001 ScrollbarMode vMode; | 1000 ScrollbarMode vMode; |
1002 calculateScrollbarModes(hMode, vMode); | 1001 calculateScrollbarModes(hMode, vMode); |
1003 | 1002 |
1004 // Now set our scrollbar state for the layout. | 1003 // Now set our scrollbar state for the layout. |
1005 ScrollbarMode currentHMode = horizontalScrollbarMode(); | 1004 ScrollbarMode currentHMode = horizontalScrollbarMode(); |
1006 ScrollbarMode currentVMode = verticalScrollbarMode(); | 1005 ScrollbarMode currentVMode = verticalScrollbarMode(); |
1007 | 1006 |
1008 if (m_firstLayout) { | 1007 if (m_firstLayout) { |
1009 setScrollbarsSuppressed(true); | 1008 setScrollbarsSuppressed(true); |
1010 | 1009 |
1011 m_doFullPaintInvalidation = true; | |
1012 m_firstLayout = false; | 1010 m_firstLayout = false; |
1013 m_lastViewportSize = layoutSize(IncludeScrollbars); | 1011 m_lastViewportSize = layoutSize(IncludeScrollbars); |
1014 m_lastZoomFactor = layoutViewItem().style()->zoom(); | 1012 m_lastZoomFactor = layoutViewItem().style()->zoom(); |
1015 | 1013 |
1016 // Set the initial vMode to AlwaysOn if we're auto. | 1014 // Set the initial vMode to AlwaysOn if we're auto. |
1017 if (vMode == ScrollbarAuto) | 1015 if (vMode == ScrollbarAuto) |
1018 setVerticalScrollbarMode(ScrollbarAlwaysOn); // This causes
a vertical scrollbar to appear. | 1016 setVerticalScrollbarMode(ScrollbarAlwaysOn); // This causes
a vertical scrollbar to appear. |
1019 // Set the initial hMode to AlwaysOff if we're auto. | 1017 // Set the initial hMode to AlwaysOff if we're auto. |
1020 if (hMode == ScrollbarAuto) | 1018 if (hMode == ScrollbarAuto) |
1021 setHorizontalScrollbarMode(ScrollbarAlwaysOff); // This caus
es a horizontal scrollbar to disappear. | 1019 setHorizontalScrollbarMode(ScrollbarAlwaysOff); // This caus
es a horizontal scrollbar to disappear. |
(...skipping 11 matching lines...) Expand all Loading... |
1033 m_size = LayoutSize(layoutSize()); | 1031 m_size = LayoutSize(layoutSize()); |
1034 | 1032 |
1035 if (oldSize != m_size && !m_firstLayout) { | 1033 if (oldSize != m_size && !m_firstLayout) { |
1036 LayoutBox* rootLayoutObject = document->documentElement() ? docu
ment->documentElement()->layoutBox() : 0; | 1034 LayoutBox* rootLayoutObject = document->documentElement() ? docu
ment->documentElement()->layoutBox() : 0; |
1037 LayoutBox* bodyLayoutObject = rootLayoutObject && document->body
() ? document->body()->layoutBox() : 0; | 1035 LayoutBox* bodyLayoutObject = rootLayoutObject && document->body
() ? document->body()->layoutBox() : 0; |
1038 if (bodyLayoutObject && bodyLayoutObject->stretchesToViewport()) | 1036 if (bodyLayoutObject && bodyLayoutObject->stretchesToViewport()) |
1039 bodyLayoutObject->setChildNeedsLayout(); | 1037 bodyLayoutObject->setChildNeedsLayout(); |
1040 else if (rootLayoutObject && rootLayoutObject->stretchesToViewpo
rt()) | 1038 else if (rootLayoutObject && rootLayoutObject->stretchesToViewpo
rt()) |
1041 rootLayoutObject->setChildNeedsLayout(); | 1039 rootLayoutObject->setChildNeedsLayout(); |
1042 } | 1040 } |
1043 | |
1044 // We need to set m_doFullPaintInvalidation before triggering layout
as LayoutObject::checkForPaintInvalidation | |
1045 // checks the boolean to disable local paint invalidations. | |
1046 m_doFullPaintInvalidation |= layoutViewItem().shouldDoFullPaintInval
idationForNextLayout(); | |
1047 } | 1041 } |
1048 | 1042 |
1049 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID(TRACE_DISABLED_BY_DEFAULT("blink.deb
ug.layout.trees"), "LayoutTree", | 1043 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID(TRACE_DISABLED_BY_DEFAULT("blink.deb
ug.layout.trees"), "LayoutTree", |
1050 this, TracedLayoutObject::create(*layoutView(), false)); | 1044 this, TracedLayoutObject::create(*layoutView(), false)); |
1051 | 1045 |
1052 performLayout(inSubtreeLayout); | 1046 performLayout(inSubtreeLayout); |
1053 | 1047 |
1054 if (!inSubtreeLayout && !document->printing()) | 1048 if (!inSubtreeLayout && !document->printing()) |
1055 adjustViewSizeAndLayout(); | 1049 adjustViewSizeAndLayout(); |
1056 | 1050 |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1125 | 1119 |
1126 void FrameView::invalidatePaintIfNeeded(const PaintInvalidationState& paintInval
idationState) | 1120 void FrameView::invalidatePaintIfNeeded(const PaintInvalidationState& paintInval
idationState) |
1127 { | 1121 { |
1128 RELEASE_ASSERT(!layoutViewItem().isNull()); | 1122 RELEASE_ASSERT(!layoutViewItem().isNull()); |
1129 if (!m_frame->settings() || !m_frame->settings()->rootLayerScrolls()) | 1123 if (!m_frame->settings() || !m_frame->settings()->rootLayerScrolls()) |
1130 invalidatePaintOfScrollControlsIfNeeded(paintInvalidationState); | 1124 invalidatePaintOfScrollControlsIfNeeded(paintInvalidationState); |
1131 | 1125 |
1132 if (m_frame->selection().isCaretBoundsDirty()) | 1126 if (m_frame->selection().isCaretBoundsDirty()) |
1133 m_frame->selection().invalidateCaretRect(); | 1127 m_frame->selection().invalidateCaretRect(); |
1134 | 1128 |
1135 m_doFullPaintInvalidation = false; | |
1136 | |
1137 // Temporary callback for crbug.com/487345,402044 | 1129 // Temporary callback for crbug.com/487345,402044 |
1138 // TODO(ojan): Make this more general to be used by PositionObserver | 1130 // TODO(ojan): Make this more general to be used by PositionObserver |
1139 // and rAF throttling. | 1131 // and rAF throttling. |
1140 IntRect visibleRect = rootFrameToContents(computeVisibleArea()); | 1132 IntRect visibleRect = rootFrameToContents(computeVisibleArea()); |
1141 layoutViewItem().sendMediaPositionChangeNotifications(visibleRect); | 1133 layoutViewItem().sendMediaPositionChangeNotifications(visibleRect); |
1142 } | 1134 } |
1143 | 1135 |
1144 IntRect FrameView::computeVisibleArea() | 1136 IntRect FrameView::computeVisibleArea() |
1145 { | 1137 { |
1146 // Return our clipping bounds in the root frame. | 1138 // Return our clipping bounds in the root frame. |
(...skipping 3078 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4225 return m_subtreeThrottled || (m_hiddenForThrottling && m_crossOriginForThrot
tling); | 4217 return m_subtreeThrottled || (m_hiddenForThrottling && m_crossOriginForThrot
tling); |
4226 } | 4218 } |
4227 | 4219 |
4228 LayoutBox& FrameView::boxForScrollControlPaintInvalidation() const | 4220 LayoutBox& FrameView::boxForScrollControlPaintInvalidation() const |
4229 { | 4221 { |
4230 ASSERT(!layoutViewItem().isNull()); | 4222 ASSERT(!layoutViewItem().isNull()); |
4231 return *layoutView(); | 4223 return *layoutView(); |
4232 } | 4224 } |
4233 | 4225 |
4234 } // namespace blink | 4226 } // namespace blink |
OLD | NEW |