Changeset 192298 in webkit
- Timestamp:
- Nov 11, 2015 12:39:42 AM (8 years ago)
- Location:
- releases/WebKitGTK/webkit-2.10
- Files:
-
- 2 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
releases/WebKitGTK/webkit-2.10/LayoutTests/ChangeLog
r192296 r192298 1 2015-11-07 Zalan Bujtas <zalan@apple.com> 2 3 Crash when subtree layout is set on FrameView while auto size mode is enabled. 4 https://bugs.webkit.org/show_bug.cgi?id=150995 5 rdar://problem/22785262 6 7 Reviewed by Beth Dakin. 8 9 Autosizing initiates multiple synchronous layouts to calculate preferred view width for current content. 10 FrameView::autoSizeIfEnabled() is called from FrameView::layout() while we are in InPreLayout state. 11 It is safe to do during full layout. 12 However, since we setup the subtree state just before the autoSizeIfEnabled() call, reentering it with 13 a newly issued layout confuses SubtreeLayoutStateMaintainer. 14 15 This patch reverses the order of autoSizeIfEnabled() call and the subtree layout state setup. 16 It also ensures that the first layout requested by autoSizeIfEnabled() always runs on the whole tree. 17 18 * fast/dynamic/crash-subtree-layout-when-auto-size-enabled-expected.txt: Added. 19 * fast/dynamic/crash-subtree-layout-when-auto-size-enabled.html: Added. 20 1 21 2015-11-06 Myles C. Maxfield <mmaxfield@apple.com> 2 22 -
releases/WebKitGTK/webkit-2.10/Source/WebCore/ChangeLog
r192297 r192298 1 2015-11-07 Zalan Bujtas <zalan@apple.com> 2 3 Crash when subtree layout is set on FrameView while auto size mode is enabled. 4 https://bugs.webkit.org/show_bug.cgi?id=150995 5 rdar://problem/22785262 6 7 Reviewed by Beth Dakin. 8 9 Autosizing initiates multiple synchronous layouts to calculate preferred view width for current content. 10 FrameView::autoSizeIfEnabled() is called from FrameView::layout() while we are in InPreLayout state. 11 It is safe to do during full layout. 12 However, since we setup the subtree state just before the autoSizeIfEnabled() call, reentering it with 13 a newly issued layout confuses SubtreeLayoutStateMaintainer. 14 15 This patch reverses the order of autoSizeIfEnabled() call and the subtree layout state setup. 16 It also ensures that the first layout requested by autoSizeIfEnabled() always runs on the whole tree. 17 18 Test: fast/dynamic/crash-subtree-layout-when-auto-size-enabled.html 19 20 * page/FrameView.cpp: 21 (WebCore::FrameView::layout): 22 (WebCore::FrameView::convertSubtreeLayoutToFullLayout): 23 (WebCore::FrameView::scheduleRelayout): 24 (WebCore::FrameView::scheduleRelayoutOfSubtree): 25 (WebCore::FrameView::autoSizeIfEnabled): 26 * page/FrameView.h: 27 * testing/Internals.cpp: 28 (WebCore::Internals::enableAutoSizeMode): 29 * testing/Internals.h: 30 * testing/Internals.idl: 31 1 32 2015-11-07 Michael Catanzaro <mcatanzaro@igalia.com> 2 33 -
releases/WebKitGTK/webkit-2.10/Source/WebCore/page/FrameView.cpp
r189685 r192298 1255 1255 AnimationUpdateBlock animationUpdateBlock(&frame().animation()); 1256 1256 1257 if (!allowSubtree && m_layoutRoot) { 1258 m_layoutRoot->markContainingBlocksForLayout(ScheduleRelayout::No); 1259 m_layoutRoot = nullptr; 1260 } 1257 if (!allowSubtree && m_layoutRoot) 1258 convertSubtreeLayoutToFullLayout(); 1261 1259 1262 1260 ASSERT(frame().view() == this); … … 1265 1263 Document& document = *frame().document(); 1266 1264 ASSERT(!document.inPageCache()); 1267 1268 bool subtree;1269 RenderElement* root;1270 1265 1271 1266 { … … 1298 1293 // the layout beats any sort of style recalc update that needs to occur. 1299 1294 document.updateStyleIfNeeded(); 1300 m_layoutPhase = InPreLayout; 1301 1302 subtree = m_layoutRoot; 1303 1304 // If there is only one ref to this view left, then its going to be destroyed as soon as we exit, 1295 // If there is only one ref to this view left, then its going to be destroyed as soon as we exit, 1305 1296 // so there's no point to continuing to layout 1306 1297 if (hasOneRef()) 1307 1298 return; 1308 1299 1309 root = subtree ? m_layoutRoot : document.renderView();1310 if (!root) {1311 // FIXME: Do we need to set m_size here?1312 return;1313 }1314 1315 1300 // Close block here so we can set up the font cache purge preventer, which we will still 1316 1301 // want in scope even after we want m_layoutSchedulingEnabled to be restored again. … … 1318 1303 } 1319 1304 1320 RenderLayer* layer; 1305 m_layoutPhase = InPreLayout; 1306 1307 RenderLayer* layer = nullptr; 1308 bool subtree = false; 1309 RenderElement* root = nullptr; 1321 1310 1322 1311 ++m_nestedLayoutCount; … … 1324 1313 { 1325 1314 TemporaryChange<bool> changeSchedulingEnabled(m_layoutSchedulingEnabled, false); 1315 1316 autoSizeIfEnabled(); 1317 1318 root = m_layoutRoot ? m_layoutRoot : document.renderView(); 1319 if (!root) 1320 return; 1321 subtree = m_layoutRoot; 1326 1322 1327 1323 if (!m_layoutRoot) { … … 1339 1335 if (m_firstLayout && !frame().ownerElement()) 1340 1336 printf("Elapsed time before first layout: %lld\n", document.elapsedTime().count()); 1341 #endif 1337 #endif 1342 1338 } 1343 1344 autoSizeIfEnabled();1345 1339 1346 1340 m_needsFullRepaint = !subtree && (m_firstLayout || downcast<RenderView>(*root).printing()); … … 2561 2555 } 2562 2556 } 2557 void FrameView::convertSubtreeLayoutToFullLayout() 2558 { 2559 ASSERT(m_layoutRoot); 2560 m_layoutRoot->markContainingBlocksForLayout(ScheduleRelayout::No); 2561 m_layoutRoot = nullptr; 2562 } 2563 2563 2564 2564 void FrameView::layoutTimerFired() … … 2577 2577 ASSERT(frame().view() == this); 2578 2578 2579 if (m_layoutRoot) { 2580 m_layoutRoot->markContainingBlocksForLayout(ScheduleRelayout::No); 2581 m_layoutRoot = nullptr; 2582 } 2579 if (m_layoutRoot) 2580 convertSubtreeLayoutToFullLayout(); 2583 2581 if (!m_layoutSchedulingEnabled) 2584 2582 return; … … 2669 2667 2670 2668 // Just do a full relayout. 2671 m_layoutRoot->markContainingBlocksForLayout(ScheduleRelayout::No); 2672 m_layoutRoot = nullptr; 2669 convertSubtreeLayoutToFullLayout(); 2673 2670 newRelayoutRoot.markContainingBlocksForLayout(ScheduleRelayout::No); 2674 2671 InspectorInstrumentation::didInvalidateLayout(frame()); … … 3213 3210 return; 3214 3211 3212 if (m_layoutRoot) 3213 convertSubtreeLayoutToFullLayout(); 3215 3214 // Start from the minimum size and allow it to grow. 3216 3215 resize(m_minAutoSize.width(), m_minAutoSize.height()); -
releases/WebKitGTK/webkit-2.10/Source/WebCore/page/FrameView.h
r189685 r192298 677 677 void notifyWidgets(WidgetNotification); 678 678 679 void convertSubtreeLayoutToFullLayout(); 680 679 681 RenderElement* viewportRenderer() const; 680 682 -
releases/WebKitGTK/webkit-2.10/Source/WebCore/testing/Internals.cpp
r188348 r192298 2400 2400 } 2401 2401 2402 void Internals::enableAutoSizeMode(bool enabled, int minimumWidth, int minimumHeight, int maximumWidth, int maximumHeight) 2403 { 2404 Document* document = contextDocument(); 2405 if (!document || !document->view()) 2406 return; 2407 document->view()->enableAutoSizeMode(enabled, IntSize(minimumWidth, minimumHeight), IntSize(maximumWidth, maximumHeight)); 2408 } 2409 2402 2410 #if ENABLE(ENCRYPTED_MEDIA_V2) 2403 2411 void Internals::initializeMockCDM() -
releases/WebKitGTK/webkit-2.10/Source/WebCore/testing/Internals.h
r187588 r192298 339 339 void forceReload(bool endToEnd); 340 340 341 void enableAutoSizeMode(bool enabled, int minimumWidth, int minimumHeight, int maximumWidth, int maximumHeight); 342 341 343 #if ENABLE(ENCRYPTED_MEDIA_V2) 342 344 void initializeMockCDM(); -
releases/WebKitGTK/webkit-2.10/Source/WebCore/testing/Internals.idl
r187588 r192298 331 331 void forceReload(boolean endToEnd); 332 332 333 void enableAutoSizeMode(boolean enabled, long minimumWidth, long minimumHeight, long maximumWidth, long maximumHeight); 334 333 335 [Conditional=VIDEO] void simulateAudioInterruption(Node node); 334 336 [Conditional=VIDEO, RaisesException] boolean mediaElementHasCharacteristic(Node node, DOMString characteristic);
Note: See TracChangeset
for help on using the changeset viewer.