| 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 1550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1561 if (layoutViewItem().wasNotifiedOfSubtreeChange()) | 1561 if (layoutViewItem().wasNotifiedOfSubtreeChange()) |
| 1562 return true; | 1562 return true; |
| 1563 return false; | 1563 return false; |
| 1564 } | 1564 } |
| 1565 | 1565 |
| 1566 bool Document::needsFullLayoutTreeUpdate() const { | 1566 bool Document::needsFullLayoutTreeUpdate() const { |
| 1567 if (!isActive() || !view()) | 1567 if (!isActive() || !view()) |
| 1568 return false; | 1568 return false; |
| 1569 if (!m_useElementsNeedingUpdate.isEmpty()) | 1569 if (!m_useElementsNeedingUpdate.isEmpty()) |
| 1570 return true; | 1570 return true; |
| 1571 if (!m_layerUpdateSVGFilterElements.isEmpty()) |
| 1572 return true; |
| 1571 if (needsStyleRecalc()) | 1573 if (needsStyleRecalc()) |
| 1572 return true; | 1574 return true; |
| 1573 if (needsStyleInvalidation()) | 1575 if (needsStyleInvalidation()) |
| 1574 return true; | 1576 return true; |
| 1575 // FIXME: The childNeedsDistributionRecalc bit means either self or children, | 1577 // FIXME: The childNeedsDistributionRecalc bit means either self or children, |
| 1576 // we should fix that. | 1578 // we should fix that. |
| 1577 if (childNeedsDistributionRecalc()) | 1579 if (childNeedsDistributionRecalc()) |
| 1578 return true; | 1580 return true; |
| 1579 if (DocumentAnimations::needsAnimationTimingUpdate(*this)) | 1581 if (DocumentAnimations::needsAnimationTimingUpdate(*this)) |
| 1580 return true; | 1582 return true; |
| (...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1951 clearNeedsReattachLayoutTree(); | 1953 clearNeedsReattachLayoutTree(); |
| 1952 | 1954 |
| 1953 StyleResolver& resolver = ensureStyleResolver(); | 1955 StyleResolver& resolver = ensureStyleResolver(); |
| 1954 | 1956 |
| 1955 bool shouldRecordStats; | 1957 bool shouldRecordStats; |
| 1956 TRACE_EVENT_CATEGORY_GROUP_ENABLED("blink,blink_style", &shouldRecordStats); | 1958 TRACE_EVENT_CATEGORY_GROUP_ENABLED("blink,blink_style", &shouldRecordStats); |
| 1957 styleEngine().setStatsEnabled(shouldRecordStats); | 1959 styleEngine().setStatsEnabled(shouldRecordStats); |
| 1958 | 1960 |
| 1959 if (Element* documentElement = this->documentElement()) { | 1961 if (Element* documentElement = this->documentElement()) { |
| 1960 inheritHtmlAndBodyElementStyles(change); | 1962 inheritHtmlAndBodyElementStyles(change); |
| 1963 dirtyElementsForLayerUpdate(); |
| 1961 if (documentElement->shouldCallRecalcStyle(change)) | 1964 if (documentElement->shouldCallRecalcStyle(change)) |
| 1962 documentElement->recalcStyle(change); | 1965 documentElement->recalcStyle(change); |
| 1966 while (dirtyElementsForLayerUpdate()) |
| 1967 documentElement->recalcStyle(NoChange); |
| 1963 } | 1968 } |
| 1964 | 1969 |
| 1965 view()->recalcOverflowAfterStyleChange(); | 1970 view()->recalcOverflowAfterStyleChange(); |
| 1966 | 1971 |
| 1967 // Only retain the HashMap for the duration of StyleRecalc and | 1972 // Only retain the HashMap for the duration of StyleRecalc and |
| 1968 // LayoutTreeConstruction. | 1973 // LayoutTreeConstruction. |
| 1969 m_nonAttachedStyle.clear(); | 1974 m_nonAttachedStyle.clear(); |
| 1970 clearChildNeedsStyleRecalc(); | 1975 clearChildNeedsStyleRecalc(); |
| 1971 clearChildNeedsReattachLayoutTree(); | 1976 clearChildNeedsReattachLayoutTree(); |
| 1972 | 1977 |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2230 | 2235 |
| 2231 void Document::setIsViewSource(bool isViewSource) { | 2236 void Document::setIsViewSource(bool isViewSource) { |
| 2232 m_isViewSource = isViewSource; | 2237 m_isViewSource = isViewSource; |
| 2233 if (!m_isViewSource) | 2238 if (!m_isViewSource) |
| 2234 return; | 2239 return; |
| 2235 | 2240 |
| 2236 setSecurityOrigin(SecurityOrigin::createUnique()); | 2241 setSecurityOrigin(SecurityOrigin::createUnique()); |
| 2237 didUpdateSecurityOrigin(); | 2242 didUpdateSecurityOrigin(); |
| 2238 } | 2243 } |
| 2239 | 2244 |
| 2245 bool Document::dirtyElementsForLayerUpdate() { |
| 2246 if (m_layerUpdateSVGFilterElements.isEmpty()) |
| 2247 return false; |
| 2248 |
| 2249 for (Element* element : m_layerUpdateSVGFilterElements) |
| 2250 element->setNeedsStyleRecalc(LocalStyleChange, |
| 2251 StyleChangeReasonForTracing::create( |
| 2252 StyleChangeReason::SVGFilterLayerUpdate)); |
| 2253 m_layerUpdateSVGFilterElements.clear(); |
| 2254 return true; |
| 2255 } |
| 2256 |
| 2257 void Document::scheduleSVGFilterLayerUpdateHack(Element& element) { |
| 2258 if (element.getStyleChangeType() == NeedsReattachStyleChange) |
| 2259 return; |
| 2260 element.setSVGFilterNeedsLayerUpdate(); |
| 2261 m_layerUpdateSVGFilterElements.add(&element); |
| 2262 scheduleLayoutTreeUpdateIfNeeded(); |
| 2263 } |
| 2264 |
| 2265 void Document::unscheduleSVGFilterLayerUpdateHack(Element& element) { |
| 2266 element.clearSVGFilterNeedsLayerUpdate(); |
| 2267 m_layerUpdateSVGFilterElements.remove(&element); |
| 2268 } |
| 2269 |
| 2240 void Document::scheduleUseShadowTreeUpdate(SVGUseElement& element) { | 2270 void Document::scheduleUseShadowTreeUpdate(SVGUseElement& element) { |
| 2241 m_useElementsNeedingUpdate.add(&element); | 2271 m_useElementsNeedingUpdate.add(&element); |
| 2242 scheduleLayoutTreeUpdateIfNeeded(); | 2272 scheduleLayoutTreeUpdateIfNeeded(); |
| 2243 } | 2273 } |
| 2244 | 2274 |
| 2245 void Document::unscheduleUseShadowTreeUpdate(SVGUseElement& element) { | 2275 void Document::unscheduleUseShadowTreeUpdate(SVGUseElement& element) { |
| 2246 m_useElementsNeedingUpdate.remove(&element); | 2276 m_useElementsNeedingUpdate.remove(&element); |
| 2247 } | 2277 } |
| 2248 | 2278 |
| 2249 void Document::updateUseShadowTreesIfNeeded() { | 2279 void Document::updateUseShadowTreesIfNeeded() { |
| (...skipping 4128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6378 visitor->trace(m_styleSheetList); | 6408 visitor->trace(m_styleSheetList); |
| 6379 visitor->trace(m_documentTiming); | 6409 visitor->trace(m_documentTiming); |
| 6380 visitor->trace(m_mediaQueryMatcher); | 6410 visitor->trace(m_mediaQueryMatcher); |
| 6381 visitor->trace(m_scriptedAnimationController); | 6411 visitor->trace(m_scriptedAnimationController); |
| 6382 visitor->trace(m_scriptedIdleTaskController); | 6412 visitor->trace(m_scriptedIdleTaskController); |
| 6383 visitor->trace(m_textAutosizer); | 6413 visitor->trace(m_textAutosizer); |
| 6384 visitor->trace(m_registrationContext); | 6414 visitor->trace(m_registrationContext); |
| 6385 visitor->trace(m_customElementMicrotaskRunQueue); | 6415 visitor->trace(m_customElementMicrotaskRunQueue); |
| 6386 visitor->trace(m_elementDataCache); | 6416 visitor->trace(m_elementDataCache); |
| 6387 visitor->trace(m_useElementsNeedingUpdate); | 6417 visitor->trace(m_useElementsNeedingUpdate); |
| 6418 visitor->trace(m_layerUpdateSVGFilterElements); |
| 6388 visitor->trace(m_timers); | 6419 visitor->trace(m_timers); |
| 6389 visitor->trace(m_templateDocument); | 6420 visitor->trace(m_templateDocument); |
| 6390 visitor->trace(m_templateDocumentHost); | 6421 visitor->trace(m_templateDocumentHost); |
| 6391 visitor->trace(m_userActionElements); | 6422 visitor->trace(m_userActionElements); |
| 6392 visitor->trace(m_svgExtensions); | 6423 visitor->trace(m_svgExtensions); |
| 6393 visitor->trace(m_timeline); | 6424 visitor->trace(m_timeline); |
| 6394 visitor->trace(m_compositorPendingAnimations); | 6425 visitor->trace(m_compositorPendingAnimations); |
| 6395 visitor->trace(m_contextDocument); | 6426 visitor->trace(m_contextDocument); |
| 6396 visitor->trace(m_canvasFontCache); | 6427 visitor->trace(m_canvasFontCache); |
| 6397 visitor->trace(m_intersectionObserverController); | 6428 visitor->trace(m_intersectionObserverController); |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6447 } | 6478 } |
| 6448 | 6479 |
| 6449 void showLiveDocumentInstances() { | 6480 void showLiveDocumentInstances() { |
| 6450 WeakDocumentSet& set = liveDocumentSet(); | 6481 WeakDocumentSet& set = liveDocumentSet(); |
| 6451 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); | 6482 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); |
| 6452 for (Document* document : set) | 6483 for (Document* document : set) |
| 6453 fprintf(stderr, "- Document %p URL: %s\n", document, | 6484 fprintf(stderr, "- Document %p URL: %s\n", document, |
| 6454 document->url().getString().utf8().data()); | 6485 document->url().getString().utf8().data()); |
| 6455 } | 6486 } |
| 6456 #endif | 6487 #endif |
| OLD | NEW |