OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All |
7 * rights reserved. | 7 * rights reserved. |
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. | 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. |
9 * (http://www.torchmobile.com/) | 9 * (http://www.torchmobile.com/) |
10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. | 10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. |
(...skipping 1549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1560 if (layoutViewItem().wasNotifiedOfSubtreeChange()) | 1560 if (layoutViewItem().wasNotifiedOfSubtreeChange()) |
1561 return true; | 1561 return true; |
1562 return false; | 1562 return false; |
1563 } | 1563 } |
1564 | 1564 |
1565 bool Document::needsFullLayoutTreeUpdate() const { | 1565 bool Document::needsFullLayoutTreeUpdate() const { |
1566 if (!isActive() || !view()) | 1566 if (!isActive() || !view()) |
1567 return false; | 1567 return false; |
1568 if (!m_useElementsNeedingUpdate.isEmpty()) | 1568 if (!m_useElementsNeedingUpdate.isEmpty()) |
1569 return true; | 1569 return true; |
1570 if (!m_layerUpdateSVGFilterElements.isEmpty()) | |
1571 return true; | |
1572 if (needsStyleRecalc()) | 1570 if (needsStyleRecalc()) |
1573 return true; | 1571 return true; |
1574 if (needsStyleInvalidation()) | 1572 if (needsStyleInvalidation()) |
1575 return true; | 1573 return true; |
1576 // FIXME: The childNeedsDistributionRecalc bit means either self or children, | 1574 // FIXME: The childNeedsDistributionRecalc bit means either self or children, |
1577 // we should fix that. | 1575 // we should fix that. |
1578 if (childNeedsDistributionRecalc()) | 1576 if (childNeedsDistributionRecalc()) |
1579 return true; | 1577 return true; |
1580 if (DocumentAnimations::needsAnimationTimingUpdate(*this)) | 1578 if (DocumentAnimations::needsAnimationTimingUpdate(*this)) |
1581 return true; | 1579 return true; |
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1952 clearNeedsReattachLayoutTree(); | 1950 clearNeedsReattachLayoutTree(); |
1953 | 1951 |
1954 StyleResolver& resolver = ensureStyleResolver(); | 1952 StyleResolver& resolver = ensureStyleResolver(); |
1955 | 1953 |
1956 bool shouldRecordStats; | 1954 bool shouldRecordStats; |
1957 TRACE_EVENT_CATEGORY_GROUP_ENABLED("blink,blink_style", &shouldRecordStats); | 1955 TRACE_EVENT_CATEGORY_GROUP_ENABLED("blink,blink_style", &shouldRecordStats); |
1958 styleEngine().setStatsEnabled(shouldRecordStats); | 1956 styleEngine().setStatsEnabled(shouldRecordStats); |
1959 | 1957 |
1960 if (Element* documentElement = this->documentElement()) { | 1958 if (Element* documentElement = this->documentElement()) { |
1961 inheritHtmlAndBodyElementStyles(change); | 1959 inheritHtmlAndBodyElementStyles(change); |
1962 dirtyElementsForLayerUpdate(); | |
1963 if (documentElement->shouldCallRecalcStyle(change)) | 1960 if (documentElement->shouldCallRecalcStyle(change)) |
1964 documentElement->recalcStyle(change); | 1961 documentElement->recalcStyle(change); |
1965 while (dirtyElementsForLayerUpdate()) | |
1966 documentElement->recalcStyle(NoChange); | |
1967 } | 1962 } |
1968 | 1963 |
1969 view()->recalcOverflowAfterStyleChange(); | 1964 view()->recalcOverflowAfterStyleChange(); |
1970 | 1965 |
1971 // Only retain the HashMap for the duration of StyleRecalc and | 1966 // Only retain the HashMap for the duration of StyleRecalc and |
1972 // LayoutTreeConstruction. | 1967 // LayoutTreeConstruction. |
1973 m_nonAttachedStyle.clear(); | 1968 m_nonAttachedStyle.clear(); |
1974 clearChildNeedsStyleRecalc(); | 1969 clearChildNeedsStyleRecalc(); |
1975 clearChildNeedsReattachLayoutTree(); | 1970 clearChildNeedsReattachLayoutTree(); |
1976 | 1971 |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2234 | 2229 |
2235 void Document::setIsViewSource(bool isViewSource) { | 2230 void Document::setIsViewSource(bool isViewSource) { |
2236 m_isViewSource = isViewSource; | 2231 m_isViewSource = isViewSource; |
2237 if (!m_isViewSource) | 2232 if (!m_isViewSource) |
2238 return; | 2233 return; |
2239 | 2234 |
2240 setSecurityOrigin(SecurityOrigin::createUnique()); | 2235 setSecurityOrigin(SecurityOrigin::createUnique()); |
2241 didUpdateSecurityOrigin(); | 2236 didUpdateSecurityOrigin(); |
2242 } | 2237 } |
2243 | 2238 |
2244 bool Document::dirtyElementsForLayerUpdate() { | |
2245 if (m_layerUpdateSVGFilterElements.isEmpty()) | |
2246 return false; | |
2247 | |
2248 for (Element* element : m_layerUpdateSVGFilterElements) | |
2249 element->setNeedsStyleRecalc(LocalStyleChange, | |
2250 StyleChangeReasonForTracing::create( | |
2251 StyleChangeReason::SVGFilterLayerUpdate)); | |
2252 m_layerUpdateSVGFilterElements.clear(); | |
2253 return true; | |
2254 } | |
2255 | |
2256 void Document::scheduleSVGFilterLayerUpdateHack(Element& element) { | |
2257 if (element.getStyleChangeType() == NeedsReattachStyleChange) | |
2258 return; | |
2259 element.setSVGFilterNeedsLayerUpdate(); | |
2260 m_layerUpdateSVGFilterElements.add(&element); | |
2261 scheduleLayoutTreeUpdateIfNeeded(); | |
2262 } | |
2263 | |
2264 void Document::unscheduleSVGFilterLayerUpdateHack(Element& element) { | |
2265 element.clearSVGFilterNeedsLayerUpdate(); | |
2266 m_layerUpdateSVGFilterElements.remove(&element); | |
2267 } | |
2268 | |
2269 void Document::scheduleUseShadowTreeUpdate(SVGUseElement& element) { | 2239 void Document::scheduleUseShadowTreeUpdate(SVGUseElement& element) { |
2270 m_useElementsNeedingUpdate.add(&element); | 2240 m_useElementsNeedingUpdate.add(&element); |
2271 scheduleLayoutTreeUpdateIfNeeded(); | 2241 scheduleLayoutTreeUpdateIfNeeded(); |
2272 } | 2242 } |
2273 | 2243 |
2274 void Document::unscheduleUseShadowTreeUpdate(SVGUseElement& element) { | 2244 void Document::unscheduleUseShadowTreeUpdate(SVGUseElement& element) { |
2275 m_useElementsNeedingUpdate.remove(&element); | 2245 m_useElementsNeedingUpdate.remove(&element); |
2276 } | 2246 } |
2277 | 2247 |
2278 void Document::updateUseShadowTreesIfNeeded() { | 2248 void Document::updateUseShadowTreesIfNeeded() { |
(...skipping 4105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6384 visitor->trace(m_styleSheetList); | 6354 visitor->trace(m_styleSheetList); |
6385 visitor->trace(m_documentTiming); | 6355 visitor->trace(m_documentTiming); |
6386 visitor->trace(m_mediaQueryMatcher); | 6356 visitor->trace(m_mediaQueryMatcher); |
6387 visitor->trace(m_scriptedAnimationController); | 6357 visitor->trace(m_scriptedAnimationController); |
6388 visitor->trace(m_scriptedIdleTaskController); | 6358 visitor->trace(m_scriptedIdleTaskController); |
6389 visitor->trace(m_textAutosizer); | 6359 visitor->trace(m_textAutosizer); |
6390 visitor->trace(m_registrationContext); | 6360 visitor->trace(m_registrationContext); |
6391 visitor->trace(m_customElementMicrotaskRunQueue); | 6361 visitor->trace(m_customElementMicrotaskRunQueue); |
6392 visitor->trace(m_elementDataCache); | 6362 visitor->trace(m_elementDataCache); |
6393 visitor->trace(m_useElementsNeedingUpdate); | 6363 visitor->trace(m_useElementsNeedingUpdate); |
6394 visitor->trace(m_layerUpdateSVGFilterElements); | |
6395 visitor->trace(m_timers); | 6364 visitor->trace(m_timers); |
6396 visitor->trace(m_templateDocument); | 6365 visitor->trace(m_templateDocument); |
6397 visitor->trace(m_templateDocumentHost); | 6366 visitor->trace(m_templateDocumentHost); |
6398 visitor->trace(m_userActionElements); | 6367 visitor->trace(m_userActionElements); |
6399 visitor->trace(m_svgExtensions); | 6368 visitor->trace(m_svgExtensions); |
6400 visitor->trace(m_timeline); | 6369 visitor->trace(m_timeline); |
6401 visitor->trace(m_compositorPendingAnimations); | 6370 visitor->trace(m_compositorPendingAnimations); |
6402 visitor->trace(m_contextDocument); | 6371 visitor->trace(m_contextDocument); |
6403 visitor->trace(m_canvasFontCache); | 6372 visitor->trace(m_canvasFontCache); |
6404 visitor->trace(m_intersectionObserverController); | 6373 visitor->trace(m_intersectionObserverController); |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6454 } | 6423 } |
6455 | 6424 |
6456 void showLiveDocumentInstances() { | 6425 void showLiveDocumentInstances() { |
6457 WeakDocumentSet& set = liveDocumentSet(); | 6426 WeakDocumentSet& set = liveDocumentSet(); |
6458 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); | 6427 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); |
6459 for (Document* document : set) | 6428 for (Document* document : set) |
6460 fprintf(stderr, "- Document %p URL: %s\n", document, | 6429 fprintf(stderr, "- Document %p URL: %s\n", document, |
6461 document->url().getString().utf8().data()); | 6430 document->url().getString().utf8().data()); |
6462 } | 6431 } |
6463 #endif | 6432 #endif |
OLD | NEW |