Chromium Code Reviews| 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 973 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 984 // do a full tree walk. | 984 // do a full tree walk. |
| 985 if (RenderObject* container = rootForThisLayout->container()) | 985 if (RenderObject* container = rootForThisLayout->container()) |
| 986 container->setMayNeedPaintInvalidation(true); | 986 container->setMayNeedPaintInvalidation(true); |
| 987 } // Reset m_layoutSchedulingEnabled to its previous value. | 987 } // Reset m_layoutSchedulingEnabled to its previous value. |
| 988 | 988 |
| 989 if (!inSubtreeLayout && !toRenderView(rootForThisLayout)->document().printin g()) | 989 if (!inSubtreeLayout && !toRenderView(rootForThisLayout)->document().printin g()) |
| 990 adjustViewSize(); | 990 adjustViewSize(); |
| 991 | 991 |
| 992 layer->updateLayerPositionsAfterLayout(); | 992 layer->updateLayerPositionsAfterLayout(); |
| 993 | 993 |
| 994 if (m_doFullPaintInvalidation) | |
| 995 renderView()->compositor()->fullyInvalidatePaint(); | |
| 996 renderView()->compositor()->didLayout(); | 994 renderView()->compositor()->didLayout(); |
| 997 | 995 |
| 998 m_layoutCount++; | 996 m_layoutCount++; |
| 999 | 997 |
| 1000 if (AXObjectCache* cache = rootForThisLayout->document().axObjectCache()) { | 998 if (AXObjectCache* cache = rootForThisLayout->document().axObjectCache()) { |
| 1001 const KURL& url = rootForThisLayout->document().url(); | 999 const KURL& url = rootForThisLayout->document().url(); |
| 1002 if (url.isValid() && !url.isAboutBlankURL()) | 1000 if (url.isValid() && !url.isAboutBlankURL()) |
| 1003 cache->handleLayoutComplete(rootForThisLayout); | 1001 cache->handleLayoutComplete(rootForThisLayout); |
| 1004 } | 1002 } |
| 1005 updateAnnotatedRegions(); | 1003 updateAnnotatedRegions(); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1041 void FrameView::invalidateTreeIfNeeded() | 1039 void FrameView::invalidateTreeIfNeeded() |
| 1042 { | 1040 { |
| 1043 ASSERT(renderView()); | 1041 ASSERT(renderView()); |
| 1044 RenderView& rootForPaintInvalidation = *renderView(); | 1042 RenderView& rootForPaintInvalidation = *renderView(); |
| 1045 ASSERT(!rootForPaintInvalidation.needsLayout()); | 1043 ASSERT(!rootForPaintInvalidation.needsLayout()); |
| 1046 | 1044 |
| 1047 TRACE_EVENT1("blink", "FrameView::invalidateTree", "root", rootForPaintInval idation.debugName().ascii()); | 1045 TRACE_EVENT1("blink", "FrameView::invalidateTree", "root", rootForPaintInval idation.debugName().ascii()); |
| 1048 | 1046 |
| 1049 PaintInvalidationState rootPaintInvalidationState(rootForPaintInvalidation); | 1047 PaintInvalidationState rootPaintInvalidationState(rootForPaintInvalidation); |
| 1050 | 1048 |
| 1049 if (m_doFullPaintInvalidation) | |
| 1050 renderView()->compositor()->fullyInvalidatePaint(); | |
| 1051 | |
| 1051 rootForPaintInvalidation.invalidateTreeIfNeeded(rootPaintInvalidationState); | 1052 rootForPaintInvalidation.invalidateTreeIfNeeded(rootPaintInvalidationState); |
| 1052 | 1053 |
| 1053 // Invalidate the paint of the frameviews scrollbars if needed | 1054 // Invalidate the paint of the frameviews scrollbars if needed |
| 1054 if (hasVerticalBarDamage()) | 1055 if (hasVerticalBarDamage()) |
| 1055 invalidateRect(verticalBarDamage()); | 1056 invalidateRect(verticalBarDamage()); |
| 1056 if (hasHorizontalBarDamage()) | 1057 if (hasHorizontalBarDamage()) |
| 1057 invalidateRect(horizontalBarDamage()); | 1058 invalidateRect(horizontalBarDamage()); |
| 1058 resetScrollbarDamage(); | 1059 resetScrollbarDamage(); |
| 1059 | 1060 |
| 1060 m_doFullPaintInvalidation = false; | 1061 m_doFullPaintInvalidation = false; |
| 1062 | |
| 1061 #ifndef NDEBUG | 1063 #ifndef NDEBUG |
| 1062 renderView()->assertSubtreeClearedPaintInvalidationState(); | 1064 renderView()->assertSubtreeClearedPaintInvalidationState(); |
| 1063 #endif | 1065 #endif |
| 1064 | 1066 |
| 1065 if (m_frame->selection().isCaretBoundsDirty()) | 1067 if (m_frame->selection().isCaretBoundsDirty()) |
| 1066 m_frame->selection().invalidateCaretRect(); | 1068 m_frame->selection().invalidateCaretRect(); |
| 1067 } | 1069 } |
| 1068 | 1070 |
| 1069 DocumentLifecycle& FrameView::lifecycle() const | 1071 DocumentLifecycle& FrameView::lifecycle() const |
| 1070 { | 1072 { |
| (...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1707 if (!frame().view()) | 1709 if (!frame().view()) |
| 1708 return; | 1710 return; |
| 1709 | 1711 |
| 1710 // Note that simply having overlay scrollbars is not sufficient to be | 1712 // Note that simply having overlay scrollbars is not sufficient to be |
| 1711 // certain that scrollbars' presence does not impact layout. This should | 1713 // certain that scrollbars' presence does not impact layout. This should |
| 1712 // also check if custom scrollbars (as reported by shouldUseCustomScrollbars ) | 1714 // also check if custom scrollbars (as reported by shouldUseCustomScrollbars ) |
| 1713 // are in use as well. | 1715 // are in use as well. |
| 1714 // http://crbug.com/269692 | 1716 // http://crbug.com/269692 |
| 1715 bool useOverlayScrollbars = ScrollbarTheme::theme()->usesOverlayScrollbars() ; | 1717 bool useOverlayScrollbars = ScrollbarTheme::theme()->usesOverlayScrollbars() ; |
| 1716 | 1718 |
| 1719 // FIXME: this call to layout() could be called within FrameView::layout(), but before performLayout(), | |
| 1720 // causing double-layout. | |
|
dsinclair
2014/10/31 00:14:34
Can you file a bug to track this?
chrishtr
2014/10/31 18:22:24
Done.
| |
| 1717 if (!useOverlayScrollbars && needsLayout()) | 1721 if (!useOverlayScrollbars && needsLayout()) |
| 1718 layout(); | 1722 layout(); |
| 1723 } | |
|
dsinclair
2014/10/31 00:14:34
Don't think this should be here.
chrishtr
2014/10/31 18:22:24
Done.
| |
| 1719 | 1724 |
| 1720 if (renderView() && renderView()->usesCompositing()) { | 1725 if (renderView() && renderView()->usesCompositing()) { |
| 1721 renderView()->compositor()->frameViewScrollbarsExistenceDidChange(); | 1726 renderView()->compositor()->frameViewScrollbarsExistenceDidChange(); |
| 1722 | 1727 |
| 1723 if (!useOverlayScrollbars) | 1728 if (!useOverlayScrollbars) |
| 1724 renderView()->compositor()->frameViewDidChangeSize(); | 1729 renderView()->compositor()->frameViewDidChangeSize(); |
| 1725 } | 1730 } |
| 1726 } | 1731 } |
| 1727 | 1732 |
| 1728 void FrameView::handleLoadCompleted() | 1733 void FrameView::handleLoadCompleted() |
| (...skipping 2189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3918 return; | 3923 return; |
| 3919 | 3924 |
| 3920 ScrollableArea::setScrollOrigin(origin); | 3925 ScrollableArea::setScrollOrigin(origin); |
| 3921 | 3926 |
| 3922 // Update if the scroll origin changes, since our position will be different if the content size did not change. | 3927 // Update if the scroll origin changes, since our position will be different if the content size did not change. |
| 3923 if (updatePositionAtAll && updatePositionSynchronously) | 3928 if (updatePositionAtAll && updatePositionSynchronously) |
| 3924 updateScrollbars(scrollOffsetDouble()); | 3929 updateScrollbars(scrollOffsetDouble()); |
| 3925 } | 3930 } |
| 3926 | 3931 |
| 3927 } // namespace blink | 3932 } // namespace blink |
| OLD | NEW |