Changeset 207717 in webkit
- Timestamp:
- Oct 22, 2016 2:27:53 PM (7 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r207716 r207717 1 2016-10-22 Antti Koivisto <antti@apple.com> 2 3 REGRESSION(r207669): Dromaeo/jslib-style-jquery.html regressed >20% 4 https://bugs.webkit.org/show_bug.cgi?id=163851 5 6 Reviewed by Darin Adler. 7 8 The test calls Scope::flushPendingUpdate a lot and nothing ever happens there. 9 10 Add a separate invalidity bit for descendant scopes and inline the fast path. 11 12 * style/StyleScope.cpp: 13 (WebCore::Style::Scope::flushPendingSelfUpdate): 14 (WebCore::Style::Scope::flushPendingDescendantUpdates): 15 (WebCore::Style::Scope::scheduleUpdate): 16 (WebCore::Style::Scope::flushPendingUpdate): Deleted. 17 * style/StyleScope.h: 18 (WebCore::Style::Scope::hasPendingUpdate): 19 (WebCore::Style::Scope::flushPendingUpdate): 20 1 21 2016-10-22 Darin Adler <darin@apple.com> 2 22 -
trunk/Source/WebCore/style/StyleScope.cpp
r207669 r207717 468 468 } 469 469 470 void Scope::flushPendingUpdate() 471 { 472 if (!m_shadowRoot) { 473 for (auto* descendantShadowRoot : m_document.inDocumentShadowRoots()) 474 descendantShadowRoot->styleScope().flushPendingUpdate(); 475 } 476 if (!m_pendingUpdate) 477 return; 470 void Scope::flushPendingSelfUpdate() 471 { 472 ASSERT(m_pendingUpdate); 473 478 474 auto updateType = *m_pendingUpdate; 479 475 480 476 clearPendingUpdate(); 481 482 477 updateActiveStyleSheets(updateType); 478 } 479 480 void Scope::flushPendingDescendantUpdates() 481 { 482 ASSERT(m_hasDescendantWithPendingUpdate); 483 ASSERT(!m_shadowRoot); 484 for (auto* descendantShadowRoot : m_document.inDocumentShadowRoots()) 485 descendantShadowRoot->styleScope().flushPendingUpdate(); 486 m_hasDescendantWithPendingUpdate = false; 483 487 } 484 488 … … 491 495 void Scope::scheduleUpdate(UpdateType update) 492 496 { 493 if (!m_pendingUpdate || *m_pendingUpdate < update) 497 if (!m_pendingUpdate || *m_pendingUpdate < update) { 494 498 m_pendingUpdate = update; 499 if (m_shadowRoot) 500 m_document.styleScope().m_hasDescendantWithPendingUpdate = true; 501 } 495 502 496 503 if (m_pendingUpdateTimer.isActive()) -
trunk/Source/WebCore/style/StyleScope.h
r207669 r207717 93 93 WEBCORE_EXPORT void didChangeStyleSheetEnvironment(); 94 94 95 bool hasPendingUpdate() const { return !!m_pendingUpdate; }96 WEBCORE_EXPORTvoid flushPendingUpdate();95 bool hasPendingUpdate() const { return m_pendingUpdate || m_hasDescendantWithPendingUpdate; } 96 void flushPendingUpdate(); 97 97 98 98 StyleResolver& resolver(); … … 108 108 void updateActiveStyleSheets(UpdateType); 109 109 void scheduleUpdate(UpdateType); 110 111 WEBCORE_EXPORT void flushPendingSelfUpdate(); 112 WEBCORE_EXPORT void flushPendingDescendantUpdates(); 110 113 111 114 void collectActiveStyleSheets(Vector<RefPtr<StyleSheet>>&); … … 142 145 143 146 Optional<UpdateType> m_pendingUpdate; 147 bool m_hasDescendantWithPendingUpdate { false }; 144 148 145 149 ListHashSet<Node*> m_styleSheetCandidateNodes; … … 151 155 }; 152 156 157 inline void Scope::flushPendingUpdate() 158 { 159 if (m_hasDescendantWithPendingUpdate) 160 flushPendingDescendantUpdates(); 161 if (m_pendingUpdate) 162 flushPendingSelfUpdate(); 163 } 164 153 165 } 154 166 }
Note: See TracChangeset
for help on using the changeset viewer.