| 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 if (!node->inShadowIncludingDocument()) | 49 if (!node->inShadowIncludingDocument()) |
| 50 return; | 50 return; |
| 51 | 51 |
| 52 m_styleSheetCandidateNodes.add(node); | 52 m_styleSheetCandidateNodes.add(node); |
| 53 } | 53 } |
| 54 | 54 |
| 55 TreeScopeStyleSheetCollection::StyleResolverUpdateType TreeScopeStyleSheetCollec
tion::compareStyleSheets(const HeapVector<Member<CSSStyleSheet>>& oldStyleSheets
, const HeapVector<Member<CSSStyleSheet>>& newStylesheets, HeapVector<Member<Sty
leSheetContents>>& addedSheets) | 55 TreeScopeStyleSheetCollection::StyleResolverUpdateType TreeScopeStyleSheetCollec
tion::compareStyleSheets(const HeapVector<Member<CSSStyleSheet>>& oldStyleSheets
, const HeapVector<Member<CSSStyleSheet>>& newStylesheets, HeapVector<Member<Sty
leSheetContents>>& addedSheets) |
| 56 { | 56 { |
| 57 unsigned newStyleSheetCount = newStylesheets.size(); | 57 unsigned newStyleSheetCount = newStylesheets.size(); |
| 58 unsigned oldStyleSheetCount = oldStyleSheets.size(); | 58 unsigned oldStyleSheetCount = oldStyleSheets.size(); |
| 59 ASSERT(newStyleSheetCount >= oldStyleSheetCount); | 59 DCHECK_GE(newStyleSheetCount, oldStyleSheetCount); |
| 60 | 60 |
| 61 if (!newStyleSheetCount) | 61 if (!newStyleSheetCount) |
| 62 return Reconstruct; | 62 return Reconstruct; |
| 63 | 63 |
| 64 unsigned newIndex = 0; | 64 unsigned newIndex = 0; |
| 65 for (unsigned oldIndex = 0; oldIndex < oldStyleSheetCount; ++oldIndex) { | 65 for (unsigned oldIndex = 0; oldIndex < oldStyleSheetCount; ++oldIndex) { |
| 66 while (oldStyleSheets[oldIndex] != newStylesheets[newIndex]) { | 66 while (oldStyleSheets[oldIndex] != newStylesheets[newIndex]) { |
| 67 addedSheets.append(newStylesheets[newIndex]->contents()); | 67 addedSheets.append(newStylesheets[newIndex]->contents()); |
| 68 if (++newIndex == newStyleSheetCount) | 68 if (++newIndex == newStyleSheetCount) |
| 69 return Reconstruct; | 69 return Reconstruct; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 96 } | 96 } |
| 97 m_hadActiveLoadingStylesheet = hasActiveLoadingStylesheet; | 97 m_hadActiveLoadingStylesheet = hasActiveLoadingStylesheet; |
| 98 return false; | 98 return false; |
| 99 } | 99 } |
| 100 | 100 |
| 101 static bool findFontFaceRulesFromStyleSheetContents(const HeapVector<Member<Styl
eSheetContents>>& sheets, HeapVector<Member<const StyleRuleFontFace>>& fontFaceR
ules) | 101 static bool findFontFaceRulesFromStyleSheetContents(const HeapVector<Member<Styl
eSheetContents>>& sheets, HeapVector<Member<const StyleRuleFontFace>>& fontFaceR
ules) |
| 102 { | 102 { |
| 103 bool hasFontFaceRule = false; | 103 bool hasFontFaceRule = false; |
| 104 | 104 |
| 105 for (unsigned i = 0; i < sheets.size(); ++i) { | 105 for (unsigned i = 0; i < sheets.size(); ++i) { |
| 106 ASSERT(sheets[i]); | 106 DCHECK(sheets[i]); |
| 107 if (sheets[i]->hasFontFaceRule()) { | 107 if (sheets[i]->hasFontFaceRule()) { |
| 108 // FIXME: We don't need this for styles in shadow tree. | 108 // FIXME: We don't need this for styles in shadow tree. |
| 109 sheets[i]->findFontFaceRules(fontFaceRules); | 109 sheets[i]->findFontFaceRules(fontFaceRules); |
| 110 hasFontFaceRule = true; | 110 hasFontFaceRule = true; |
| 111 } | 111 } |
| 112 } | 112 } |
| 113 return hasFontFaceRule; | 113 return hasFontFaceRule; |
| 114 } | 114 } |
| 115 | 115 |
| 116 void TreeScopeStyleSheetCollection::analyzeStyleSheetChange(StyleResolverUpdateM
ode updateMode, const StyleSheetCollection& newCollection, StyleSheetChange& cha
nge) | 116 void TreeScopeStyleSheetCollection::analyzeStyleSheetChange(StyleResolverUpdateM
ode updateMode, const StyleSheetCollection& newCollection, StyleSheetChange& cha
nge) |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 } | 168 } |
| 169 | 169 |
| 170 DEFINE_TRACE(TreeScopeStyleSheetCollection) | 170 DEFINE_TRACE(TreeScopeStyleSheetCollection) |
| 171 { | 171 { |
| 172 visitor->trace(m_treeScope); | 172 visitor->trace(m_treeScope); |
| 173 visitor->trace(m_styleSheetCandidateNodes); | 173 visitor->trace(m_styleSheetCandidateNodes); |
| 174 StyleSheetCollection::trace(visitor); | 174 StyleSheetCollection::trace(visitor); |
| 175 } | 175 } |
| 176 | 176 |
| 177 } // namespace blink | 177 } // namespace blink |
| OLD | NEW |