| 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 12 matching lines...) Expand all Loading... |
| 23 * You should have received a copy of the GNU Library General Public License | 23 * You should have received a copy of the GNU Library General Public License |
| 24 * along with this library; see the file COPYING.LIB. If not, write to | 24 * along with this library; see the file COPYING.LIB. If not, write to |
| 25 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 25 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 26 * Boston, MA 02110-1301, USA. | 26 * Boston, MA 02110-1301, USA. |
| 27 */ | 27 */ |
| 28 | 28 |
| 29 #include "core/dom/DocumentStyleSheetCollector.h" | 29 #include "core/dom/DocumentStyleSheetCollector.h" |
| 30 | 30 |
| 31 #include "core/css/CSSStyleSheet.h" | 31 #include "core/css/CSSStyleSheet.h" |
| 32 #include "core/css/StyleSheet.h" | 32 #include "core/css/StyleSheet.h" |
| 33 #include "core/dom/Document.h" |
| 33 #include "core/dom/DocumentStyleSheetCollection.h" | 34 #include "core/dom/DocumentStyleSheetCollection.h" |
| 34 | 35 |
| 35 namespace blink { | 36 namespace blink { |
| 36 | 37 |
| 37 DocumentStyleSheetCollector::DocumentStyleSheetCollector( | 38 DocumentStyleSheetCollector::DocumentStyleSheetCollector( |
| 38 StyleSheetCollection* collection, | 39 StyleSheetCollection* collection, |
| 39 HeapVector<Member<StyleSheet>>* sheetsForList, | 40 HeapVector<Member<StyleSheet>>* sheetsForList, |
| 40 HeapHashSet<Member<Document>>* visitedDocuments) | 41 HeapHashSet<Member<Document>>* visitedDocuments) |
| 41 : m_collection(collection), | 42 : m_collection(collection), |
| 42 m_styleSheetsForStyleSheetList(sheetsForList), | 43 m_styleSheetsForStyleSheetList(sheetsForList), |
| 43 m_visitedDocuments(visitedDocuments) {} | 44 m_visitedDocuments(visitedDocuments) {} |
| 44 | 45 |
| 45 DocumentStyleSheetCollector::~DocumentStyleSheetCollector() {} | 46 DocumentStyleSheetCollector::~DocumentStyleSheetCollector() {} |
| 46 | 47 |
| 47 void DocumentStyleSheetCollector::appendActiveStyleSheets( | 48 void DocumentStyleSheetCollector::appendActiveStyleSheet( |
| 48 const HeapVector<TraceWrapperMember<CSSStyleSheet>>& sheets) { | 49 const ActiveStyleSheet& sheet) { |
| 49 DCHECK(m_collection); | |
| 50 m_collection->appendActiveStyleSheets(sheets); | |
| 51 } | |
| 52 | |
| 53 void DocumentStyleSheetCollector::appendActiveStyleSheet(CSSStyleSheet* sheet) { | |
| 54 DCHECK(m_collection); | 50 DCHECK(m_collection); |
| 55 m_collection->appendActiveStyleSheet(sheet); | 51 m_collection->appendActiveStyleSheet(sheet); |
| 56 } | 52 } |
| 57 | 53 |
| 58 void DocumentStyleSheetCollector::appendSheetForList(StyleSheet* sheet) { | 54 void DocumentStyleSheetCollector::appendSheetForList(StyleSheet* sheet) { |
| 59 if (m_styleSheetsForStyleSheetList) { | 55 if (m_styleSheetsForStyleSheetList) { |
| 60 m_styleSheetsForStyleSheetList->append(sheet); | 56 m_styleSheetsForStyleSheetList->append(sheet); |
| 61 } else { | 57 } else { |
| 62 m_collection->appendSheetForList(sheet); | 58 m_collection->appendSheetForList(sheet); |
| 63 } | 59 } |
| 64 } | 60 } |
| 65 | 61 |
| 66 ActiveDocumentStyleSheetCollector::ActiveDocumentStyleSheetCollector( | 62 ActiveDocumentStyleSheetCollector::ActiveDocumentStyleSheetCollector( |
| 67 StyleSheetCollection& collection) | 63 StyleSheetCollection& collection) |
| 68 : DocumentStyleSheetCollector(&collection, nullptr, &m_visitedDocuments) {} | 64 : DocumentStyleSheetCollector(&collection, nullptr, &m_visitedDocuments) {} |
| 69 | 65 |
| 70 ImportedDocumentStyleSheetCollector::ImportedDocumentStyleSheetCollector( | 66 ImportedDocumentStyleSheetCollector::ImportedDocumentStyleSheetCollector( |
| 71 DocumentStyleSheetCollector& collector, | 67 DocumentStyleSheetCollector& collector, |
| 72 HeapVector<Member<StyleSheet>>& sheetForList) | 68 HeapVector<Member<StyleSheet>>& sheetForList) |
| 73 : DocumentStyleSheetCollector(collector.m_collection, | 69 : DocumentStyleSheetCollector(collector.m_collection, |
| 74 &sheetForList, | 70 &sheetForList, |
| 75 collector.m_visitedDocuments) {} | 71 collector.m_visitedDocuments) {} |
| 76 | 72 |
| 77 } // namespace blink | 73 } // namespace blink |
| OLD | NEW |