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 11 matching lines...) Expand all Loading... |
22 * | 22 * |
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/DocumentStyleSheetCollection.h" | 29 #include "core/dom/DocumentStyleSheetCollection.h" |
30 | 30 |
31 #include "core/css/resolver/StyleResolver.h" | 31 #include "core/css/resolver/StyleResolver.h" |
| 32 #include "core/css/resolver/ViewportStyleResolver.h" |
32 #include "core/dom/Document.h" | 33 #include "core/dom/Document.h" |
33 #include "core/dom/DocumentStyleSheetCollector.h" | 34 #include "core/dom/DocumentStyleSheetCollector.h" |
34 #include "core/dom/ProcessingInstruction.h" | 35 #include "core/dom/ProcessingInstruction.h" |
35 #include "core/dom/StyleChangeReason.h" | 36 #include "core/dom/StyleChangeReason.h" |
36 #include "core/dom/StyleEngine.h" | 37 #include "core/dom/StyleEngine.h" |
37 #include "core/dom/StyleSheetCandidate.h" | 38 #include "core/dom/StyleSheetCandidate.h" |
38 #include "platform/RuntimeEnabledFeatures.h" | 39 #include "platform/RuntimeEnabledFeatures.h" |
39 | 40 |
40 namespace blink { | 41 namespace blink { |
41 | 42 |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 } | 124 } |
124 if (change.requiresFullStyleRecalc) | 125 if (change.requiresFullStyleRecalc) |
125 document().setNeedsStyleRecalc( | 126 document().setNeedsStyleRecalc( |
126 SubtreeStyleChange, StyleChangeReasonForTracing::create( | 127 SubtreeStyleChange, StyleChangeReasonForTracing::create( |
127 StyleChangeReason::ActiveStylesheetsUpdate)); | 128 StyleChangeReason::ActiveStylesheetsUpdate)); |
128 | 129 |
129 collection->swap(*this); | 130 collection->swap(*this); |
130 collection->dispose(); | 131 collection->dispose(); |
131 } | 132 } |
132 | 133 |
| 134 void DocumentStyleSheetCollection::collectViewportRules( |
| 135 ViewportStyleResolver& viewportResolver) { |
| 136 for (Node* node : m_styleSheetCandidateNodes) { |
| 137 StyleSheetCandidate candidate(*node); |
| 138 |
| 139 if (candidate.isImport()) |
| 140 continue; |
| 141 StyleSheet* sheet = candidate.sheet(); |
| 142 if (!sheet) |
| 143 continue; |
| 144 if (!candidate.canBeActivated( |
| 145 document().styleEngine().preferredStylesheetSetName())) |
| 146 continue; |
| 147 viewportResolver.collectViewportRulesFromAuthorSheet( |
| 148 *toCSSStyleSheet(sheet)); |
| 149 } |
| 150 } |
| 151 |
133 } // namespace blink | 152 } // namespace blink |
OLD | NEW |