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 26 matching lines...) Expand all Loading... |
37 | 37 |
38 void StyleSheetCollection::Dispose() { | 38 void StyleSheetCollection::Dispose() { |
39 style_sheets_for_style_sheet_list_.clear(); | 39 style_sheets_for_style_sheet_list_.clear(); |
40 active_author_style_sheets_.clear(); | 40 active_author_style_sheets_.clear(); |
41 } | 41 } |
42 | 42 |
43 void StyleSheetCollection::Swap(StyleSheetCollection& other) { | 43 void StyleSheetCollection::Swap(StyleSheetCollection& other) { |
44 ::blink::swap(style_sheets_for_style_sheet_list_, | 44 ::blink::swap(style_sheets_for_style_sheet_list_, |
45 other.style_sheets_for_style_sheet_list_, this, &other); | 45 other.style_sheets_for_style_sheet_list_, this, &other); |
46 active_author_style_sheets_.swap(other.active_author_style_sheets_); | 46 active_author_style_sheets_.swap(other.active_author_style_sheets_); |
| 47 sheet_list_dirty_ = false; |
47 } | 48 } |
48 | 49 |
49 void StyleSheetCollection::SwapSheetsForSheetList( | 50 void StyleSheetCollection::SwapSheetsForSheetList( |
50 HeapVector<Member<StyleSheet>>& sheets) { | 51 HeapVector<Member<StyleSheet>>& sheets) { |
51 // Only called for collection of HTML Imports that never has active sheets. | |
52 DCHECK(active_author_style_sheets_.IsEmpty()); | |
53 ::blink::swap(style_sheets_for_style_sheet_list_, sheets, this); | 52 ::blink::swap(style_sheets_for_style_sheet_list_, sheets, this); |
| 53 sheet_list_dirty_ = false; |
54 } | 54 } |
55 | 55 |
56 void StyleSheetCollection::AppendActiveStyleSheet( | 56 void StyleSheetCollection::AppendActiveStyleSheet( |
57 const ActiveStyleSheet& active_sheet) { | 57 const ActiveStyleSheet& active_sheet) { |
58 active_author_style_sheets_.push_back(active_sheet); | 58 active_author_style_sheets_.push_back(active_sheet); |
59 } | 59 } |
60 | 60 |
61 void StyleSheetCollection::AppendSheetForList(StyleSheet* sheet) { | 61 void StyleSheetCollection::AppendSheetForList(StyleSheet* sheet) { |
62 style_sheets_for_style_sheet_list_.push_back( | 62 style_sheets_for_style_sheet_list_.push_back( |
63 TraceWrapperMember<StyleSheet>(this, sheet)); | 63 TraceWrapperMember<StyleSheet>(this, sheet)); |
64 } | 64 } |
65 | 65 |
66 DEFINE_TRACE(StyleSheetCollection) { | 66 DEFINE_TRACE(StyleSheetCollection) { |
67 visitor->Trace(active_author_style_sheets_); | 67 visitor->Trace(active_author_style_sheets_); |
68 visitor->Trace(style_sheets_for_style_sheet_list_); | 68 visitor->Trace(style_sheets_for_style_sheet_list_); |
69 } | 69 } |
70 | 70 |
71 DEFINE_TRACE_WRAPPERS(StyleSheetCollection) { | 71 DEFINE_TRACE_WRAPPERS(StyleSheetCollection) { |
72 for (auto sheet : style_sheets_for_style_sheet_list_) { | 72 for (auto sheet : style_sheets_for_style_sheet_list_) { |
73 visitor->TraceWrappers(sheet); | 73 visitor->TraceWrappers(sheet); |
74 } | 74 } |
75 } | 75 } |
76 | 76 |
77 } // namespace blink | 77 } // namespace blink |
OLD | NEW |