| 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 | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 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) 2010 Nokia Corporation and/or its subsidiary(-ies) | 10 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 | 40 |
| 41 namespace blink { | 41 namespace blink { |
| 42 | 42 |
| 43 using namespace HTMLNames; | 43 using namespace HTMLNames; |
| 44 | 44 |
| 45 ShadowTreeStyleSheetCollection::ShadowTreeStyleSheetCollection( | 45 ShadowTreeStyleSheetCollection::ShadowTreeStyleSheetCollection( |
| 46 ShadowRoot& shadowRoot) | 46 ShadowRoot& shadowRoot) |
| 47 : TreeScopeStyleSheetCollection(shadowRoot) {} | 47 : TreeScopeStyleSheetCollection(shadowRoot) {} |
| 48 | 48 |
| 49 void ShadowTreeStyleSheetCollection::collectStyleSheets( | 49 void ShadowTreeStyleSheetCollection::collectStyleSheets( |
| 50 StyleEngine& masterEngine, |
| 50 StyleSheetCollection& collection) { | 51 StyleSheetCollection& collection) { |
| 51 for (Node* n : m_styleSheetCandidateNodes) { | 52 for (Node* n : m_styleSheetCandidateNodes) { |
| 52 StyleSheetCandidate candidate(*n); | 53 StyleSheetCandidate candidate(*n); |
| 53 DCHECK(!candidate.isXSL()); | 54 DCHECK(!candidate.isXSL()); |
| 54 | 55 |
| 55 StyleSheet* sheet = candidate.sheet(); | 56 StyleSheet* sheet = candidate.sheet(); |
| 56 if (!sheet) | 57 if (!sheet) |
| 57 continue; | 58 continue; |
| 58 | 59 |
| 59 collection.appendSheetForList(sheet); | 60 collection.appendSheetForList(sheet); |
| 60 if (candidate.canBeActivated(nullAtom)) { | 61 if (candidate.canBeActivated(nullAtom)) { |
| 61 CSSStyleSheet* cssSheet = toCSSStyleSheet(sheet); | 62 CSSStyleSheet* cssSheet = toCSSStyleSheet(sheet); |
| 62 collection.appendActiveStyleSheet(std::make_pair( | 63 collection.appendActiveStyleSheet( |
| 63 cssSheet, document().styleEngine().ruleSetForSheet(*cssSheet))); | 64 std::make_pair(cssSheet, masterEngine.ruleSetForSheet(*cssSheet))); |
| 64 } | 65 } |
| 65 } | 66 } |
| 66 } | 67 } |
| 67 | 68 |
| 68 void ShadowTreeStyleSheetCollection::updateActiveStyleSheets() { | 69 void ShadowTreeStyleSheetCollection::updateActiveStyleSheets( |
| 70 StyleEngine& masterEngine) { |
| 69 // StyleSheetCollection is GarbageCollected<>, allocate it on the heap. | 71 // StyleSheetCollection is GarbageCollected<>, allocate it on the heap. |
| 70 StyleSheetCollection* collection = StyleSheetCollection::create(); | 72 StyleSheetCollection* collection = StyleSheetCollection::create(); |
| 71 collectStyleSheets(*collection); | 73 collectStyleSheets(masterEngine, *collection); |
| 72 applyActiveStyleSheetChanges(*collection); | 74 applyActiveStyleSheetChanges(*collection); |
| 73 } | 75 } |
| 74 | 76 |
| 75 } // namespace blink | 77 } // namespace blink |
| OLD | NEW |