Changeset 104874 in webkit
- Timestamp:
- Jan 12, 2012 4:19:10 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r104873 r104874 1 2012-01-12 Benjamin Poulain <bpoulain@apple.com> 2 3 A Frame with frame flattening can be stuck in a state in which performPostLayoutTasks() is never executed 4 https://bugs.webkit.org/show_bug.cgi?id=76154 5 6 Reviewed by Beth Dakin. 7 8 In a frame with inSubframeLayoutWithFrameFlattening == true, if 9 -m_hasPendingPostLayoutTasks == true 10 -FrameView::unscheduleRelayout() is executed 11 -->the timer m_postLayoutTasksTimer is stopped 12 -->no timer is scheduled due to m_hasPendingPostLayoutTasks == true && inSubframeLayoutWithFrameFlattening == true 13 14 This patch revert the handling of the postLayoutTasks to its state prior to r66552. 15 16 The timer itself is used as the only state to know if post layout tasks are scheduled. 17 18 For the case without frame flattening: 19 -Prior to this patch, when FrameView::unscheduleRelayout() was executed, the postLayoutTasksTimer was killed, 20 and the post layout tasks would be executed during the next layout(). 21 -After this patch, the post layout tasks stay scheduled and are executed on the next event loop if layout() 22 was not invoked before. 23 24 * page/FrameView.cpp: 25 (WebCore::FrameView::FrameView): 26 (WebCore::FrameView::~FrameView): 27 (WebCore::FrameView::reset): 28 (WebCore::FrameView::layout): 29 (WebCore::FrameView::unscheduleRelayout): 30 (WebCore::FrameView::flushAnyPendingPostLayoutTasks): 31 (WebCore::FrameView::performPostLayoutTasks): 32 * page/FrameView.h: 33 1 34 2012-01-12 Yongjun Zhang <yongjun_zhang@apple.com> 2 35 -
trunk/Source/WebCore/page/FrameView.cpp
r104260 r104874 135 135 , m_inLayoutParentView(false) 136 136 #endif 137 , m_hasPendingPostLayoutTasks(false)138 137 , m_inSynchronousPostLayout(false) 139 138 , m_postLayoutTasksTimer(this, &FrameView::postLayoutTimerFired) … … 187 186 FrameView::~FrameView() 188 187 { 189 if (m_ hasPendingPostLayoutTasks) {188 if (m_postLayoutTasksTimer.isActive()) { 190 189 m_postLayoutTasksTimer.stop(); 191 190 m_actionScheduler->clear(); … … 233 232 m_inLayout = false; 234 233 m_inSynchronousPostLayout = false; 235 m_hasPendingPostLayoutTasks = false;236 234 m_layoutCount = 0; 237 235 m_nestedLayoutCount = 0; … … 995 993 TemporaryChange<bool> changeSchedulingEnabled(m_layoutSchedulingEnabled, false); 996 994 997 if (!m_nestedLayoutCount && !m_inSynchronousPostLayout && m_ hasPendingPostLayoutTasks&& !inSubframeLayoutWithFrameFlattening) {995 if (!m_nestedLayoutCount && !m_inSynchronousPostLayout && m_postLayoutTasksTimer.isActive() && !inSubframeLayoutWithFrameFlattening) { 998 996 // This is a new top-level layout. If there are any remaining tasks from the previous 999 997 // layout, finish them now. 1000 998 m_inSynchronousPostLayout = true; 1001 m_postLayoutTasksTimer.stop();1002 999 performPostLayoutTasks(); 1003 1000 m_inSynchronousPostLayout = false; … … 1171 1168 layoutHeight() < contentsHeight()); 1172 1169 1173 if (!m_ hasPendingPostLayoutTasks) {1170 if (!m_postLayoutTasksTimer.isActive()) { 1174 1171 if (!m_inSynchronousPostLayout) { 1175 1172 if (inSubframeLayoutWithFrameFlattening) { … … 1184 1181 } 1185 1182 1186 if (!m_ hasPendingPostLayoutTasks&& (needsLayout() || m_inSynchronousPostLayout || inSubframeLayoutWithFrameFlattening)) {1183 if (!m_postLayoutTasksTimer.isActive() && (needsLayout() || m_inSynchronousPostLayout || inSubframeLayoutWithFrameFlattening)) { 1187 1184 // If we need layout or are already in a synchronous call to postLayoutTasks(), 1188 1185 // defer widget updates and event dispatch until after we return. postLayoutTasks() 1189 1186 // can make us need to update again, and we can get stuck in a nasty cycle unless 1190 1187 // we call it through the timer here. 1191 m_hasPendingPostLayoutTasks = true;1192 1188 m_postLayoutTasksTimer.startOneShot(0); 1193 1189 if (needsLayout()) { … … 2094 2090 void FrameView::unscheduleRelayout() 2095 2091 { 2096 m_postLayoutTasksTimer.stop();2097 2098 2092 if (!m_layoutTimer.isActive()) 2099 2093 return; … … 2277 2271 void FrameView::flushAnyPendingPostLayoutTasks() 2278 2272 { 2279 if (!m_hasPendingPostLayoutTasks) 2280 return; 2281 2273 if (!m_postLayoutTasksTimer.isActive()) 2274 return; 2275 2276 performPostLayoutTasks(); 2277 } 2278 2279 void FrameView::performPostLayoutTasks() 2280 { 2282 2281 m_postLayoutTasksTimer.stop(); 2283 performPostLayoutTasks();2284 }2285 2286 void FrameView::performPostLayoutTasks()2287 {2288 m_hasPendingPostLayoutTasks = false;2289 2282 2290 2283 m_frame->selection()->setCaretRectNeedsUpdate(); -
trunk/Source/WebCore/page/FrameView.h
r103565 r104874 426 426 bool m_inLayoutParentView; 427 427 #endif 428 bool m_hasPendingPostLayoutTasks;429 428 bool m_inSynchronousPostLayout; 430 429 int m_layoutCount;
Note: See TracChangeset
for help on using the changeset viewer.