Changeset 206311 in webkit
- Timestamp:
- Sep 23, 2016, 9:35:04 AM (9 years ago)
- Location:
- trunk/Source
- Files:
-
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r206310 r206311 1 2016-09-23 Antti Koivisto <antti@apple.com> 2 3 Move stylesheet change logic from Document to AuthorStyleSheets 4 https://bugs.webkit.org/show_bug.cgi?id=162488 5 6 Reviewed by Andreas Kling. 7 8 That's where it belongs. 9 10 * WebCore.xcodeproj/project.pbxproj: 11 * css/CSSStyleSheet.cpp: 12 (WebCore::CSSStyleSheet::didMutateRules): 13 (WebCore::CSSStyleSheet::didMutate): 14 (WebCore::CSSStyleSheet::clearOwnerNode): 15 * dom/AuthorStyleSheets.cpp: 16 (WebCore::AuthorStyleSheets::AuthorStyleSheets): 17 (WebCore::AuthorStyleSheets::flushPendingUpdates): 18 (WebCore::AuthorStyleSheets::scheduleOptimizedUpdate): 19 (WebCore::AuthorStyleSheets::didChange): 20 (WebCore::AuthorStyleSheets::optimizedUpdateTimerFired): 21 * dom/AuthorStyleSheets.h: 22 (WebCore::AuthorStyleSheets::hasPendingUpdate): 23 (WebCore::AuthorStyleSheets::pendingUpdateType): Deleted. 24 (WebCore::AuthorStyleSheets::setPendingUpdateType): Deleted. 25 (WebCore::AuthorStyleSheets::flushPendingUpdates): Deleted. 26 * dom/Document.cpp: 27 (WebCore::Document::Document): 28 (WebCore::Document::setContentLanguage): 29 (WebCore::Document::needsStyleRecalc): 30 (WebCore::Document::updateStyleIfNeeded): 31 (WebCore::Document::updateLayoutIgnorePendingStylesheets): 32 (WebCore::Document::didRemoveAllPendingStylesheet): 33 (WebCore::Document::processHttpEquiv): 34 (WebCore::Document::setSelectedStylesheetSet): 35 (WebCore::Document::updateHoverActiveState): 36 (WebCore::Document::optimizedStyleSheetUpdateTimerFired): Deleted. 37 (WebCore::Document::scheduleOptimizedStyleSheetUpdate): Deleted. 38 (WebCore::Document::styleResolverChanged): Deleted. 39 * dom/Document.h: 40 (WebCore::Document::needsStyleRecalc): Deleted. 41 * dom/ExtensionStyleSheets.cpp: 42 (WebCore::ExtensionStyleSheets::clearPageUserSheet): 43 (WebCore::ExtensionStyleSheets::updatePageUserSheet): 44 (WebCore::ExtensionStyleSheets::invalidateInjectedStyleSheetCache): 45 (WebCore::ExtensionStyleSheets::addUserStyleSheet): 46 (WebCore::ExtensionStyleSheets::addAuthorStyleSheetForTesting): 47 (WebCore::ExtensionStyleSheets::styleResolverChangedTimerFired): 48 * dom/InlineStyleSheetOwner.cpp: 49 (WebCore::InlineStyleSheetOwner::removedFromDocument): 50 * dom/ProcessingInstruction.cpp: 51 (WebCore::ProcessingInstruction::removedFrom): 52 53 Also fix a bug that prevented document from rendering if a loading processing instruction was removed from the tree. 54 This is tested by fast/dom/StyleSheet/detached-style-pi-2.xhtml (after other changes in this patch). 55 56 * dom/ShadowRoot.cpp: 57 (WebCore::ShadowRoot::updateStyle): 58 * html/HTMLLinkElement.cpp: 59 (WebCore::HTMLLinkElement::setDisabledState): 60 (WebCore::HTMLLinkElement::parseAttribute): 61 (WebCore::HTMLLinkElement::process): 62 (WebCore::HTMLLinkElement::removedFrom): 63 (WebCore::HTMLLinkElement::removePendingSheet): 64 * html/HTMLStyleElement.cpp: 65 (WebCore::HTMLStyleElement::parseAttribute): 66 * inspector/InspectorCSSAgent.cpp: 67 (WebCore::InspectorCSSAgent::forcePseudoState): 68 (WebCore::InspectorCSSAgent::resetPseudoStates): 69 * inspector/InspectorPageAgent.cpp: 70 (WebCore::InspectorPageAgent::setEmulatedMedia): 71 * page/Frame.cpp: 72 (WebCore::Frame::setPrinting): 73 * page/FrameView.cpp: 74 (WebCore::FrameView::layout): 75 (WebCore::FrameView::setPagination): 76 (WebCore::FrameView::setViewportSizeForCSSViewportUnits): 77 * page/Page.cpp: 78 (WebCore::Page::setViewMode): 79 (WebCore::Page::setNeedsRecalcStyleInAllFrames): 80 (WebCore::Page::invalidateInjectedStyleSheetCacheInAllFrames): 81 * svg/SVGFontFaceElement.cpp: 82 (WebCore::SVGFontFaceElement::rebuildFontFace): 83 (WebCore::SVGFontFaceElement::removedFrom): 84 * xml/XMLTreeViewer.cpp: 85 (WebCore::XMLTreeViewer::transformDocumentToTreeView): 86 * xml/parser/XMLDocumentParser.cpp: 87 (WebCore::XMLDocumentParser::end): 88 * xml/parser/XMLDocumentParserLibxml2.cpp: 89 (WebCore::XMLDocumentParser::doEnd): 90 1 91 2016-09-22 Sergio Villar Senin <svillar@igalia.com> 2 92 -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r206252 r206311 6198 6198 E461802F1C8DD4D20026C02C /* StyleRelations.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E461802E1C8DD4D20026C02C /* StyleRelations.cpp */; }; 6199 6199 E461D65D1BB0C7F000CB5645 /* AuthorStyleSheets.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E461D65C1BB0C7F000CB5645 /* AuthorStyleSheets.cpp */; }; 6200 E461D65F1BB0C80D00CB5645 /* AuthorStyleSheets.h in Headers */ = {isa = PBXBuildFile; fileRef = E461D65E1BB0C80D00CB5645 /* AuthorStyleSheets.h */; };6200 E461D65F1BB0C80D00CB5645 /* AuthorStyleSheets.h in Headers */ = {isa = PBXBuildFile; fileRef = E461D65E1BB0C80D00CB5645 /* AuthorStyleSheets.h */; settings = {ATTRIBUTES = (Private, ); }; }; 6201 6201 E462A4A1113E71BE004A4220 /* IntPointHash.h in Headers */ = {isa = PBXBuildFile; fileRef = E462A4A0113E71BE004A4220 /* IntPointHash.h */; settings = {ATTRIBUTES = (Private, ); }; }; 6202 6202 E46A2B1C17CA65B9000DBCD8 /* TypedElementDescendantIterator.h in Headers */ = {isa = PBXBuildFile; fileRef = E46A2B1B17CA65B9000DBCD8 /* TypedElementDescendantIterator.h */; settings = {ATTRIBUTES = (Private, ); }; }; -
trunk/Source/WebCore/css/CSSStyleSheet.cpp
r205455 r206311 180 180 return; 181 181 } 182 owner-> scheduleOptimizedStyleSheetUpdate();183 return; 184 } 185 186 owner-> styleResolverChanged(DeferRecalcStyle);182 owner->authorStyleSheets().scheduleOptimizedUpdate(); 183 return; 184 } 185 186 owner->authorStyleSheets().didChange(DeferRecalcStyle); 187 187 188 188 m_mutatedRules = true; … … 194 194 if (!owner) 195 195 return; 196 owner-> styleResolverChanged(DeferRecalcStyle);196 owner->authorStyleSheets().didChange(DeferRecalcStyle); 197 197 } 198 198 … … 203 203 if (!owner) 204 204 return; 205 owner-> styleResolverChanged(DeferRecalcStyleIfNeeded);205 owner->authorStyleSheets().didChange(DeferRecalcStyleIfNeeded); 206 206 } 207 207 -
trunk/Source/WebCore/dom/AuthorStyleSheets.cpp
r206167 r206311 58 58 AuthorStyleSheets::AuthorStyleSheets(Document& document) 59 59 : m_document(document) 60 , m_optimizedUpdateTimer(*this, &AuthorStyleSheets::optimizedUpdateTimerFired) 60 61 { 61 62 } … … 64 65 : m_document(shadowRoot.documentScope()) 65 66 , m_shadowRoot(&shadowRoot) 67 , m_optimizedUpdateTimer(*this, &AuthorStyleSheets::optimizedUpdateTimerFired) 66 68 { 67 69 } … … 385 387 } 386 388 387 } 389 void AuthorStyleSheets::flushPendingUpdates() 390 { 391 if (m_pendingUpdateType == NoUpdate) 392 return; 393 updateActiveStyleSheets(m_pendingUpdateType); 394 } 395 396 void AuthorStyleSheets::scheduleOptimizedUpdate() 397 { 398 if (m_optimizedUpdateTimer.isActive()) 399 return; 400 if (m_pendingUpdateType == NoUpdate) 401 m_pendingUpdateType = OptimizedUpdate; 402 m_optimizedUpdateTimer.startOneShot(0); 403 } 404 405 void AuthorStyleSheets::didChange(StyleResolverUpdateFlag updateFlag) 406 { 407 m_optimizedUpdateTimer.stop(); 408 409 // Don't bother updating, since we haven't loaded all our style info yet 410 // and haven't calculated the style resolver for the first time. 411 if (!m_document.hasLivingRenderTree() || (!m_shadowRoot && !m_didCalculateStyleResolver && m_pendingStyleSheetCount)) { 412 m_document.clearStyleResolver(); 413 return; 414 } 415 m_didCalculateStyleResolver = true; 416 417 auto styleSheetUpdate = (updateFlag == RecalcStyleIfNeeded || updateFlag == DeferRecalcStyleIfNeeded) 418 ? AuthorStyleSheets::OptimizedUpdate 419 : AuthorStyleSheets::FullUpdate; 420 bool stylesheetChangeRequiresStyleRecalc = updateActiveStyleSheets(styleSheetUpdate); 421 422 auto scheduleStyleRecalc = [&] { 423 if (m_shadowRoot) 424 m_shadowRoot->setNeedsStyleRecalc(); 425 else 426 m_document.scheduleForcedStyleRecalc(); 427 }; 428 429 if (updateFlag == DeferRecalcStyle) { 430 scheduleStyleRecalc(); 431 return; 432 } 433 434 if (updateFlag == DeferRecalcStyleIfNeeded) { 435 if (stylesheetChangeRequiresStyleRecalc) 436 scheduleStyleRecalc(); 437 return; 438 } 439 440 if (stylesheetChangeRequiresStyleRecalc) 441 m_document.recalcStyle(Style::Force); 442 } 443 444 void AuthorStyleSheets::optimizedUpdateTimerFired() 445 { 446 didChange(RecalcStyleIfNeeded); 447 } 448 449 } -
trunk/Source/WebCore/dom/AuthorStyleSheets.h
r206167 r206311 49 49 class TreeScope; 50 50 51 enum StyleResolverUpdateFlag { 52 RecalcStyleImmediately, 53 DeferRecalcStyle, 54 RecalcStyleIfNeeded, 55 DeferRecalcStyleIfNeeded 56 }; 57 51 58 class AuthorStyleSheets { 52 59 WTF_MAKE_FAST_ALLOCATED; … … 63 70 void removeStyleSheetCandidateNode(Node&); 64 71 65 enum UpdateFlag { NoUpdate = 0, OptimizedUpdate, FullUpdate }; 66 67 UpdateFlag pendingUpdateType() const { return m_pendingUpdateType; } 68 void setPendingUpdateType(UpdateFlag updateType) 69 { 70 if (updateType > m_pendingUpdateType) 71 m_pendingUpdateType = updateType; 72 } 73 74 void flushPendingUpdates() 75 { 76 if (m_pendingUpdateType != NoUpdate) 77 updateActiveStyleSheets(m_pendingUpdateType); 78 } 79 80 bool updateActiveStyleSheets(UpdateFlag); 72 WEBCORE_EXPORT void didChange(StyleResolverUpdateFlag); 81 73 82 74 String preferredStylesheetSetName() const { return m_preferredStylesheetSetName; } … … 100 92 bool activeStyleSheetsContains(const CSSStyleSheet*) const; 101 93 94 void scheduleOptimizedUpdate(); 95 bool hasPendingUpdate() const { return m_optimizedUpdateTimer.isActive(); } 96 void flushPendingUpdates(); 97 102 98 private: 99 enum UpdateFlag { NoUpdate = 0, OptimizedUpdate, FullUpdate }; 100 bool updateActiveStyleSheets(UpdateFlag); 101 103 102 void collectActiveStyleSheets(Vector<RefPtr<StyleSheet>>&); 103 104 104 enum StyleResolverUpdateType { 105 105 Reconstruct, … … 110 110 void updateStyleResolver(Vector<RefPtr<CSSStyleSheet>>&, StyleResolverUpdateType); 111 111 112 void optimizedUpdateTimerFired(); 113 112 114 Document& m_document; 113 115 ShadowRoot* m_shadowRoot { nullptr }; … … 115 117 Vector<RefPtr<StyleSheet>> m_styleSheetsForStyleSheetList; 116 118 Vector<RefPtr<CSSStyleSheet>> m_activeStyleSheets; 119 120 Timer m_optimizedUpdateTimer; 117 121 118 122 // This is a mirror of m_activeAuthorStyleSheets that gets populated on demand for activeStyleSheetsContains(). … … 124 128 // elements and when it is safe to execute scripts. 125 129 int m_pendingStyleSheetCount { 0 }; 130 bool m_didCalculateStyleResolver { false }; 126 131 127 132 UpdateFlag m_pendingUpdateType { NoUpdate }; -
trunk/Source/WebCore/dom/Document.cpp
r206309 r206311 436 436 #endif 437 437 , m_referencingNodeCount(0) 438 , m_didCalculateStyleResolver(false)439 438 , m_hasNodesWithPlaceholderStyle(false) 440 439 , m_needsNotifyRemoveAllPendingStylesheet(false) … … 459 458 , m_readyState(Complete) 460 459 , m_bParsing(false) 461 , m_optimizedStyleSheetUpdateTimer(*this, &Document::optimizedStyleSheetUpdateTimerFired)462 460 , m_styleRecalcTimer(*this, &Document::updateStyleIfNeeded) 463 461 , m_pendingStyleRecalcShouldForce(false) … … 1358 1356 1359 1357 // Recalculate style so language is used when selecting the initial font. 1360 styleResolverChanged(DeferRecalcStyle);1358 m_authorStyleSheets->didChange(DeferRecalcStyle); 1361 1359 } 1362 1360 … … 1946 1944 } 1947 1945 1946 bool Document::needsStyleRecalc() const 1947 { 1948 if (pageCacheState() != NotInPageCache) 1949 return false; 1950 1951 return m_pendingStyleRecalcShouldForce || childNeedsStyleRecalc() || authorStyleSheets().hasPendingUpdate(); 1952 } 1953 1948 1954 void Document::updateStyleIfNeeded() 1949 1955 { … … 1954 1960 return; 1955 1961 1956 if ( m_optimizedStyleSheetUpdateTimer.isActive())1957 styleResolverChanged(RecalcStyleIfNeeded);1962 if (authorStyleSheets().hasPendingUpdate()) 1963 authorStyleSheets().didChange(RecalcStyleIfNeeded); 1958 1964 1959 1965 if (!needsStyleRecalc()) … … 2009 2015 if (bodyElement && !bodyElement->renderer() && m_pendingSheetLayout == NoLayoutWithPendingSheets) { 2010 2016 m_pendingSheetLayout = DidLayoutWithPendingSheets; 2011 styleResolverChanged(RecalcStyleImmediately);2017 authorStyleSheets().didChange(RecalcStyleImmediately); 2012 2018 } else if (m_hasNodesWithPlaceholderStyle) 2013 2019 // If new nodes have been added or style recalc has been done with style sheets still pending, some nodes … … 3146 3152 m_needsNotifyRemoveAllPendingStylesheet = false; 3147 3153 3148 styleResolverChanged(DeferRecalcStyleIfNeeded);3154 authorStyleSheets().didChange(DeferRecalcStyleIfNeeded); 3149 3155 3150 3156 if (m_pendingSheetLayout == DidLayoutWithPendingSheets) { … … 3221 3227 authorStyleSheets().setSelectedStylesheetSetName(content); 3222 3228 authorStyleSheets().setPreferredStylesheetSetName(content); 3223 styleResolverChanged(DeferRecalcStyle);3229 authorStyleSheets().didChange(DeferRecalcStyle); 3224 3230 break; 3225 3231 … … 3525 3531 { 3526 3532 authorStyleSheets().setSelectedStylesheetSetName(aString); 3527 styleResolverChanged(DeferRecalcStyle);3533 authorStyleSheets().didChange(DeferRecalcStyle); 3528 3534 } 3529 3535 … … 3546 3552 for (auto* picture : changedPictures) 3547 3553 picture->sourcesChanged(); 3548 }3549 3550 void Document::optimizedStyleSheetUpdateTimerFired()3551 {3552 styleResolverChanged(RecalcStyleIfNeeded);3553 }3554 3555 void Document::scheduleOptimizedStyleSheetUpdate()3556 {3557 if (m_optimizedStyleSheetUpdateTimer.isActive())3558 return;3559 authorStyleSheets().setPendingUpdateType(AuthorStyleSheets::OptimizedUpdate);3560 m_optimizedStyleSheetUpdateTimer.startOneShot(0);3561 3554 } 3562 3555 … … 3623 3616 for (auto* audioProducer : m_audioProducers) 3624 3617 audioProducer->pageMutedStateDidChange(); 3625 }3626 3627 void Document::styleResolverChanged(StyleResolverUpdateFlag updateFlag)3628 {3629 if (m_optimizedStyleSheetUpdateTimer.isActive())3630 m_optimizedStyleSheetUpdateTimer.stop();3631 3632 // Don't bother updating, since we haven't loaded all our style info yet3633 // and haven't calculated the style selector for the first time.3634 if (!hasLivingRenderTree() || (!m_didCalculateStyleResolver && !haveStylesheetsLoaded())) {3635 m_styleResolver = nullptr;3636 return;3637 }3638 m_didCalculateStyleResolver = true;3639 3640 auto styleSheetUpdate = (updateFlag == RecalcStyleIfNeeded || updateFlag == DeferRecalcStyleIfNeeded)3641 ? AuthorStyleSheets::OptimizedUpdate3642 : AuthorStyleSheets::FullUpdate;3643 bool stylesheetChangeRequiresStyleRecalc = authorStyleSheets().updateActiveStyleSheets(styleSheetUpdate);3644 3645 if (updateFlag == DeferRecalcStyle) {3646 scheduleForcedStyleRecalc();3647 return;3648 }3649 3650 if (updateFlag == DeferRecalcStyleIfNeeded) {3651 if (stylesheetChangeRequiresStyleRecalc)3652 scheduleForcedStyleRecalc();3653 return;3654 }3655 3656 if (stylesheetChangeRequiresStyleRecalc)3657 recalcStyle(Style::Force);3658 3618 } 3659 3619 … … 6646 6606 } 6647 6607 6648 void Document::updateHoverActiveState(const HitTestRequest& request, Element* innerElement , StyleResolverUpdateFlag updateFlag)6608 void Document::updateHoverActiveState(const HitTestRequest& request, Element* innerElement) 6649 6609 { 6650 6610 ASSERT(!request.readOnly()); … … 6763 6723 } 6764 6724 6765 ASSERT(updateFlag == RecalcStyleIfNeeded || updateFlag == DeferRecalcStyleIfNeeded); 6766 if (updateFlag == RecalcStyleIfNeeded) 6767 updateStyleIfNeeded(); 6725 updateStyleIfNeeded(); 6768 6726 } 6769 6727 -
trunk/Source/WebCore/dom/Document.h
r206119 r206311 232 232 }; 233 233 234 enum StyleResolverUpdateFlag { RecalcStyleImmediately, DeferRecalcStyle, RecalcStyleIfNeeded, DeferRecalcStyleIfNeeded };235 236 234 enum NodeListInvalidationType { 237 235 DoNotInvalidateOnAttributeChanges = 0, … … 518 516 void setGotoAnchorNeededAfterStylesheetsLoad(bool b) { m_gotoAnchorNeededAfterStylesheetsLoad = b; } 519 517 520 /**521 * Called when one or more stylesheets in the document may have been added, removed or changed.522 *523 * Creates a new style resolver and assign it to this document. This is done by iterating through all nodes in524 * document (or those before <BODY> in a HTML document), searching for stylesheets. Stylesheets can be contained in525 * <LINK>, <STYLE> or <BODY> elements, as well as processing instructions (XML documents only). A list is526 * constructed from these which is used to create the a new style selector which collates all of the stylesheets527 * found and is used to calculate the derived styles for all rendering objects.528 */529 WEBCORE_EXPORT void styleResolverChanged(StyleResolverUpdateFlag);530 531 void scheduleOptimizedStyleSheetUpdate();532 533 518 void evaluateMediaQueryList(); 534 519 … … 558 543 void recalcStyle(Style::Change = Style::NoChange); 559 544 WEBCORE_EXPORT void updateStyleIfNeeded(); 560 bool needsStyleRecalc() const { return pageCacheState() == NotInPageCache && (m_pendingStyleRecalcShouldForce || childNeedsStyleRecalc() || m_optimizedStyleSheetUpdateTimer.isActive()); }545 bool needsStyleRecalc() const; 561 546 562 547 WEBCORE_EXPORT void updateLayout(); … … 737 722 void elementInActiveChainDidDetach(Element*); 738 723 739 void updateHoverActiveState(const HitTestRequest&, Element* , StyleResolverUpdateFlag = RecalcStyleIfNeeded);724 void updateHoverActiveState(const HitTestRequest&, Element*); 740 725 741 726 // Updates for :target (CSS3 selector). … … 749 734 bool hasPendingStyleRecalc() const; 750 735 bool hasPendingForcedStyleRecalc() const; 751 void optimizedStyleSheetUpdateTimerFired();752 736 753 737 void registerNodeListForInvalidation(LiveNodeList&); … … 1415 1399 std::unique_ptr<StyleResolver> m_styleResolver; 1416 1400 std::unique_ptr<StyleResolver> m_userAgentShadowTreeStyleResolver; 1417 bool m_didCalculateStyleResolver;1418 1401 bool m_hasNodesWithPlaceholderStyle; 1419 1402 bool m_needsNotifyRemoveAllPendingStylesheet; … … 1503 1486 bool m_bParsing; 1504 1487 1505 Timer m_optimizedStyleSheetUpdateTimer;1506 1488 Timer m_styleRecalcTimer; 1507 1489 bool m_pendingStyleRecalcShouldForce; -
trunk/Source/WebCore/dom/ExtensionStyleSheets.cpp
r205455 r206311 29 29 #include "ExtensionStyleSheets.h" 30 30 31 #include "AuthorStyleSheets.h" 31 32 #include "CSSStyleSheet.h" 32 33 #include "Element.h" … … 83 84 if (m_pageUserSheet) { 84 85 m_pageUserSheet = nullptr; 85 m_document. styleResolverChanged(DeferRecalcStyle);86 m_document.authorStyleSheets().didChange(DeferRecalcStyle); 86 87 } 87 88 } … … 91 92 clearPageUserSheet(); 92 93 if (pageUserSheet()) 93 m_document. styleResolverChanged(RecalcStyleImmediately);94 m_document.authorStyleSheets().didChange(RecalcStyleImmediately); 94 95 } 95 96 … … 155 156 if (m_injectedUserStyleSheets.isEmpty() && m_injectedAuthorStyleSheets.isEmpty()) 156 157 return; 157 m_document. styleResolverChanged(DeferRecalcStyle);158 m_document.authorStyleSheets().didChange(DeferRecalcStyle); 158 159 } 159 160 … … 162 163 ASSERT(userSheet.get().isUserStyleSheet()); 163 164 m_userStyleSheets.append(CSSStyleSheet::create(WTFMove(userSheet), m_document)); 164 m_document. styleResolverChanged(RecalcStyleImmediately);165 m_document.authorStyleSheets().didChange(RecalcStyleImmediately); 165 166 } 166 167 … … 169 170 ASSERT(!authorSheet.get().isUserStyleSheet()); 170 171 m_authorStyleSheetsForTesting.append(CSSStyleSheet::create(WTFMove(authorSheet), m_document)); 171 m_document. styleResolverChanged(RecalcStyleImmediately);172 m_document.authorStyleSheets().didChange(RecalcStyleImmediately); 172 173 } 173 174 … … 201 202 void ExtensionStyleSheets::styleResolverChangedTimerFired() 202 203 { 203 m_document. styleResolverChanged(RecalcStyleImmediately);204 m_document.authorStyleSheets().didChange(RecalcStyleImmediately); 204 205 } 205 206 -
trunk/Source/WebCore/dom/InlineStyleSheetOwner.cpp
r204466 r206311 74 74 // If we're in document teardown, then we don't need to do any notification of our sheet's removal. 75 75 if (document.hasLivingRenderTree()) 76 document. styleResolverChanged(DeferRecalcStyle);76 document.authorStyleSheets().didChange(DeferRecalcStyle); 77 77 } 78 78 -
trunk/Source/WebCore/dom/ProcessingInstruction.cpp
r206203 r206311 269 269 m_sheet->clearOwnerNode(); 270 270 m_sheet = nullptr; 271 272 } 273 274 if (m_loading) { 275 m_loading = false; 276 document().authorStyleSheets().removePendingSheet(); 271 277 } 272 278 273 279 // If we're in document teardown, then we don't need to do any notification of our sheet's removal. 274 280 if (document().hasLivingRenderTree()) 275 document(). styleResolverChanged(DeferRecalcStyle);281 document().authorStyleSheets().didChange(DeferRecalcStyle); 276 282 } 277 283 -
trunk/Source/WebCore/dom/ShadowRoot.cpp
r204543 r206311 109 109 void ShadowRoot::updateStyle() 110 110 { 111 bool shouldRecalcStyle = false; 112 113 if (m_authorStyleSheets) { 114 // FIXME: Make optimized updated work. 115 shouldRecalcStyle = m_authorStyleSheets->updateActiveStyleSheets(AuthorStyleSheets::FullUpdate); 116 } 117 118 if (shouldRecalcStyle) 119 setNeedsStyleRecalc(); 111 if (!m_authorStyleSheets) 112 return; 113 // FIXME: Make optimized updated work. 114 m_authorStyleSheets->didChange(DeferRecalcStyle); 120 115 } 121 116 -
trunk/Source/WebCore/html/HTMLLinkElement.cpp
r206016 r206311 141 141 process(); 142 142 else 143 document(). styleResolverChanged(DeferRecalcStyle); // Update the style selector.143 document().authorStyleSheets().didChange(DeferRecalcStyle); 144 144 } 145 145 } … … 177 177 process(); 178 178 if (m_sheet && !isDisabled()) 179 document(). styleResolverChanged(DeferRecalcStyle);179 document().authorStyleSheets().didChange(DeferRecalcStyle); 180 180 return; 181 181 } … … 284 284 // we no longer contain a stylesheet, e.g. perhaps rel or type was changed 285 285 clearSheet(); 286 document(). styleResolverChanged(DeferRecalcStyle);286 document().authorStyleSheets().didChange(DeferRecalcStyle); 287 287 } 288 288 } … … 331 331 332 332 if (document().hasLivingRenderTree()) 333 document(). styleResolverChanged(DeferRecalcStyleIfNeeded);333 document().authorStyleSheets().didChange(DeferRecalcStyleIfNeeded); 334 334 } 335 335 … … 556 556 if (type == InactiveSheet) { 557 557 // Document just needs to know about the sheet for exposure through document.styleSheets 558 document().authorStyleSheets(). updateActiveStyleSheets(AuthorStyleSheets::OptimizedUpdate);558 document().authorStyleSheets().didChange(DeferRecalcStyleIfNeeded); 559 559 return; 560 560 } -
trunk/Source/WebCore/html/HTMLStyleElement.cpp
r202105 r206311 25 25 #include "HTMLStyleElement.h" 26 26 27 #include "AuthorStyleSheets.h" 27 28 #include "Document.h" 28 29 #include "Event.h" … … 78 79 sheet()->setMediaQueries(MediaQuerySet::createAllowingDescriptionSyntax(value)); 79 80 if (inDocument() && document().hasLivingRenderTree()) 80 document(). styleResolverChanged(RecalcStyleImmediately);81 document().authorStyleSheets().didChange(RecalcStyleImmediately); 81 82 } 82 83 } else if (name == typeAttr) -
trunk/Source/WebCore/inspector/InspectorCSSAgent.cpp
r203623 r206311 890 890 else 891 891 m_nodeIdToForcedPseudoState.remove(nodeId); 892 element->document(). styleResolverChanged(RecalcStyleImmediately);892 element->document().authorStyleSheets().didChange(RecalcStyleImmediately); 893 893 } 894 894 … … 1190 1190 m_nodeIdToForcedPseudoState.clear(); 1191 1191 for (auto& document : documentsToChange) 1192 document-> styleResolverChanged(RecalcStyleImmediately);1192 document->authorStyleSheets().didChange(RecalcStyleImmediately); 1193 1193 } 1194 1194 -
trunk/Source/WebCore/inspector/InspectorPageAgent.cpp
r205411 r206311 33 33 #include "InspectorPageAgent.h" 34 34 35 #include "AuthorStyleSheets.h" 35 36 #include "CachedCSSStyleSheet.h" 36 37 #include "CachedFont.h" … … 1002 1003 Document* document = m_page.mainFrame().document(); 1003 1004 if (document) { 1004 document-> styleResolverChanged(RecalcStyleImmediately);1005 document->authorStyleSheets().didChange(RecalcStyleImmediately); 1005 1006 document->updateLayout(); 1006 1007 } -
trunk/Source/WebCore/page/Frame.cpp
r205786 r206311 33 33 #include "AnimationController.h" 34 34 #include "ApplyStyleCommand.h" 35 #include "AuthorStyleSheets.h" 35 36 #include "BackForwardController.h" 36 37 #include "CSSComputedStyleDeclaration.h" … … 644 645 view()->adjustMediaTypeForPrinting(printing); 645 646 646 m_doc-> styleResolverChanged(RecalcStyleImmediately);647 m_doc->authorStyleSheets().didChange(RecalcStyleImmediately); 647 648 if (shouldUsePrintingLayout()) { 648 649 view()->forceLayoutForPagination(pageSize, originalPageSize, maximumShrinkRatio, shouldAdjustViewSize); -
trunk/Source/WebCore/page/FrameView.cpp
r206119 r206311 30 30 #include "AXObjectCache.h" 31 31 #include "AnimationController.h" 32 #include "AuthorStyleSheets.h" 32 33 #include "BackForwardController.h" 33 34 #include "CachedImage.h" … … 1301 1302 if (!styleResolver || styleResolver->hasMediaQueriesAffectedByViewportChange()) { 1302 1303 LOG(Layout, " hasMediaQueriesAffectedByViewportChange, enqueueing style recalc"); 1303 document. styleResolverChanged(DeferRecalcStyle);1304 document.authorStyleSheets().didChange(DeferRecalcStyle); 1304 1305 // FIXME: This instrumentation event is not strictly accurate since cached media query results do not persist across StyleResolver rebuilds. 1305 1306 InspectorInstrumentation::mediaQueryResultChanged(document); … … 3496 3497 m_pagination = pagination; 3497 3498 3498 frame().document()-> styleResolverChanged(DeferRecalcStyle);3499 frame().document()->authorStyleSheets().didChange(DeferRecalcStyle); 3499 3500 } 3500 3501 … … 4965 4966 // FIXME: this should probably be updateViewportUnitsOnResize(), but synchronously 4966 4967 // dirtying style here causes assertions on iOS (rdar://problem/19998166). 4967 document-> styleResolverChanged(DeferRecalcStyle);4968 document->authorStyleSheets().didChange(DeferRecalcStyle); 4968 4969 } 4969 4970 } -
trunk/Source/WebCore/page/Page.cpp
r205805 r206311 24 24 #include "AnimationController.h" 25 25 #include "ApplicationCacheStorage.h" 26 #include "AuthorStyleSheets.h" 26 27 #include "BackForwardClient.h" 27 28 #include "BackForwardController.h" … … 423 424 424 425 if (m_mainFrame->document()) 425 m_mainFrame->document()-> styleResolverChanged(RecalcStyleImmediately);426 m_mainFrame->document()->authorStyleSheets().didChange(RecalcStyleImmediately); 426 427 } 427 428 #endif // ENABLE(VIEW_MODE_CSS_MEDIA) … … 501 502 for (Frame* frame = &mainFrame(); frame; frame = frame->tree().traverseNext()) { 502 503 if (Document* document = frame->document()) 503 document-> styleResolverChanged(DeferRecalcStyle);504 document->authorStyleSheets().didChange(DeferRecalcStyle); 504 505 } 505 506 } … … 1162 1163 continue; 1163 1164 document->extensionStyleSheets().invalidateInjectedStyleSheetCache(); 1164 document-> styleResolverChanged(DeferRecalcStyle);1165 document->authorStyleSheets().didChange(DeferRecalcStyle); 1165 1166 } 1166 1167 } -
trunk/Source/WebCore/svg/SVGFontFaceElement.cpp
r205660 r206311 25 25 #include "SVGFontFaceElement.h" 26 26 27 #include "AuthorStyleSheets.h" 27 28 #include "CSSFontFaceSrcValue.h" 28 29 #include "CSSParser.h" … … 267 268 } 268 269 269 document(). styleResolverChanged(DeferRecalcStyle);270 document().authorStyleSheets().didChange(DeferRecalcStyle); 270 271 } 271 272 … … 292 293 m_fontFaceRule->mutableProperties().clear(); 293 294 294 document(). styleResolverChanged(DeferRecalcStyle);295 document().authorStyleSheets().didChange(DeferRecalcStyle); 295 296 } else 296 297 ASSERT(!m_fontElement); -
trunk/Source/WebCore/xml/XMLTreeViewer.cpp
r200696 r206311 33 33 #if ENABLE(XSLT) 34 34 35 #include "AuthorStyleSheets.h" 35 36 #include "Document.h" 36 37 #include "Element.h" … … 64 65 auto text = m_document.createTextNode(cssString); 65 66 m_document.getElementById(String(ASCIILiteral("xml-viewer-style")))->appendChild(text, IGNORE_EXCEPTION); 66 m_document. styleResolverChanged(RecalcStyleImmediately);67 m_document.authorStyleSheets().didChange(RecalcStyleImmediately); 67 68 } 68 69 -
trunk/Source/WebCore/xml/parser/XMLDocumentParser.cpp
r200895 r206311 27 27 #include "XMLDocumentParser.h" 28 28 29 #include "AuthorStyleSheets.h" 29 30 #include "CDATASection.h" 30 31 #include "CachedScript.h" … … 200 201 else { 201 202 updateLeafTextNode(); 202 document()-> styleResolverChanged(RecalcStyleImmediately);203 document()->authorStyleSheets().didChange(RecalcStyleImmediately); 203 204 } 204 205 -
trunk/Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp
r206118 r206311 29 29 #include "XMLDocumentParser.h" 30 30 31 #include "AuthorStyleSheets.h" 31 32 #include "CDATASection.h" 32 33 #include "CachedScript.h" … … 1387 1388 1388 1389 document()->setParsing(false); // Make the document think it's done, so it will apply XSL stylesheets. 1389 document()-> styleResolverChanged(RecalcStyleImmediately);1390 document()->authorStyleSheets().didChange(RecalcStyleImmediately); 1390 1391 1391 1392 // styleResolverChanged() call can detach the parser and null out its document. -
trunk/Source/WebKit/mac/WebView/WebHTMLView.mm
r205858 r206311 73 73 #import "WebUIDelegatePrivate.h" 74 74 #import "WebViewInternal.h" 75 #import <WebCore/AuthorStyleSheets.h> 75 76 #import <WebCore/CSSStyleDeclaration.h> 76 77 #import <WebCore/CachedImage.h> … … 3612 3613 3613 3614 if (Frame* coreFrame = core([self _frame])) 3614 coreFrame->document()-> styleResolverChanged(RecalcStyleImmediately);3615 coreFrame->document()->authorStyleSheets().didChange(RecalcStyleImmediately); 3615 3616 3616 3617 #ifdef LOG_TIMES … … 5005 5006 document->setPaginatedForScreen(_private->paginateScreenContent); 5006 5007 document->setPrinting(_private->printing); 5007 document-> styleResolverChanged(RecalcStyleImmediately);5008 document->authorStyleSheets().didChange(RecalcStyleImmediately); 5008 5009 } 5009 5010 }
Note:
See TracChangeset
for help on using the changeset viewer.