Changeset 66577 in webkit
- Timestamp:
- Aug 31, 2010 10:59:26 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 33 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r66574 r66577 1 2010-08-31 Dave Hyatt <hyatt@apple.com> 2 3 Reviewed by Sam Weinig. 4 5 https://bugs.webkit.org/show_bug.cgi?id=44863, disentangle style recalc from layout, so that 6 the former can occur in more places without having to do the latter. 7 8 * WebCore.exp.in: 9 * page/FocusController.cpp: 10 (WebCore::FocusController::setActive): 11 * page/Frame.cpp: 12 (WebCore::Frame::Frame): 13 * page/Frame.h: 14 * page/FrameView.cpp: 15 (WebCore::FrameView::enterCompositingMode): 16 (WebCore::FrameView::layout): 17 (WebCore::FrameView::needsLayout): 18 (WebCore::FrameView::updateLayoutAndStyleIfNeededRecursive): 19 * page/FrameView.h: 20 * page/Page.cpp: 21 (WebCore::Page::scheduleForcedStyleRecalcForAllPages): 22 * page/Page.h: 23 * page/Settings.cpp: 24 (WebCore::setNeedsRecalcStyleInAllFrames): 25 (WebCore::setLoadsImagesAutomaticallyInAllFrames): 26 (WebCore::Settings::setStandardFontFamily): 27 (WebCore::Settings::setFixedFontFamily): 28 (WebCore::Settings::setSerifFontFamily): 29 (WebCore::Settings::setSansSerifFontFamily): 30 (WebCore::Settings::setCursiveFontFamily): 31 (WebCore::Settings::setFantasyFontFamily): 32 (WebCore::Settings::setMinimumFontSize): 33 (WebCore::Settings::setMinimumLogicalFontSize): 34 (WebCore::Settings::setDefaultFontSize): 35 (WebCore::Settings::setDefaultFixedFontSize): 36 (WebCore::Settings::setLoadsImagesAutomatically): 37 (WebCore::Settings::setTextAreasAreResizable): 38 (WebCore::Settings::setAuthorAndUserStylesEnabled): 39 (WebCore::Settings::setFontRenderingMode): 40 (WebCore::Settings::setZoomMode): 41 (WebCore::Settings::setAcceleratedCompositingEnabled): 42 (WebCore::Settings::setShowDebugBorders): 43 (WebCore::Settings::setShowRepaintCounter): 44 * rendering/RenderTheme.cpp: 45 (WebCore::RenderTheme::platformColorsDidChange): 46 1 47 2010-08-31 Jeremy Moskovich <jeremy@chromium.org> 2 48 -
trunk/WebCore/WebCore.exp.in
r66550 r66577 579 579 __ZN7WebCore5Frame10createViewERKNS_7IntSizeERKNS_5ColorEbS3_bNS_13ScrollbarModeEbS7_b 580 580 __ZN7WebCore5Frame10findStringERKN3WTF6StringEbbbb 581 __ZN7WebCore5Frame13reapplyStylesEv582 581 __ZN7WebCore5Frame14frameForWidgetEPKNS_6WidgetE 583 582 __ZN7WebCore5Frame15revealSelectionERKNS_15ScrollAlignmentEb … … 677 676 __ZN7WebCore8Document27removeMediaCanStartListenerEPNS_21MediaCanStartListenerE 678 677 __ZN7WebCore8Document36updateLayoutIgnorePendingStylesheetsEv 678 __ZN7WebCore8Document25scheduleForcedStyleRecalcEv 679 __ZN7WebCore8Document20styleSelectorChangedENS_23StyleSelectorUpdateFlagE 679 680 __ZN7WebCore8Document4headEv 680 681 __ZN7WebCore8FormData6createEPKvm … … 770 771 __ZN7WebCore9FrameView21flushDeferredRepaintsEv 771 772 __ZN7WebCore9FrameView22setBaseBackgroundColorENS_5ColorE 772 __ZN7WebCore9FrameView23layoutIfNeededRecursiveEv773 773 __ZN7WebCore9FrameView23updateCanHaveScrollbarsEv 774 __ZN7WebCore9FrameView37updateLayoutAndStyleIfNeededRecursiveEv 774 775 __ZN7WebCore9FrameView24forceLayoutForPaginationERKNS_9FloatSizeEfNS_5Frame19AdjustViewSizeOrNotE 775 776 __ZN7WebCore9FrameView29setShouldUpdateWhileOffscreenEb -
trunk/WebCore/page/FocusController.cpp
r66284 r66577 645 645 if (FrameView* view = m_page->mainFrame()->view()) { 646 646 if (!view->platformWidget()) { 647 view-> layoutIfNeededRecursive();647 view->updateLayoutAndStyleIfNeededRecursive(); 648 648 view->updateControlTints(); 649 649 } -
trunk/WebCore/page/Frame.cpp
r66544 r66577 147 147 , m_highlightTextMatches(false) 148 148 , m_inViewSourceMode(false) 149 , m_needsReapplyStyles(false)150 149 , m_isDisconnected(false) 151 150 , m_excludeFromTextSearch(false) … … 631 630 } 632 631 633 void Frame::setNeedsReapplyStyles()634 {635 // When the frame is not showing web content, it doesn't make sense to apply styles.636 // If we tried, we'd end up doing things with the document, but the document, if one637 // exists, is not currently shown and should be in the page cache.638 if (!m_loader.client()->hasHTMLView())639 return;640 641 if (m_needsReapplyStyles)642 return;643 644 m_needsReapplyStyles = true;645 646 // FrameView's "layout" timer includes reapplyStyles, so despite its647 // name, it's what we want to call here.648 if (view())649 view()->scheduleRelayout();650 }651 652 void Frame::reapplyStyles()653 {654 m_needsReapplyStyles = false;655 656 // FIXME: This call doesn't really make sense in a function called reapplyStyles.657 // We should probably eventually move it into its own function.658 m_doc->docLoader()->setAutoLoadImages(m_page && m_page->settings()->loadsImagesAutomatically());659 660 // FIXME: It's not entirely clear why the following is needed.661 // The document automatically does this as required when you set the style sheet.662 // But we had problems when this code was removed. Details are in663 // <http://bugs.webkit.org/show_bug.cgi?id=8079>.664 m_doc->styleSelectorChanged(RecalcStyleImmediately);665 }666 667 632 void Frame::injectUserScripts(UserScriptInjectionTime injectionTime) 668 633 { -
trunk/WebCore/page/Frame.h
r66544 r66577 165 165 static void clearTimers(FrameView*, Document*); 166 166 167 void setNeedsReapplyStyles();168 bool needsReapplyStyles() const;169 void reapplyStyles();170 171 167 String documentTypeString() const; 172 168 … … 329 325 bool m_highlightTextMatches; 330 326 bool m_inViewSourceMode; 331 bool m_needsReapplyStyles;332 327 bool m_isDisconnected; 333 328 bool m_excludeFromTextSearch; … … 398 393 } 399 394 400 inline bool Frame::needsReapplyStyles() const401 {402 return m_needsReapplyStyles;403 }404 405 395 inline CSSMutableStyleDeclaration* Frame::typingStyle() const 406 396 { -
trunk/WebCore/page/FrameView.cpp
r66555 r66577 524 524 { 525 525 #if USE(ACCELERATED_COMPOSITING) 526 if (RenderView* view = m_frame->contentRenderer()) 526 if (RenderView* view = m_frame->contentRenderer()) { 527 527 view->compositor()->enableCompositingMode(); 528 if (!needsLayout()) 529 view->compositor()->scheduleCompositingLayerUpdate(); 530 } 528 531 #endif 529 532 } … … 659 662 // Always ensure our style info is up-to-date. This can happen in situations where 660 663 // the layout beats any sort of style recalc update that needs to occur. 661 if (m_frame->needsReapplyStyles()) 662 m_frame->reapplyStyles(); 663 else 664 document->updateStyleIfNeeded(); 664 document->updateStyleIfNeeded(); 665 665 666 666 bool subtree = m_layoutRoot; … … 1445 1445 return false; 1446 1446 RenderView* root = m_frame->contentRenderer(); 1447 Document* document = m_frame->document();1448 1447 return layoutPending() 1449 1448 || (root && root->needsLayout()) 1450 1449 || m_layoutRoot 1451 || (document && document->childNeedsStyleRecalc()) // can occur when using WebKit ObjC interface1452 || m_frame->needsReapplyStyles()1453 1450 || (m_deferSetNeedsLayouts && m_setNeedsLayoutWasDeferred); 1454 1451 } … … 2017 2014 } 2018 2015 2019 void FrameView:: layoutIfNeededRecursive()2016 void FrameView::updateLayoutAndStyleIfNeededRecursive() 2020 2017 { 2021 2018 // We have to crawl our entire tree looking for any FrameViews that need … … 2028 2025 // when it lays out. 2029 2026 2027 m_frame->document()->updateStyleIfNeeded(); 2028 2030 2029 if (needsLayout()) 2031 2030 layout(); … … 2036 2035 Widget* widget = (*current).get(); 2037 2036 if (widget->isFrameView()) 2038 static_cast<FrameView*>(widget)-> layoutIfNeededRecursive();2039 } 2040 2041 // layoutIfNeededRecursive is called when we need to make sure layout isup-to-date before2037 static_cast<FrameView*>(widget)->updateLayoutAndStyleIfNeededRecursive(); 2038 } 2039 2040 // updateLayoutAndStyleIfNeededRecursive is called when we need to make sure style and layout are up-to-date before 2042 2041 // painting, so we need to flush out any deferred repaints too. 2043 2042 flushDeferredRepaints(); -
trunk/WebCore/page/FrameView.h
r66555 r66577 194 194 static double currentPaintTimeStamp() { return sCurrentPaintTimeStamp; } // returns 0 if not painting 195 195 196 void layoutIfNeededRecursive();196 void updateLayoutAndStyleIfNeededRecursive(); 197 197 void flushDeferredRepaints(); 198 198 -
trunk/WebCore/page/Page.cpp
r66544 r66577 407 407 } 408 408 409 void Page::s etNeedsReapplyStyles()409 void Page::scheduleForcedStyleRecalcForAllPages() 410 410 { 411 411 if (!allPages) … … 414 414 for (HashSet<Page*>::iterator it = allPages->begin(); it != end; ++it) 415 415 for (Frame* frame = (*it)->mainFrame(); frame; frame = frame->tree()->traverseNext()) 416 frame-> setNeedsReapplyStyles();416 frame->document()->scheduleForcedStyleRecalc(); 417 417 } 418 418 -
trunk/WebCore/page/Page.h
r64845 r66577 92 92 class Page : public Noncopyable { 93 93 public: 94 static void s etNeedsReapplyStyles();94 static void scheduleForcedStyleRecalcForAllPages(); 95 95 96 96 // It is up to the platform to ensure that non-null clients are provided where required. -
trunk/WebCore/page/Settings.cpp
r66570 r66577 29 29 #include "BackForwardList.h" 30 30 #include "Database.h" 31 #include "DocLoader.h" 31 32 #include "Frame.h" 32 33 #include "FrameTree.h" … … 42 43 namespace WebCore { 43 44 44 static void setNeedsRe applyStylesInAllFrames(Page* page)45 static void setNeedsRecalcStyleInAllFrames(Page* page) 45 46 { 46 47 for (Frame* frame = page->mainFrame(); frame; frame = frame->tree()->traverseNext()) 47 frame->setNeedsReapplyStyles(); 48 frame->document()->styleSelectorChanged(DeferRecalcStyle); 49 } 50 51 static void setLoadsImagesAutomaticallyInAllFrames(Page* page) 52 { 53 for (Frame* frame = page->mainFrame(); frame; frame = frame->tree()->traverseNext()) 54 frame->document()->docLoader()->setAutoLoadImages(page->settings()->loadsImagesAutomatically()); 48 55 } 49 56 … … 152 159 153 160 m_standardFontFamily = standardFontFamily; 154 setNeedsRe applyStylesInAllFrames(m_page);161 setNeedsRecalcStyleInAllFrames(m_page); 155 162 } 156 163 … … 161 168 162 169 m_fixedFontFamily = fixedFontFamily; 163 setNeedsRe applyStylesInAllFrames(m_page);170 setNeedsRecalcStyleInAllFrames(m_page); 164 171 } 165 172 … … 170 177 171 178 m_serifFontFamily = serifFontFamily; 172 setNeedsRe applyStylesInAllFrames(m_page);179 setNeedsRecalcStyleInAllFrames(m_page); 173 180 } 174 181 … … 179 186 180 187 m_sansSerifFontFamily = sansSerifFontFamily; 181 setNeedsRe applyStylesInAllFrames(m_page);188 setNeedsRecalcStyleInAllFrames(m_page); 182 189 } 183 190 … … 188 195 189 196 m_cursiveFontFamily = cursiveFontFamily; 190 setNeedsRe applyStylesInAllFrames(m_page);197 setNeedsRecalcStyleInAllFrames(m_page); 191 198 } 192 199 … … 197 204 198 205 m_fantasyFontFamily = fantasyFontFamily; 199 setNeedsRe applyStylesInAllFrames(m_page);206 setNeedsRecalcStyleInAllFrames(m_page); 200 207 } 201 208 … … 206 213 207 214 m_minimumFontSize = minimumFontSize; 208 setNeedsRe applyStylesInAllFrames(m_page);215 setNeedsRecalcStyleInAllFrames(m_page); 209 216 } 210 217 … … 215 222 216 223 m_minimumLogicalFontSize = minimumLogicalFontSize; 217 setNeedsRe applyStylesInAllFrames(m_page);224 setNeedsRecalcStyleInAllFrames(m_page); 218 225 } 219 226 … … 224 231 225 232 m_defaultFontSize = defaultFontSize; 226 setNeedsRe applyStylesInAllFrames(m_page);233 setNeedsRecalcStyleInAllFrames(m_page); 227 234 } 228 235 … … 233 240 234 241 m_defaultFixedFontSize = defaultFontSize; 235 setNeedsRe applyStylesInAllFrames(m_page);242 setNeedsRecalcStyleInAllFrames(m_page); 236 243 } 237 244 … … 239 246 { 240 247 m_loadsImagesAutomatically = loadsImagesAutomatically; 248 setLoadsImagesAutomaticallyInAllFrames(m_page); 241 249 } 242 250 … … 343 351 344 352 m_textAreasAreResizable = textAreasAreResizable; 345 setNeedsRe applyStylesInAllFrames(m_page);353 setNeedsRecalcStyleInAllFrames(m_page); 346 354 } 347 355 … … 443 451 444 452 m_authorAndUserStylesEnabled = authorAndUserStylesEnabled; 445 setNeedsRe applyStylesInAllFrames(m_page);453 setNeedsRecalcStyleInAllFrames(m_page); 446 454 } 447 455 … … 451 459 return; 452 460 m_fontRenderingMode = mode; 453 setNeedsRe applyStylesInAllFrames(m_page);461 setNeedsRecalcStyleInAllFrames(m_page); 454 462 } 455 463 … … 510 518 511 519 m_zoomMode = mode; 512 setNeedsRe applyStylesInAllFrames(m_page);520 setNeedsRecalcStyleInAllFrames(m_page); 513 521 } 514 522 … … 561 569 562 570 m_acceleratedCompositingEnabled = enabled; 563 setNeedsRe applyStylesInAllFrames(m_page);571 setNeedsRecalcStyleInAllFrames(m_page); 564 572 } 565 573 … … 570 578 571 579 m_showDebugBorders = enabled; 572 setNeedsRe applyStylesInAllFrames(m_page);580 setNeedsRecalcStyleInAllFrames(m_page); 573 581 } 574 582 … … 579 587 580 588 m_showRepaintCounter = enabled; 581 setNeedsRe applyStylesInAllFrames(m_page);589 setNeedsRecalcStyleInAllFrames(m_page); 582 590 } 583 591 -
trunk/WebCore/rendering/RenderTheme.cpp
r64634 r66577 1040 1040 m_inactiveListBoxSelectionForegroundColor = Color(); 1041 1041 1042 Page::s etNeedsReapplyStyles();1042 Page::scheduleForcedStyleRecalcForAllPages(); 1043 1043 } 1044 1044 -
trunk/WebKit/chromium/ChangeLog
r66576 r66577 1 2010-08-31 Dave Hyatt <hyatt@apple.com> 2 3 Reviewed by Sam Weinig. 4 5 https://bugs.webkit.org/show_bug.cgi?id=44863, disentangle style recalc from layout, so that 6 the former can occur in more places without having to do the latter. 7 8 * src/WebFrameImpl.cpp: 9 (WebKit::WebFrameImpl::layout): 10 1 11 2010-08-31 Kent Tamura <tkent@chromium.org> 2 12 -
trunk/WebKit/chromium/src/WebFrameImpl.cpp
r66180 r66577 1817 1817 FrameView* view = m_frame->view(); 1818 1818 if (view) 1819 view-> layoutIfNeededRecursive();1819 view->updateLayoutAndStyleIfNeededRecursive(); 1820 1820 } 1821 1821 -
trunk/WebKit/efl/ChangeLog
r66544 r66577 1 2010-08-31 Dave Hyatt <hyatt@apple.com> 2 3 Reviewed by Sam Weinig. 4 5 https://bugs.webkit.org/show_bug.cgi?id=44863, disentangle style recalc from layout, so that 6 the former can occur in more places without having to do the latter. 7 8 * ewk/ewk_view.cpp: 9 (ewk_view_layout_if_needed_recursive): 10 1 11 2010-08-31 Sam Weinig <sam@webkit.org> 2 12 -
trunk/WebKit/efl/ewk/ewk_view.cpp
r66377 r66577 2851 2851 return; 2852 2852 } 2853 v-> layoutIfNeededRecursive();2853 v->updateLayoutAndStyleIfNeededRecursive(); 2854 2854 } 2855 2855 -
trunk/WebKit/gtk/ChangeLog
r66531 r66577 1 2010-08-31 Dave Hyatt <hyatt@apple.com> 2 3 Reviewed by Sam Weinig. 4 5 https://bugs.webkit.org/show_bug.cgi?id=44863, disentangle style recalc from layout, so that 6 the former can occur in more places without having to do the latter. 7 8 * webkit/webkitwebview.cpp: 9 (webkit_web_view_expose_event): 10 1 11 2010-08-31 Martin Robinson <mrobinson@igalia.com> 2 12 -
trunk/WebKit/gtk/webkit/webkitwebview.cpp
r66520 r66577 520 520 Frame* frame = core(webView)->mainFrame(); 521 521 if (frame->contentRenderer() && frame->view()) { 522 frame->view()-> layoutIfNeededRecursive();522 frame->view()->updateLayoutAndStyleIfNeededRecursive(); 523 523 524 524 cairo_t* cr = gdk_cairo_create(event->window); -
trunk/WebKit/mac/Carbon/HIWebView.mm
r66441 r66577 357 357 NSView <WebDocumentView> *documentView = [[[inView->fWebView mainFrame] frameView] documentView]; 358 358 if ([documentView isKindOfClass:[WebHTMLView class]]) 359 [(WebHTMLView *)documentView _web_ layoutIfNeededRecursive];359 [(WebHTMLView *)documentView _web_updateLayoutAndStyleIfNeededRecursive]; 360 360 361 361 if ( inView->fIsComposited ) -
trunk/WebKit/mac/ChangeLog
r66544 r66577 1 2010-08-31 Dave Hyatt <hyatt@apple.com> 2 3 Reviewed by Sam Weinig. 4 5 https://bugs.webkit.org/show_bug.cgi?id=44863, disentangle style recalc from layout, so that 6 the former can occur in more places without having to do the latter. 7 8 Eliminate Mac-specific code for style re-application and recursive layout/style updating in 9 favor of the cross-platform code that all the other ports use. 10 11 * Carbon/HIWebView.mm: 12 (Draw): 13 * WebCoreSupport/WebFrameLoaderClient.mm: 14 (WebFrameLoaderClient::forceLayout): 15 * WebView/WebHTMLView.mm: 16 (-[WebHTMLView _propagateDirtyRectsToOpaqueAncestors]): 17 (-[WebHTMLView viewWillDraw]): 18 (-[WebHTMLView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:]): 19 (-[WebHTMLView _recursiveDisplayAllDirtyWithLockFocus:visRect:]): 20 (-[WebHTMLView _recursive:displayRectIgnoringOpacity:inContext:topView:]): 21 (-[WebHTMLView reapplyStyles]): 22 (-[WebHTMLView layoutToMinimumPageWidth:height:maximumPageWidth:adjustingViewSize:]): 23 (-[WebHTMLView setNeedsToApplyStyles:]): 24 (-[WebHTMLView _setPrinting:minimumPageWidth:height:maximumPageWidth:adjustViewSize:paginateScreenContent:]): 25 (-[WebHTMLView _layoutIfNeeded]): 26 (-[WebHTMLView _web_updateLayoutAndStyleIfNeededRecursive]): 27 * WebView/WebHTMLViewInternal.h: 28 * WebView/WebView.mm: 29 (-[WebView _viewWillDrawInternal]): 30 1 31 2010-08-31 Sam Weinig <sam@webkit.org> 2 32 -
trunk/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
r66437 r66577 242 242 { 243 243 NSView <WebDocumentView> *view = [m_webFrame->_private->webFrameView documentView]; 244 if ([view isKindOfClass:[WebHTMLView class]])245 [(WebHTMLView *)view setNeedsToApplyStyles:YES];246 244 [view setNeedsLayout:YES]; 247 245 [view layout]; -
trunk/WebKit/mac/WebView/WebHTMLView.mm
r66544 r66577 444 444 @public 445 445 BOOL closed; 446 BOOL needsToApplyStyles;447 446 BOOL ignoringMouseDraggedEvents; 448 447 BOOL printing; … … 1291 1290 { 1292 1291 if (![[self _webView] drawsBackground]) 1293 [self _web_ layoutIfNeededRecursive];1292 [self _web_updateLayoutAndStyleIfNeededRecursive]; 1294 1293 [super _propagateDirtyRectsToOpaqueAncestors]; 1295 1294 } … … 1303 1302 // once the FIXME in _isTopHTMLView is fixed. 1304 1303 if (_private->dataSource && [self _isTopHTMLView]) 1305 [self _web_ layoutIfNeededRecursive];1304 [self _web_updateLayoutAndStyleIfNeededRecursive]; 1306 1305 [super viewWillDraw]; 1307 1306 } … … 1321 1320 #ifndef BUILDING_ON_TIGER 1322 1321 else 1323 [self _web_ layoutIfNeededRecursive];1322 [self _web_updateLayoutAndStyleIfNeededRecursive]; 1324 1323 #endif 1325 1324 } else if (wasInPrintingMode) … … 1337 1336 if (rectCount) { 1338 1337 LOG_ERROR("View needs layout. Either -viewWillDraw wasn't called or layout was invalidated during the display operation. Performing layout now."); 1339 [self _web_ layoutIfNeededRecursive];1338 [self _web_updateLayoutAndStyleIfNeededRecursive]; 1340 1339 } 1341 1340 } 1342 1341 #else 1343 1342 // Because Tiger does not have viewWillDraw we need to do layout here. 1344 [self _web_ layoutIfNeededRecursive];1343 [self _web_updateLayoutAndStyleIfNeededRecursive]; 1345 1344 [_subviews makeObjectsPerformSelector:@selector(_propagateDirtyRectsToOpaqueAncestors)]; 1346 1345 #endif … … 1374 1373 #ifndef BUILDING_ON_TIGER 1375 1374 else 1376 [self _web_ layoutIfNeededRecursive];1375 [self _web_updateLayoutAndStyleIfNeededRecursive]; 1377 1376 #endif 1378 1377 } else if (wasInPrintingMode) … … 1384 1383 NSRect boundsBeforeLayout = [self bounds]; 1385 1384 if (!NSIsEmptyRect(visRect)) 1386 [self _web_ layoutIfNeededRecursive];1385 [self _web_updateLayoutAndStyleIfNeededRecursive]; 1387 1386 1388 1387 // If layout changes the view's bounds, then we need to recompute the visRect. … … 1417 1416 #ifdef BUILDING_ON_TIGER 1418 1417 // Because Tiger does not have viewWillDraw we need to do layout here. 1419 [self _web_ layoutIfNeededRecursive];1418 [self _web_updateLayoutAndStyleIfNeededRecursive]; 1420 1419 #endif 1421 1420 … … 3118 3117 - (void)reapplyStyles 3119 3118 { 3120 if (!_private->needsToApplyStyles)3121 return;3122 3123 3119 #ifdef LOG_TIMES 3124 3120 double start = CFAbsoluteTimeGetCurrent(); 3125 3121 #endif 3126 3122 3127 if (Frame* coreFrame = core([self _frame])) { 3128 if (FrameView* coreView = coreFrame->view()) 3129 coreView->setMediaType(_private->printing ? "print" : "screen"); 3130 if (Document* document = coreFrame->document()) { 3131 document->setPaginatedForScreen(_private->paginateScreenContent); 3132 document->setPrinting(_private->printing); 3133 } 3134 coreFrame->reapplyStyles(); 3135 } 3123 if (Frame* coreFrame = core([self _frame])) 3124 coreFrame->document()->styleSelectorChanged(RecalcStyleImmediately); 3136 3125 3137 3126 #ifdef LOG_TIMES … … 3139 3128 LOG(Timing, "%s apply style seconds = %f", [self URL], thisTime); 3140 3129 #endif 3141 3142 _private->needsToApplyStyles = NO;3143 3130 } 3144 3131 … … 3146 3133 // minPageWidth==0 implies a non-printing layout 3147 3134 - (void)layoutToMinimumPageWidth:(float)minPageWidth height:(float)minPageHeight maximumPageWidth:(float)maxPageWidth adjustingViewSize:(BOOL)adjustViewSize 3148 { 3149 [self reapplyStyles]; 3150 3135 { 3151 3136 if (![self _needsLayout]) 3152 3137 return; … … 3309 3294 { 3310 3295 LOG(View, "%@ setNeedsToApplyStyles:%@", self, flag ? @"YES" : @"NO"); 3311 _private->needsToApplyStyles = flag; 3296 if (!flag) 3297 return; // There's no way to say you don't need a style recalc. 3298 if (Frame* frame = core([self _frame])) { 3299 if (frame->document() && frame->document()->inPageCache()) 3300 return; 3301 frame->document()->scheduleForcedStyleRecalc(); 3302 } 3312 3303 } 3313 3304 … … 3884 3875 if (!printing && !paginateScreenContent) 3885 3876 _private->avoidingPrintOrphan = NO; 3886 [self setNeedsToApplyStyles:YES]; 3877 3878 Frame* coreFrame = core([self _frame]); 3879 if (coreFrame) { 3880 if (FrameView* coreView = coreFrame->view()) 3881 coreView->setMediaType(_private->printing ? "print" : "screen"); 3882 if (Document* document = coreFrame->document()) { 3883 document->setPaginatedForScreen(_private->paginateScreenContent); 3884 document->setPrinting(_private->printing); 3885 document->styleSelectorChanged(RecalcStyleImmediately); 3886 } 3887 } 3888 3887 3889 [self setNeedsLayout:YES]; 3888 3890 [self layoutToMinimumPageWidth:minPageWidth height:minPageHeight maximumPageWidth:maxPageWidth adjustingViewSize:adjustViewSize]; … … 5508 5510 ASSERT(!_private->subviewsSetAside); 5509 5511 5510 if ( _private->needsToApplyStyles ||[self _needsLayout])5512 if ([self _needsLayout]) 5511 5513 [self layout]; 5512 5514 } 5513 5515 5514 - (void)_web_layoutIfNeededRecursive 5515 { 5516 [self _layoutIfNeeded]; 5517 5518 #ifndef NDEBUG 5519 _private->enumeratingSubviews = YES; 5520 #endif 5521 5522 NSMutableArray *descendantWebHTMLViews = [[NSMutableArray alloc] init]; 5523 5524 [self _web_addDescendantWebHTMLViewsToArray:descendantWebHTMLViews]; 5525 5526 unsigned count = [descendantWebHTMLViews count]; 5527 for (unsigned i = 0; i < count; ++i) 5528 [[descendantWebHTMLViews objectAtIndex:i] _layoutIfNeeded]; 5529 5530 [descendantWebHTMLViews release]; 5531 5532 #ifndef NDEBUG 5533 _private->enumeratingSubviews = NO; 5534 #endif 5516 - (void)_web_updateLayoutAndStyleIfNeededRecursive 5517 { 5518 WebFrame *webFrame = [self _frame]; 5519 Frame* coreFrame = core(webFrame); 5520 if (coreFrame && coreFrame->view()) 5521 coreFrame->view()->updateLayoutAndStyleIfNeededRecursive(); 5535 5522 } 5536 5523 -
trunk/WebKit/mac/WebView/WebHTMLViewInternal.h
r47349 r66577 60 60 - (WebCore::CachedImage*)promisedDragTIFFDataSource; 61 61 - (void)setPromisedDragTIFFDataSource:(WebCore::CachedImage*)source; 62 - (void)_web_ layoutIfNeededRecursive;62 - (void)_web_updateLayoutAndStyleIfNeededRecursive; 63 63 - (void)_destroyAllWebPlugins; 64 64 - (BOOL)_needsLayout; -
trunk/WebKit/mac/WebView/WebView.mm
r66544 r66577 843 843 Frame* frame = [self _mainCoreFrame]; 844 844 if (frame && frame->view()) 845 frame->view()-> layoutIfNeededRecursive();845 frame->view()->updateLayoutAndStyleIfNeededRecursive(); 846 846 } 847 847 -
trunk/WebKit/qt/Api/qwebelement.cpp
r66057 r66577 1447 1447 FrameView* view = frame->view(); 1448 1448 1449 view-> layoutIfNeededRecursive();1449 view->updateLayoutAndStyleIfNeededRecursive(); 1450 1450 1451 1451 IntRect rect = e->getRect(); -
trunk/WebKit/qt/Api/qwebframe.cpp
r65999 r66577 287 287 288 288 WebCore::FrameView* view = frame->view(); 289 view-> layoutIfNeededRecursive();289 view->updateLayoutAndStyleIfNeededRecursive(); 290 290 291 291 for (int i = 0; i < vector.size(); ++i) { -
trunk/WebKit/qt/ChangeLog
r66565 r66577 1 2010-08-31 Dave Hyatt <hyatt@apple.com> 2 3 Reviewed by Sam Weinig. 4 5 https://bugs.webkit.org/show_bug.cgi?id=44863, disentangle style recalc from layout, so that 6 the former can occur in more places without having to do the latter. 7 8 * Api/qwebelement.cpp: 9 (QWebElement::render): 10 * Api/qwebframe.cpp: 11 (QWebFramePrivate::renderRelativeCoords): 12 1 13 2010-08-31 Benjamin Poulain <benjamin.poulain@nokia.com> 2 14 -
trunk/WebKit/win/ChangeLog
r66438 r66577 1 2010-08-31 Dave Hyatt <hyatt@apple.com> 2 3 Reviewed by Sam Weinig. 4 5 https://bugs.webkit.org/show_bug.cgi?id=44863, disentangle style recalc from layout, so that 6 the former can occur in more places without having to do the latter. 7 8 * WebFrame.cpp: 9 (WebFrame::paintDocumentRectToContext): 10 * WebView.cpp: 11 (WebView::updateBackingStore): 12 1 13 2010-08-30 Adam Roben <aroben@apple.com> 2 14 -
trunk/WebKit/win/WebFrame.cpp
r65787 r66577 341 341 342 342 // We can't paint with a layout still pending. 343 view-> layoutIfNeededRecursive();343 view->updateLayoutAndStyleIfNeededRecursive(); 344 344 345 345 HDC dc = reinterpret_cast<HDC>(static_cast<ULONG64>(deviceContext)); -
trunk/WebKit/win/WebView.cpp
r65952 r66577 911 911 if (Frame* coreFrame = core(m_mainFrame)) 912 912 if (FrameView* view = coreFrame->view()) 913 view-> layoutIfNeededRecursive();913 view->updateLayoutAndStyleIfNeededRecursive(); 914 914 915 915 Vector<IntRect> paintRects; -
trunk/WebKit/wx/ChangeLog
r66314 r66577 1 2010-08-31 Dave Hyatt <hyatt@apple.com> 2 3 Reviewed by Sam Weinig. 4 5 https://bugs.webkit.org/show_bug.cgi?id=44863, disentangle style recalc from layout, so that 6 the former can occur in more places without having to do the latter. 7 8 * WebView.cpp: 9 (wxWebView::OnPaint): 10 1 11 2010-08-28 Kevin Ollivier <kevino@theolliviers.com> 2 12 -
trunk/WebKit/wx/WebView.cpp
r66314 r66577 685 685 #endif 686 686 if (frame->contentRenderer()) { 687 frame->view()-> layoutIfNeededRecursive();687 frame->view()->updateLayoutAndStyleIfNeededRecursive(); 688 688 frame->view()->paint(&gc, paintRect); 689 689 } -
trunk/WebKit2/ChangeLog
r66558 r66577 1 2010-08-31 Dave Hyatt <hyatt@apple.com> 2 3 Reviewed by Sam Weinig. 4 5 https://bugs.webkit.org/show_bug.cgi?id=44863 6 7 * WebProcess/WebPage/WebPage.cpp: 8 (WebKit::WebPage::layoutIfNeeded): 9 1 10 2010-08-31 Jon Honeycutt <jhoneycutt@apple.com> 2 11 -
trunk/WebKit2/WebProcess/WebPage/WebPage.cpp
r66551 r66577 278 278 { 279 279 if (m_mainFrame->coreFrame()->view()) 280 m_mainFrame->coreFrame()->view()-> layoutIfNeededRecursive();280 m_mainFrame->coreFrame()->view()->updateLayoutAndStyleIfNeededRecursive(); 281 281 } 282 282
Note: See TracChangeset
for help on using the changeset viewer.