Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1190)

Side by Side Diff: sky/engine/core/css/StyleSheetContents.cpp

Issue 799113003: Remove hasFailedOrCanceledSubresources. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « sky/engine/core/css/StyleSheetContents.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2004, 2006, 2007, 2012 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2006, 2007, 2012 Apple Inc. All rights reserved.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 { 135 {
136 return clientSingleOwnerDocument(); 136 return clientSingleOwnerDocument();
137 } 137 }
138 138
139 KURL StyleSheetContents::completeURL(const String& url) const 139 KURL StyleSheetContents::completeURL(const String& url) const
140 { 140 {
141 // FIXME: This is only OK when we have a singleOwnerNode, right? 141 // FIXME: This is only OK when we have a singleOwnerNode, right?
142 return m_parserContext.completeURL(url); 142 return m_parserContext.completeURL(url);
143 } 143 }
144 144
145 static bool childRulesHaveFailedOrCanceledSubresources(const Vector<RefPtr<Style RuleBase> >& rules)
146 {
147 for (unsigned i = 0; i < rules.size(); ++i) {
148 const StyleRuleBase* rule = rules[i].get();
149 switch (rule->type()) {
150 case StyleRuleBase::Style:
151 if (toStyleRule(rule)->properties().hasFailedOrCanceledSubresources( ))
152 return true;
153 break;
154 case StyleRuleBase::FontFace:
155 if (toStyleRuleFontFace(rule)->properties().hasFailedOrCanceledSubre sources())
156 return true;
157 break;
158 case StyleRuleBase::Media:
159 if (childRulesHaveFailedOrCanceledSubresources(toStyleRuleMedia(rule )->childRules()))
160 return true;
161 break;
162 case StyleRuleBase::Keyframes:
163 case StyleRuleBase::Unknown:
164 case StyleRuleBase::Keyframe:
165 case StyleRuleBase::Supports:
166 case StyleRuleBase::Filter:
167 break;
168 }
169 }
170 return false;
171 }
172
173 bool StyleSheetContents::hasFailedOrCanceledSubresources() const
174 {
175 ASSERT(isCacheable());
176 return childRulesHaveFailedOrCanceledSubresources(m_childRules);
177 }
178
179 Document* StyleSheetContents::clientSingleOwnerDocument() const 145 Document* StyleSheetContents::clientSingleOwnerDocument() const
180 { 146 {
181 if (!m_hasSingleOwnerDocument || clientSize() <= 0) 147 if (!m_hasSingleOwnerDocument || clientSize() <= 0)
182 return 0; 148 return 0;
183 149
184 if (m_loadingClients.size()) 150 if (m_loadingClients.size())
185 return (*m_loadingClients.begin())->ownerDocument(); 151 return (*m_loadingClients.begin())->ownerDocument();
186 return (*m_completedClients.begin())->ownerDocument(); 152 return (*m_completedClients.begin())->ownerDocument();
187 } 153 }
188 154
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 } 231 }
266 } 232 }
267 233
268 void StyleSheetContents::notifyRemoveFontFaceRule(const StyleRuleFontFace* fontF aceRule) 234 void StyleSheetContents::notifyRemoveFontFaceRule(const StyleRuleFontFace* fontF aceRule)
269 { 235 {
270 removeFontFaceRules(m_loadingClients, fontFaceRule); 236 removeFontFaceRules(m_loadingClients, fontFaceRule);
271 removeFontFaceRules(m_completedClients, fontFaceRule); 237 removeFontFaceRules(m_completedClients, fontFaceRule);
272 } 238 }
273 239
274 } 240 }
OLDNEW
« no previous file with comments | « sky/engine/core/css/StyleSheetContents.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698