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 1766 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1777 m_idToInspectorStyleSheetForInlineStyle.set(inspectorStyleSheet->id(), | 1777 m_idToInspectorStyleSheetForInlineStyle.set(inspectorStyleSheet->id(), |
1778 inspectorStyleSheet); | 1778 inspectorStyleSheet); |
1779 m_nodeToInspectorStyleSheet.set(element, inspectorStyleSheet); | 1779 m_nodeToInspectorStyleSheet.set(element, inspectorStyleSheet); |
1780 return inspectorStyleSheet; | 1780 return inspectorStyleSheet; |
1781 } | 1781 } |
1782 | 1782 |
1783 // static | 1783 // static |
1784 void InspectorCSSAgent::collectAllDocumentStyleSheets( | 1784 void InspectorCSSAgent::collectAllDocumentStyleSheets( |
1785 Document* document, | 1785 Document* document, |
1786 HeapVector<Member<CSSStyleSheet>>& result) { | 1786 HeapVector<Member<CSSStyleSheet>>& result) { |
1787 const HeapVector<Member<CSSStyleSheet>> activeStyleSheets = | 1787 for (const auto& style : |
1788 document->styleEngine().activeStyleSheetsForInspector(); | 1788 document->styleEngine().activeStyleSheetsForInspector()) |
1789 for (const auto& style : activeStyleSheets) { | 1789 InspectorCSSAgent::collectStyleSheets(style.first, result); |
1790 CSSStyleSheet* styleSheet = style.get(); | |
1791 InspectorCSSAgent::collectStyleSheets(styleSheet, result); | |
1792 } | |
1793 } | 1790 } |
1794 | 1791 |
1795 // static | 1792 // static |
1796 void InspectorCSSAgent::collectStyleSheets( | 1793 void InspectorCSSAgent::collectStyleSheets( |
1797 CSSStyleSheet* styleSheet, | 1794 CSSStyleSheet* styleSheet, |
1798 HeapVector<Member<CSSStyleSheet>>& result) { | 1795 HeapVector<Member<CSSStyleSheet>>& result) { |
1799 result.append(styleSheet); | 1796 result.append(styleSheet); |
1800 for (unsigned i = 0, size = styleSheet->length(); i < size; ++i) { | 1797 for (unsigned i = 0, size = styleSheet->length(); i < size; ++i) { |
1801 CSSRule* rule = styleSheet->item(i); | 1798 CSSRule* rule = styleSheet->item(i); |
1802 if (rule->type() == CSSRule::kImportRule) { | 1799 if (rule->type() == CSSRule::kImportRule) { |
(...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2517 visitor->trace(m_cssStyleSheetToInspectorStyleSheet); | 2514 visitor->trace(m_cssStyleSheetToInspectorStyleSheet); |
2518 visitor->trace(m_documentToCSSStyleSheets); | 2515 visitor->trace(m_documentToCSSStyleSheets); |
2519 visitor->trace(m_invalidatedDocuments); | 2516 visitor->trace(m_invalidatedDocuments); |
2520 visitor->trace(m_nodeToInspectorStyleSheet); | 2517 visitor->trace(m_nodeToInspectorStyleSheet); |
2521 visitor->trace(m_inspectorUserAgentStyleSheet); | 2518 visitor->trace(m_inspectorUserAgentStyleSheet); |
2522 visitor->trace(m_tracker); | 2519 visitor->trace(m_tracker); |
2523 InspectorBaseAgent::trace(visitor); | 2520 InspectorBaseAgent::trace(visitor); |
2524 } | 2521 } |
2525 | 2522 |
2526 } // namespace blink | 2523 } // namespace blink |
OLD | NEW |