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

Side by Side Diff: Source/core/layout/LayoutView.cpp

Issue 999033002: Advance document lifecycle to CompositingClean prior to hit testing (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: add assert and allow CompositingClean change to InPreLayout Created 5 years, 9 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 m_hitTestCount++; 90 m_hitTestCount++;
91 91
92 ASSERT(!location.isRectBasedTest() || request.listBased()); 92 ASSERT(!location.isRectBasedTest() || request.listBased());
93 93
94 // We have to recursively update layout/style here because otherwise, when t he hit test recurses 94 // We have to recursively update layout/style here because otherwise, when t he hit test recurses
95 // into a child document, it could trigger a layout on the parent document, which can destroy Layers 95 // into a child document, it could trigger a layout on the parent document, which can destroy Layers
96 // that are higher up in the call stack, leading to crashes. 96 // that are higher up in the call stack, leading to crashes.
97 // Note that Document::updateLayout calls its parent's updateLayout. 97 // Note that Document::updateLayout calls its parent's updateLayout.
98 // FIXME: It should be the caller's responsibility to ensure an up-to-date l ayout. 98 // FIXME: It should be the caller's responsibility to ensure an up-to-date l ayout.
99 frameView()->updateLayoutAndStyleIfNeededRecursive(); 99 frameView()->updateLayoutAndStyleIfNeededRecursive();
100 compositor()->updateIfNeededRecursive();
100 commitPendingSelection(); 101 commitPendingSelection();
102 ASSERT(document().lifecycle().state() >= DocumentLifecycle::CompositingClean );
leviw_travelin_and_unemployed 2015/03/12 20:09:32 This assert should go somewhere deeper in Blink, l
qiankun 2015/03/13 03:23:10 Done.
101 103
102 bool hitLayer = layer()->hitTest(request, location, result); 104 bool hitLayer = layer()->hitTest(request, location, result);
103 105
104 // FrameView scrollbars are not the same as Layer scrollbars tested by Layer ::hitTestOverflowControls, 106 // FrameView scrollbars are not the same as Layer scrollbars tested by Layer ::hitTestOverflowControls,
105 // so we need to test FrameView scrollbars separately here. Note that it's i mportant we do this after 107 // so we need to test FrameView scrollbars separately here. Note that it's i mportant we do this after
106 // the hit test above, because that may overwrite the entire HitTestResult w hen it finds a hit. 108 // the hit test above, because that may overwrite the entire HitTestResult w hen it finds a hit.
107 IntPoint framePoint = frameView()->contentsToFrame(location.roundedPoint()); 109 IntPoint framePoint = frameView()->contentsToFrame(location.roundedPoint());
108 if (Scrollbar* frameScrollbar = frameView()->scrollbarAtFramePoint(framePoin t)) 110 if (Scrollbar* frameScrollbar = frameView()->scrollbarAtFramePoint(framePoin t))
109 result.setScrollbar(frameScrollbar); 111 result.setScrollbar(frameScrollbar);
110 112
(...skipping 875 matching lines...) Expand 10 before | Expand all | Expand 10 after
986 return viewHeight(IncludeScrollbars) / scale; 988 return viewHeight(IncludeScrollbars) / scale;
987 } 989 }
988 990
989 void LayoutView::willBeDestroyed() 991 void LayoutView::willBeDestroyed()
990 { 992 {
991 LayoutBlockFlow::willBeDestroyed(); 993 LayoutBlockFlow::willBeDestroyed();
992 m_compositor.clear(); 994 m_compositor.clear();
993 } 995 }
994 996
995 } // namespace blink 997 } // namespace blink
OLDNEW
« Source/core/dom/DocumentLifecycle.cpp ('K') | « Source/core/dom/DocumentLifecycle.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698