OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010, Google Inc. All rights reserved. | 2 * Copyright (C) 2010, Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 1163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1174 Vector<CSSStyleSheet*> cssStyleSheets; | 1174 Vector<CSSStyleSheet*> cssStyleSheets; |
1175 Vector<Document*> documents = m_domAgent->documents(); | 1175 Vector<Document*> documents = m_domAgent->documents(); |
1176 for (Vector<Document*>::iterator it = documents.begin(); it != documents.end
(); ++it) | 1176 for (Vector<Document*>::iterator it = documents.begin(); it != documents.end
(); ++it) |
1177 collectAllDocumentStyleSheets(*it, cssStyleSheets); | 1177 collectAllDocumentStyleSheets(*it, cssStyleSheets); |
1178 for (Vector<CSSStyleSheet*>::iterator it = cssStyleSheets.begin(); it != css
StyleSheets.end(); ++it) | 1178 for (Vector<CSSStyleSheet*>::iterator it = cssStyleSheets.begin(); it != css
StyleSheets.end(); ++it) |
1179 result.append(bindStyleSheet(*it)); | 1179 result.append(bindStyleSheet(*it)); |
1180 } | 1180 } |
1181 | 1181 |
1182 void InspectorCSSAgent::collectAllDocumentStyleSheets(Document* document, Vector
<CSSStyleSheet*>& result) | 1182 void InspectorCSSAgent::collectAllDocumentStyleSheets(Document* document, Vector
<CSSStyleSheet*>& result) |
1183 { | 1183 { |
1184 const WillBeHeapVector<RefPtrWillBeMember<StyleSheet> > activeStyleSheets =
document->styleEngine()->activeStyleSheetsForInspector(); | 1184 const WillBeHeapVector<RefPtrWillBeMember<CSSStyleSheet> > activeStyleSheets
= document->styleEngine()->activeStyleSheetsForInspector(); |
1185 for (WillBeHeapVector<RefPtrWillBeMember<StyleSheet> >::const_iterator it =
activeStyleSheets.begin(); it != activeStyleSheets.end(); ++it) { | 1185 for (WillBeHeapVector<RefPtrWillBeMember<CSSStyleSheet> >::const_iterator it
= activeStyleSheets.begin(); it != activeStyleSheets.end(); ++it) { |
1186 StyleSheet* styleSheet = it->get(); | 1186 CSSStyleSheet* styleSheet = it->get(); |
1187 if (styleSheet->isCSSStyleSheet()) | 1187 collectStyleSheets(styleSheet, result); |
1188 collectStyleSheets(toCSSStyleSheet(styleSheet), result); | |
1189 } | 1188 } |
1190 } | 1189 } |
1191 | 1190 |
1192 void InspectorCSSAgent::collectStyleSheets(CSSStyleSheet* styleSheet, Vector<CSS
StyleSheet*>& result) | 1191 void InspectorCSSAgent::collectStyleSheets(CSSStyleSheet* styleSheet, Vector<CSS
StyleSheet*>& result) |
1193 { | 1192 { |
1194 result.append(styleSheet); | 1193 result.append(styleSheet); |
1195 for (unsigned i = 0, size = styleSheet->length(); i < size; ++i) { | 1194 for (unsigned i = 0, size = styleSheet->length(); i < size; ++i) { |
1196 CSSRule* rule = styleSheet->item(i); | 1195 CSSRule* rule = styleSheet->item(i); |
1197 if (rule->type() == CSSRule::IMPORT_RULE) { | 1196 if (rule->type() == CSSRule::IMPORT_RULE) { |
1198 CSSStyleSheet* importedStyleSheet = toCSSImportRule(rule)->styleShee
t(); | 1197 CSSStyleSheet* importedStyleSheet = toCSSImportRule(rule)->styleShee
t(); |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1448 documentsToChange.add(element->ownerDocument()); | 1447 documentsToChange.add(element->ownerDocument()); |
1449 } | 1448 } |
1450 | 1449 |
1451 m_nodeIdToForcedPseudoState.clear(); | 1450 m_nodeIdToForcedPseudoState.clear(); |
1452 for (HashSet<Document*>::iterator it = documentsToChange.begin(), end = docu
mentsToChange.end(); it != end; ++it) | 1451 for (HashSet<Document*>::iterator it = documentsToChange.begin(), end = docu
mentsToChange.end(); it != end; ++it) |
1453 (*it)->setNeedsStyleRecalc(SubtreeStyleChange); | 1452 (*it)->setNeedsStyleRecalc(SubtreeStyleChange); |
1454 } | 1453 } |
1455 | 1454 |
1456 } // namespace WebCore | 1455 } // namespace WebCore |
1457 | 1456 |
OLD | NEW |