| 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 787 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 798 for (unsigned i = 0; i < glyphBuffer.size(); ++i) { | 798 for (unsigned i = 0; i < glyphBuffer.size(); ++i) { |
| 799 String familyName = glyphBuffer.fontDataAt(i)->platformData().fontFa
milyName(); | 799 String familyName = glyphBuffer.fontDataAt(i)->platformData().fontFa
milyName(); |
| 800 if (familyName.isNull()) | 800 if (familyName.isNull()) |
| 801 familyName = ""; | 801 familyName = ""; |
| 802 fontStats->add(familyName); | 802 fontStats->add(familyName); |
| 803 } | 803 } |
| 804 } | 804 } |
| 805 } | 805 } |
| 806 | 806 |
| 807 void InspectorCSSAgent::getPlatformFontsForNode(ErrorString* errorString, int no
deId, | 807 void InspectorCSSAgent::getPlatformFontsForNode(ErrorString* errorString, int no
deId, |
| 808 String* cssFamilyName, RefPtr<TypeBuilder::Array<TypeBuilder::CSS::PlatformF
ontUsage> >& platformFonts) | 808 RefPtr<TypeBuilder::Array<TypeBuilder::CSS::PlatformFontUsage>>& platformFon
ts) |
| 809 { | 809 { |
| 810 Node* node = m_domAgent->assertNode(errorString, nodeId); | 810 Node* node = m_domAgent->assertNode(errorString, nodeId); |
| 811 if (!node) | 811 if (!node) |
| 812 return; | 812 return; |
| 813 | 813 |
| 814 RefPtrWillBeRawPtr<CSSComputedStyleDeclaration> computedStyleInfo = CSSCompu
tedStyleDeclaration::create(node, true); | |
| 815 *cssFamilyName = computedStyleInfo->getPropertyValue(CSSPropertyFontFamily); | |
| 816 | |
| 817 HashCountedSet<String> fontStats; | 814 HashCountedSet<String> fontStats; |
| 818 LayoutObject* root = node->layoutObject(); | 815 LayoutObject* root = node->layoutObject(); |
| 819 if (root) { | 816 if (root) { |
| 820 collectPlatformFontsForLayoutObject(root, &fontStats); | 817 collectPlatformFontsForLayoutObject(root, &fontStats); |
| 821 // Iterate upto two layers deep. | 818 // Iterate upto two layers deep. |
| 822 for (LayoutObject* child = root->slowFirstChild(); child; child = child-
>nextSibling()) { | 819 for (LayoutObject* child = root->slowFirstChild(); child; child = child-
>nextSibling()) { |
| 823 collectPlatformFontsForLayoutObject(child, &fontStats); | 820 collectPlatformFontsForLayoutObject(child, &fontStats); |
| 824 for (LayoutObject* child2 = child->slowFirstChild(); child2; child2
= child2->nextSibling()) | 821 for (LayoutObject* child2 = child->slowFirstChild(); child2; child2
= child2->nextSibling()) |
| 825 collectPlatformFontsForLayoutObject(child2, &fontStats); | 822 collectPlatformFontsForLayoutObject(child2, &fontStats); |
| 826 } | 823 } |
| (...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1529 visitor->trace(m_documentToCSSStyleSheets); | 1526 visitor->trace(m_documentToCSSStyleSheets); |
| 1530 visitor->trace(m_invalidatedDocuments); | 1527 visitor->trace(m_invalidatedDocuments); |
| 1531 visitor->trace(m_nodeToInspectorStyleSheet); | 1528 visitor->trace(m_nodeToInspectorStyleSheet); |
| 1532 visitor->trace(m_documentToViaInspectorStyleSheet); | 1529 visitor->trace(m_documentToViaInspectorStyleSheet); |
| 1533 #endif | 1530 #endif |
| 1534 visitor->trace(m_inspectorUserAgentStyleSheet); | 1531 visitor->trace(m_inspectorUserAgentStyleSheet); |
| 1535 InspectorBaseAgent::trace(visitor); | 1532 InspectorBaseAgent::trace(visitor); |
| 1536 } | 1533 } |
| 1537 | 1534 |
| 1538 } // namespace blink | 1535 } // namespace blink |
| OLD | NEW |