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

Side by Side Diff: Source/core/frame/FrameView.cpp

Issue 683373002: Invalidate the frame view when changing the background image of the document or body. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed Created 6 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/frame/FrameView.h ('k') | Source/core/rendering/RenderBox.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
1061 #ifndef NDEBUG 1062 #ifndef NDEBUG
1062 renderView()->assertSubtreeClearedPaintInvalidationState(); 1063 renderView()->assertSubtreeClearedPaintInvalidationState();
1063 #endif 1064 #endif
1064 1065
1065 if (m_frame->selection().isCaretBoundsDirty()) 1066 if (m_frame->selection().isCaretBoundsDirty())
1066 m_frame->selection().invalidateCaretRect(); 1067 m_frame->selection().invalidateCaretRect();
1067 } 1068 }
1068 1069
1069 DocumentLifecycle& FrameView::lifecycle() const 1070 DocumentLifecycle& FrameView::lifecycle() const
1070 { 1071 {
(...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after
1707 if (!frame().view()) 1708 if (!frame().view())
1708 return; 1709 return;
1709 1710
1710 // Note that simply having overlay scrollbars is not sufficient to be 1711 // Note that simply having overlay scrollbars is not sufficient to be
1711 // certain that scrollbars' presence does not impact layout. This should 1712 // certain that scrollbars' presence does not impact layout. This should
1712 // also check if custom scrollbars (as reported by shouldUseCustomScrollbars ) 1713 // also check if custom scrollbars (as reported by shouldUseCustomScrollbars )
1713 // are in use as well. 1714 // are in use as well.
1714 // http://crbug.com/269692 1715 // http://crbug.com/269692
1715 bool useOverlayScrollbars = ScrollbarTheme::theme()->usesOverlayScrollbars() ; 1716 bool useOverlayScrollbars = ScrollbarTheme::theme()->usesOverlayScrollbars() ;
1716 1717
1718 // FIXME: this call to layout() could be called within FrameView::layout(), but before performLayout(),
1719 // causing double-layout. See also crbug.com/429242.
1717 if (!useOverlayScrollbars && needsLayout()) 1720 if (!useOverlayScrollbars && needsLayout())
1718 layout(); 1721 layout();
1719 1722
1720 if (renderView() && renderView()->usesCompositing()) { 1723 if (renderView() && renderView()->usesCompositing()) {
1721 renderView()->compositor()->frameViewScrollbarsExistenceDidChange(); 1724 renderView()->compositor()->frameViewScrollbarsExistenceDidChange();
1722 1725
1723 if (!useOverlayScrollbars) 1726 if (!useOverlayScrollbars)
1724 renderView()->compositor()->frameViewDidChangeSize(); 1727 renderView()->compositor()->frameViewDidChangeSize();
1725 } 1728 }
1726 } 1729 }
(...skipping 865 matching lines...) Expand 10 before | Expand all | Expand 10 after
2592 lifecycle().advanceTo(DocumentLifecycle::InPaintInvalidation); 2595 lifecycle().advanceTo(DocumentLifecycle::InPaintInvalidation);
2593 invalidateTreeIfNeeded(); 2596 invalidateTreeIfNeeded();
2594 lifecycle().advanceTo(DocumentLifecycle::PaintInvalidationClean); 2597 lifecycle().advanceTo(DocumentLifecycle::PaintInvalidationClean);
2595 2598
2596 for (Frame* child = m_frame->tree().firstChild(); child; child = child->tree ().nextSibling()) { 2599 for (Frame* child = m_frame->tree().firstChild(); child; child = child->tree ().nextSibling()) {
2597 if (!child->isLocalFrame()) 2600 if (!child->isLocalFrame())
2598 continue; 2601 continue;
2599 2602
2600 toLocalFrame(child)->view()->invalidateTreeIfNeededRecursive(); 2603 toLocalFrame(child)->view()->invalidateTreeIfNeededRecursive();
2601 } 2604 }
2605
2606 m_doFullPaintInvalidation = false;
2602 } 2607 }
2603 2608
2604 void FrameView::enableAutoSizeMode(const IntSize& minSize, const IntSize& maxSiz e) 2609 void FrameView::enableAutoSizeMode(const IntSize& minSize, const IntSize& maxSiz e)
2605 { 2610 {
2606 if (!m_autoSizeInfo) 2611 if (!m_autoSizeInfo)
2607 m_autoSizeInfo = FrameViewAutoSizeInfo::create(this); 2612 m_autoSizeInfo = FrameViewAutoSizeInfo::create(this);
2608 2613
2609 m_autoSizeInfo->configureAutoSizeMode(minSize, maxSize); 2614 m_autoSizeInfo->configureAutoSizeMode(minSize, maxSize);
2610 setLayoutSizeFixedToFrameSize(true); 2615 setLayoutSizeFixedToFrameSize(true);
2611 setNeedsLayout(); 2616 setNeedsLayout();
(...skipping 1317 matching lines...) Expand 10 before | Expand all | Expand 10 after
3929 return; 3934 return;
3930 3935
3931 ScrollableArea::setScrollOrigin(origin); 3936 ScrollableArea::setScrollOrigin(origin);
3932 3937
3933 // Update if the scroll origin changes, since our position will be different if the content size did not change. 3938 // Update if the scroll origin changes, since our position will be different if the content size did not change.
3934 if (updatePositionAtAll && updatePositionSynchronously) 3939 if (updatePositionAtAll && updatePositionSynchronously)
3935 updateScrollbars(scrollOffsetDouble()); 3940 updateScrollbars(scrollOffsetDouble());
3936 } 3941 }
3937 3942
3938 } // namespace blink 3943 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/frame/FrameView.h ('k') | Source/core/rendering/RenderBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698