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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
48 | 48 |
49 void TreeScopeStyleSheetCollection::addStyleSheetCandidateNode(Node* node, bool createdByParser) | 49 void TreeScopeStyleSheetCollection::addStyleSheetCandidateNode(Node* node, bool createdByParser) |
50 { | 50 { |
51 if (!node->inDocument()) | 51 if (!node->inDocument()) |
52 return; | 52 return; |
53 | 53 |
54 // Until the <body> exists, we have no choice but to compare document positi ons, | 54 // Until the <body> exists, we have no choice but to compare document positi ons, |
55 // since styles outside of the body and head continue to be shunted into the head | 55 // since styles outside of the body and head continue to be shunted into the head |
56 // (and thus can shift to end up before dynamically added DOM content that i s also | 56 // (and thus can shift to end up before dynamically added DOM content that i s also |
57 // outside the body). | 57 // outside the body). |
58 if (createdByParser && document().body()) | 58 if (createdByParser && document().body() && !node->nextSibling()) |
esprehn
2015/01/10 01:50:44
I suspect this is wrong if there's mutation events
| |
59 m_styleSheetCandidateNodes.parserAdd(node); | 59 m_styleSheetCandidateNodes.parserAdd(node); |
60 else | 60 else |
61 m_styleSheetCandidateNodes.add(node); | 61 m_styleSheetCandidateNodes.add(node); |
62 } | 62 } |
63 | 63 |
64 TreeScopeStyleSheetCollection::StyleResolverUpdateType TreeScopeStyleSheetCollec tion::compareStyleSheets(const WillBeHeapVector<RefPtrWillBeMember<CSSStyleSheet > >& oldStyleSheets, const WillBeHeapVector<RefPtrWillBeMember<CSSStyleSheet> >& newStylesheets, WillBeHeapVector<RawPtrWillBeMember<StyleSheetContents> >& adde dSheets) | 64 TreeScopeStyleSheetCollection::StyleResolverUpdateType TreeScopeStyleSheetCollec tion::compareStyleSheets(const WillBeHeapVector<RefPtrWillBeMember<CSSStyleSheet > >& oldStyleSheets, const WillBeHeapVector<RefPtrWillBeMember<CSSStyleSheet> >& newStylesheets, WillBeHeapVector<RawPtrWillBeMember<StyleSheetContents> >& adde dSheets) |
65 { | 65 { |
66 unsigned newStyleSheetCount = newStylesheets.size(); | 66 unsigned newStyleSheetCount = newStylesheets.size(); |
67 unsigned oldStyleSheetCount = oldStyleSheets.size(); | 67 unsigned oldStyleSheetCount = oldStyleSheets.size(); |
68 ASSERT(newStyleSheetCount >= oldStyleSheetCount); | 68 ASSERT(newStyleSheetCount >= oldStyleSheetCount); |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
202 } | 202 } |
203 | 203 |
204 void TreeScopeStyleSheetCollection::trace(Visitor* visitor) | 204 void TreeScopeStyleSheetCollection::trace(Visitor* visitor) |
205 { | 205 { |
206 visitor->trace(m_treeScope); | 206 visitor->trace(m_treeScope); |
207 visitor->trace(m_styleSheetCandidateNodes); | 207 visitor->trace(m_styleSheetCandidateNodes); |
208 StyleSheetCollection::trace(visitor); | 208 StyleSheetCollection::trace(visitor); |
209 } | 209 } |
210 | 210 |
211 } | 211 } |
OLD | NEW |