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 1269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1280 | 1280 |
1281 return documentElement(); | 1281 return documentElement(); |
1282 } | 1282 } |
1283 | 1283 |
1284 return body(); | 1284 return body(); |
1285 } | 1285 } |
1286 | 1286 |
1287 // We use HashMap::set over HashMap::add here as we want to | 1287 // We use HashMap::set over HashMap::add here as we want to |
1288 // replace the ComputedStyle but not the Element if the Element is | 1288 // replace the ComputedStyle but not the Element if the Element is |
1289 // already present. | 1289 // already present. |
1290 void Document::addNonAttachedStyle(Element& element, | 1290 void Document::addStyleRecalcData(Element& element, |
1291 RefPtr<ComputedStyle> computedStyle) { | 1291 StyleRecalcData* styleRecalcData) { |
1292 m_nonAttachedStyle.set(&element, computedStyle); | 1292 m_styleRecalcDataMap.set(&element, styleRecalcData); |
1293 } | 1293 } |
1294 | 1294 |
1295 ComputedStyle* Document::getNonAttachedStyle(Element& element) { | 1295 StyleRecalcData* Document::getStyleRecalcData(Element& element) { |
1296 return m_nonAttachedStyle.get(&element); | 1296 return m_styleRecalcDataMap.get(&element); |
1297 } | 1297 } |
1298 | 1298 |
1299 /* | 1299 /* |
1300 * Performs three operations: | 1300 * Performs three operations: |
1301 * 1. Convert control characters to spaces | 1301 * 1. Convert control characters to spaces |
1302 * 2. Trim leading and trailing spaces | 1302 * 2. Trim leading and trailing spaces |
1303 * 3. Collapse internal whitespace. | 1303 * 3. Collapse internal whitespace. |
1304 */ | 1304 */ |
1305 template <typename CharacterType> | 1305 template <typename CharacterType> |
1306 static inline String canonicalizedTitle(Document* document, | 1306 static inline String canonicalizedTitle(Document* document, |
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1964 if (documentElement->shouldCallRecalcStyle(change)) | 1964 if (documentElement->shouldCallRecalcStyle(change)) |
1965 documentElement->recalcStyle(change); | 1965 documentElement->recalcStyle(change); |
1966 while (dirtyElementsForLayerUpdate()) | 1966 while (dirtyElementsForLayerUpdate()) |
1967 documentElement->recalcStyle(NoChange); | 1967 documentElement->recalcStyle(NoChange); |
1968 } | 1968 } |
1969 | 1969 |
1970 view()->recalcOverflowAfterStyleChange(); | 1970 view()->recalcOverflowAfterStyleChange(); |
1971 | 1971 |
1972 // Only retain the HashMap for the duration of StyleRecalc and | 1972 // Only retain the HashMap for the duration of StyleRecalc and |
1973 // LayoutTreeConstruction. | 1973 // LayoutTreeConstruction. |
1974 m_nonAttachedStyle.clear(); | 1974 m_styleRecalcDataMap.clear(); |
1975 clearChildNeedsStyleRecalc(); | 1975 clearChildNeedsStyleRecalc(); |
1976 clearChildNeedsReattachLayoutTree(); | 1976 clearChildNeedsReattachLayoutTree(); |
1977 | 1977 |
1978 resolver.clearStyleSharingList(); | 1978 resolver.clearStyleSharingList(); |
1979 | 1979 |
1980 DCHECK(!needsStyleRecalc()); | 1980 DCHECK(!needsStyleRecalc()); |
1981 DCHECK(!childNeedsStyleRecalc()); | 1981 DCHECK(!childNeedsStyleRecalc()); |
1982 DCHECK(!needsReattachLayoutTree()); | 1982 DCHECK(!needsReattachLayoutTree()); |
1983 DCHECK(!childNeedsReattachLayoutTree()); | 1983 DCHECK(!childNeedsReattachLayoutTree()); |
1984 DCHECK(inStyleRecalc()); | 1984 DCHECK(inStyleRecalc()); |
1985 DCHECK_EQ(styleResolver(), &resolver); | 1985 DCHECK_EQ(styleResolver(), &resolver); |
1986 DCHECK(m_nonAttachedStyle.isEmpty()); | 1986 DCHECK(m_styleRecalcDataMap.isEmpty()); |
1987 m_lifecycle.advanceTo(DocumentLifecycle::StyleClean); | 1987 m_lifecycle.advanceTo(DocumentLifecycle::StyleClean); |
1988 if (shouldRecordStats) { | 1988 if (shouldRecordStats) { |
1989 TRACE_EVENT_END2("blink,blink_style", "Document::updateStyle", | 1989 TRACE_EVENT_END2("blink,blink_style", "Document::updateStyle", |
1990 "resolverAccessCount", | 1990 "resolverAccessCount", |
1991 styleEngine().styleForElementCount() - initialElementCount, | 1991 styleEngine().styleForElementCount() - initialElementCount, |
1992 "counters", styleEngine().stats()->toTracedValue()); | 1992 "counters", styleEngine().stats()->toTracedValue()); |
1993 } else { | 1993 } else { |
1994 TRACE_EVENT_END1( | 1994 TRACE_EVENT_END1( |
1995 "blink,blink_style", "Document::updateStyle", "resolverAccessCount", | 1995 "blink,blink_style", "Document::updateStyle", "resolverAccessCount", |
1996 styleEngine().styleForElementCount() - initialElementCount); | 1996 styleEngine().styleForElementCount() - initialElementCount); |
(...skipping 4426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6423 visitor->trace(m_svgExtensions); | 6423 visitor->trace(m_svgExtensions); |
6424 visitor->trace(m_timeline); | 6424 visitor->trace(m_timeline); |
6425 visitor->trace(m_compositorPendingAnimations); | 6425 visitor->trace(m_compositorPendingAnimations); |
6426 visitor->trace(m_contextDocument); | 6426 visitor->trace(m_contextDocument); |
6427 visitor->trace(m_canvasFontCache); | 6427 visitor->trace(m_canvasFontCache); |
6428 visitor->trace(m_intersectionObserverController); | 6428 visitor->trace(m_intersectionObserverController); |
6429 visitor->trace(m_intersectionObserverData); | 6429 visitor->trace(m_intersectionObserverData); |
6430 visitor->trace(m_snapCoordinator); | 6430 visitor->trace(m_snapCoordinator); |
6431 visitor->trace(m_resizeObserverController); | 6431 visitor->trace(m_resizeObserverController); |
6432 visitor->trace(m_propertyRegistry); | 6432 visitor->trace(m_propertyRegistry); |
6433 visitor->trace(m_nonAttachedStyle); | 6433 visitor->trace(m_styleRecalcDataMap); |
6434 Supplementable<Document>::trace(visitor); | 6434 Supplementable<Document>::trace(visitor); |
6435 TreeScope::trace(visitor); | 6435 TreeScope::trace(visitor); |
6436 ContainerNode::trace(visitor); | 6436 ContainerNode::trace(visitor); |
6437 ExecutionContext::trace(visitor); | 6437 ExecutionContext::trace(visitor); |
6438 SecurityContext::trace(visitor); | 6438 SecurityContext::trace(visitor); |
6439 } | 6439 } |
6440 | 6440 |
6441 void Document::maybeRecordLoadReason(WouldLoadReason reason) { | 6441 void Document::maybeRecordLoadReason(WouldLoadReason reason) { |
6442 DCHECK(m_wouldLoadReason == Created || reason != Created); | 6442 DCHECK(m_wouldLoadReason == Created || reason != Created); |
6443 DCHECK(frame()); | 6443 DCHECK(frame()); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6478 } | 6478 } |
6479 | 6479 |
6480 void showLiveDocumentInstances() { | 6480 void showLiveDocumentInstances() { |
6481 WeakDocumentSet& set = liveDocumentSet(); | 6481 WeakDocumentSet& set = liveDocumentSet(); |
6482 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); | 6482 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); |
6483 for (Document* document : set) | 6483 for (Document* document : set) |
6484 fprintf(stderr, "- Document %p URL: %s\n", document, | 6484 fprintf(stderr, "- Document %p URL: %s\n", document, |
6485 document->url().getString().utf8().data()); | 6485 document->url().getString().utf8().data()); |
6486 } | 6486 } |
6487 #endif | 6487 #endif |
OLD | NEW |