Changeset 153872 in webkit
- Timestamp:
- Aug 8, 2013, 5:47:36 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r153867 r153872 1 2013-08-08 Simon Fraser <simon.fraser@apple.com> 2 3 Kill updateStyleForAllDocuments() 4 https://bugs.webkit.org/show_bug.cgi?id=118093 5 6 Reviewed by Geoff Garen. 7 8 We should never have to eagerly update style, especially for all documents 9 that the process knows about. The WebKit model is to update style when 10 required for layout etc, not to update it eagerly. 11 12 This is historical code whose origins are lost in the mists of KHTML. 13 r42384 makes it possible to do away with this eager updating, and 14 r55568 removed some calls. Discussion in bug 32580 suggests that 15 form control code still need this, but tests still pass without it. 16 17 * bindings/js/JSCallbackData.cpp: 18 (WebCore::JSCallbackData::invokeCallback): 19 * bindings/js/JSCustomXPathNSResolver.cpp: 20 (WebCore::JSCustomXPathNSResolver::lookupNamespaceURI): 21 * dom/Document.cpp: 22 (WebCore::Document::scheduleStyleRecalc): 23 (WebCore::Document::unscheduleStyleRecalc): 24 * dom/Document.h: 25 * dom/Element.cpp: 26 (WebCore::Element::setActive): 27 1 28 2013-08-08 Jer Noble <jer.noble@apple.com> 2 29 -
trunk/Source/WebCore/bindings/js/JSCallbackData.cpp
r148119 r153872 73 73 InspectorInstrumentationCookie cookie = JSMainThreadExecState::instrumentFunctionCall(context, callType, callData); 74 74 75 bool contextIsDocument = context->isDocument(); 76 JSValue result = contextIsDocument 75 JSValue result = context->isDocument() 77 76 ? JSMainThreadExecState::call(exec, function, callType, callData, thisValue, args) 78 77 : JSC::call(exec, function, callType, callData, thisValue, args); 79 78 80 79 InspectorInstrumentation::didCallFunction(cookie); 81 82 if (contextIsDocument)83 Document::updateStyleForAllDocuments();84 80 85 81 if (exec->hadException()) { -
trunk/Source/WebCore/bindings/js/JSCustomXPathNSResolver.cpp
r149125 r153872 102 102 } 103 103 104 Document::updateStyleForAllDocuments();105 106 104 return result; 107 105 } -
trunk/Source/WebCore/dom/Document.cpp
r153829 r153872 380 380 } 381 381 382 static HashSet<Document*>* documentsThatNeedStyleRecalc = 0;383 384 382 uint64_t Document::s_globalTreeVersion = 0; 385 383 … … 1701 1699 ASSERT(childNeedsStyleRecalc() || m_pendingStyleRecalcShouldForce); 1702 1700 1703 if (!documentsThatNeedStyleRecalc)1704 documentsThatNeedStyleRecalc = new HashSet<Document*>;1705 documentsThatNeedStyleRecalc->add(this);1706 1707 1701 // FIXME: Why on earth is this here? This is clearly misplaced. 1708 1702 invalidateAccessKeyMap(); … … 1716 1710 { 1717 1711 ASSERT(!childNeedsStyleRecalc()); 1718 1719 if (documentsThatNeedStyleRecalc)1720 documentsThatNeedStyleRecalc->remove(this);1721 1712 1722 1713 m_styleRecalcTimer.stop(); … … 1855 1846 AnimationUpdateBlock animationUpdateBlock(m_frame ? m_frame->animation() : 0); 1856 1847 recalcStyle(Style::NoChange); 1857 }1858 1859 void Document::updateStyleForAllDocuments()1860 {1861 ASSERT(isMainThread());1862 if (!documentsThatNeedStyleRecalc)1863 return;1864 1865 while (documentsThatNeedStyleRecalc->size()) {1866 HashSet<Document*>::iterator it = documentsThatNeedStyleRecalc->begin();1867 Document* doc = *it;1868 documentsThatNeedStyleRecalc->remove(doc);1869 doc->updateStyleIfNeeded();1870 }1871 1848 } 1872 1849 -
trunk/Source/WebCore/dom/Document.h
r153829 r153872 526 526 void pageSizeAndMarginsInPixels(int pageIndex, IntSize& pageSize, int& marginTop, int& marginRight, int& marginBottom, int& marginLeft); 527 527 528 static void updateStyleForAllDocuments(); // FIXME: Try to reduce the # of calls to this function.529 528 CachedResourceLoader* cachedResourceLoader() { return m_cachedResourceLoader.get(); } 530 529 -
trunk/Source/WebCore/dom/Element.cpp
r153835 r153872 486 486 #endif 487 487 488 Document::updateStyleForAllDocuments(); 488 document()->updateStyleIfNeeded(); 489 489 490 // Do an immediate repaint. 490 491 if (renderer())
Note:
See TracChangeset
for help on using the changeset viewer.