| 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" | |
| 34 #include "core/dom/DocumentStyleSheetCollection.h" | 33 #include "core/dom/DocumentStyleSheetCollection.h" |
| 35 | 34 |
| 36 namespace blink { | 35 namespace blink { |
| 37 | 36 |
| 38 DocumentStyleSheetCollector::DocumentStyleSheetCollector( | 37 DocumentStyleSheetCollector::DocumentStyleSheetCollector( |
| 39 StyleSheetCollection* collection, | 38 StyleSheetCollection* collection, |
| 40 HeapVector<Member<StyleSheet>>* sheetsForList, | 39 HeapVector<Member<StyleSheet>>* sheetsForList, |
| 41 HeapHashSet<Member<Document>>* visitedDocuments) | 40 HeapHashSet<Member<Document>>* visitedDocuments) |
| 42 : m_collection(collection), | 41 : m_collection(collection), |
| 43 m_styleSheetsForStyleSheetList(sheetsForList), | 42 m_styleSheetsForStyleSheetList(sheetsForList), |
| 44 m_visitedDocuments(visitedDocuments) {} | 43 m_visitedDocuments(visitedDocuments) {} |
| 45 | 44 |
| 46 DocumentStyleSheetCollector::~DocumentStyleSheetCollector() {} | 45 DocumentStyleSheetCollector::~DocumentStyleSheetCollector() {} |
| 47 | 46 |
| 48 void DocumentStyleSheetCollector::appendActiveStyleSheet( | 47 void DocumentStyleSheetCollector::appendActiveStyleSheets( |
| 49 const ActiveStyleSheet& sheet) { | 48 const HeapVector<TraceWrapperMember<CSSStyleSheet>>& sheets) { |
| 49 DCHECK(m_collection); |
| 50 m_collection->appendActiveStyleSheets(sheets); |
| 51 } |
| 52 |
| 53 void DocumentStyleSheetCollector::appendActiveStyleSheet(CSSStyleSheet* sheet) { |
| 50 DCHECK(m_collection); | 54 DCHECK(m_collection); |
| 51 m_collection->appendActiveStyleSheet(sheet); | 55 m_collection->appendActiveStyleSheet(sheet); |
| 52 } | 56 } |
| 53 | 57 |
| 54 void DocumentStyleSheetCollector::appendSheetForList(StyleSheet* sheet) { | 58 void DocumentStyleSheetCollector::appendSheetForList(StyleSheet* sheet) { |
| 55 if (m_styleSheetsForStyleSheetList) { | 59 if (m_styleSheetsForStyleSheetList) { |
| 56 m_styleSheetsForStyleSheetList->append(sheet); | 60 m_styleSheetsForStyleSheetList->append(sheet); |
| 57 } else { | 61 } else { |
| 58 m_collection->appendSheetForList(sheet); | 62 m_collection->appendSheetForList(sheet); |
| 59 } | 63 } |
| 60 } | 64 } |
| 61 | 65 |
| 62 ActiveDocumentStyleSheetCollector::ActiveDocumentStyleSheetCollector( | 66 ActiveDocumentStyleSheetCollector::ActiveDocumentStyleSheetCollector( |
| 63 StyleSheetCollection& collection) | 67 StyleSheetCollection& collection) |
| 64 : DocumentStyleSheetCollector(&collection, nullptr, &m_visitedDocuments) {} | 68 : DocumentStyleSheetCollector(&collection, nullptr, &m_visitedDocuments) {} |
| 65 | 69 |
| 66 ImportedDocumentStyleSheetCollector::ImportedDocumentStyleSheetCollector( | 70 ImportedDocumentStyleSheetCollector::ImportedDocumentStyleSheetCollector( |
| 67 DocumentStyleSheetCollector& collector, | 71 DocumentStyleSheetCollector& collector, |
| 68 HeapVector<Member<StyleSheet>>& sheetForList) | 72 HeapVector<Member<StyleSheet>>& sheetForList) |
| 69 : DocumentStyleSheetCollector(collector.m_collection, | 73 : DocumentStyleSheetCollector(collector.m_collection, |
| 70 &sheetForList, | 74 &sheetForList, |
| 71 collector.m_visitedDocuments) {} | 75 collector.m_visitedDocuments) {} |
| 72 | 76 |
| 73 } // namespace blink | 77 } // namespace blink |
| OLD | NEW |