| 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, 2010, 2012 Apple Inc. All r
ights reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r
ights reserved. |
| 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) |
| 8 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) | 8 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) |
| 9 * Copyright (C) 2013 Google Inc. All rights reserved. | 9 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 10 * | 10 * |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 : m_treeScope(treeScope) | 43 : m_treeScope(treeScope) |
| 44 , m_hadActiveLoadingStylesheet(false) | 44 , m_hadActiveLoadingStylesheet(false) |
| 45 { | 45 { |
| 46 } | 46 } |
| 47 | 47 |
| 48 void TreeScopeStyleSheetCollection::addStyleSheetCandidateNode(Node* node, bool
createdByParser) | 48 void TreeScopeStyleSheetCollection::addStyleSheetCandidateNode(Node* node, bool
createdByParser) |
| 49 { | 49 { |
| 50 if (!node->inDocument()) | 50 if (!node->inDocument()) |
| 51 return; | 51 return; |
| 52 | 52 |
| 53 // Until the <body> exists, we have no choice but to compare document positi
ons, | 53 m_styleSheetCandidateNodes.add(node); |
| 54 // since styles outside of the body and head continue to be shunted into the
head | |
| 55 // (and thus can shift to end up before dynamically added DOM content that i
s also | |
| 56 // outside the body). | |
| 57 if (createdByParser && document().body() && !node->nextSibling()) | |
| 58 m_styleSheetCandidateNodes.parserAdd(node); | |
| 59 else | |
| 60 m_styleSheetCandidateNodes.add(node); | |
| 61 } | 54 } |
| 62 | 55 |
| 63 TreeScopeStyleSheetCollection::StyleResolverUpdateType TreeScopeStyleSheetCollec
tion::compareStyleSheets(const WillBeHeapVector<RefPtrWillBeMember<CSSStyleSheet
>>& oldStyleSheets, const WillBeHeapVector<RefPtrWillBeMember<CSSStyleSheet>>& n
ewStylesheets, WillBeHeapVector<RawPtrWillBeMember<StyleSheetContents>>& addedSh
eets) | 56 TreeScopeStyleSheetCollection::StyleResolverUpdateType TreeScopeStyleSheetCollec
tion::compareStyleSheets(const WillBeHeapVector<RefPtrWillBeMember<CSSStyleSheet
>>& oldStyleSheets, const WillBeHeapVector<RefPtrWillBeMember<CSSStyleSheet>>& n
ewStylesheets, WillBeHeapVector<RawPtrWillBeMember<StyleSheetContents>>& addedSh
eets) |
| 64 { | 57 { |
| 65 unsigned newStyleSheetCount = newStylesheets.size(); | 58 unsigned newStyleSheetCount = newStylesheets.size(); |
| 66 unsigned oldStyleSheetCount = oldStyleSheets.size(); | 59 unsigned oldStyleSheetCount = oldStyleSheets.size(); |
| 67 ASSERT(newStyleSheetCount >= oldStyleSheetCount); | 60 ASSERT(newStyleSheetCount >= oldStyleSheetCount); |
| 68 | 61 |
| 69 if (!newStyleSheetCount) | 62 if (!newStyleSheetCount) |
| 70 return Reconstruct; | 63 return Reconstruct; |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 } | 169 } |
| 177 | 170 |
| 178 DEFINE_TRACE(TreeScopeStyleSheetCollection) | 171 DEFINE_TRACE(TreeScopeStyleSheetCollection) |
| 179 { | 172 { |
| 180 visitor->trace(m_treeScope); | 173 visitor->trace(m_treeScope); |
| 181 visitor->trace(m_styleSheetCandidateNodes); | 174 visitor->trace(m_styleSheetCandidateNodes); |
| 182 StyleSheetCollection::trace(visitor); | 175 StyleSheetCollection::trace(visitor); |
| 183 } | 176 } |
| 184 | 177 |
| 185 } | 178 } |
| OLD | NEW |