| 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 712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 723 attributesStyle = attributes ? attributes.release() : nullptr; | 723 attributesStyle = attributes ? attributes.release() : nullptr; |
| 724 } | 724 } |
| 725 | 725 |
| 726 void InspectorCSSAgent::getComputedStyleForNode(ErrorString* errorString, int no
deId, RefPtr<TypeBuilder::Array<TypeBuilder::CSS::CSSComputedStyleProperty> >& s
tyle) | 726 void InspectorCSSAgent::getComputedStyleForNode(ErrorString* errorString, int no
deId, RefPtr<TypeBuilder::Array<TypeBuilder::CSS::CSSComputedStyleProperty> >& s
tyle) |
| 727 { | 727 { |
| 728 Node* node = m_domAgent->assertNode(errorString, nodeId); | 728 Node* node = m_domAgent->assertNode(errorString, nodeId); |
| 729 if (!node) | 729 if (!node) |
| 730 return; | 730 return; |
| 731 | 731 |
| 732 RefPtrWillBeRawPtr<CSSComputedStyleDeclaration> computedStyleInfo = CSSCompu
tedStyleDeclaration::create(node, true); | 732 RefPtrWillBeRawPtr<CSSComputedStyleDeclaration> computedStyleInfo = CSSCompu
tedStyleDeclaration::create(node, true); |
| 733 RefPtr<InspectorStyle> inspectorStyle = InspectorStyle::create(InspectorCSSI
d(), computedStyleInfo, 0); | 733 RefPtrWillBeRawPtr<InspectorStyle> inspectorStyle = InspectorStyle::create(I
nspectorCSSId(), computedStyleInfo, 0); |
| 734 style = inspectorStyle->buildArrayForComputedStyle(); | 734 style = inspectorStyle->buildArrayForComputedStyle(); |
| 735 } | 735 } |
| 736 | 736 |
| 737 void InspectorCSSAgent::collectPlatformFontsForRenderer(RenderText* renderer, Ha
shCountedSet<String>* fontStats) | 737 void InspectorCSSAgent::collectPlatformFontsForRenderer(RenderText* renderer, Ha
shCountedSet<String>* fontStats) |
| 738 { | 738 { |
| 739 for (InlineTextBox* box = renderer->firstTextBox(); box; box = box->nextText
Box()) { | 739 for (InlineTextBox* box = renderer->firstTextBox(); box; box = box->nextText
Box()) { |
| 740 RenderStyle* style = renderer->style(box->isFirstLineStyle()); | 740 RenderStyle* style = renderer->style(box->isFirstLineStyle()); |
| 741 const Font& font = style->font(); | 741 const Font& font = style->font(); |
| 742 TextRun run = box->constructTextRunForInspector(style, font); | 742 TextRun run = box->constructTextRunForInspector(style, font); |
| 743 WidthIterator it(&font, run, 0, false); | 743 WidthIterator it(&font, run, 0, false); |
| (...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1355 if (!element->isStyledElement()) | 1355 if (!element->isStyledElement()) |
| 1356 return nullptr; | 1356 return nullptr; |
| 1357 | 1357 |
| 1358 // FIXME: Ugliness below. | 1358 // FIXME: Ugliness below. |
| 1359 StylePropertySet* attributeStyle = const_cast<StylePropertySet*>(element->pr
esentationAttributeStyle()); | 1359 StylePropertySet* attributeStyle = const_cast<StylePropertySet*>(element->pr
esentationAttributeStyle()); |
| 1360 if (!attributeStyle) | 1360 if (!attributeStyle) |
| 1361 return nullptr; | 1361 return nullptr; |
| 1362 | 1362 |
| 1363 MutableStylePropertySet* mutableAttributeStyle = toMutableStylePropertySet(a
ttributeStyle); | 1363 MutableStylePropertySet* mutableAttributeStyle = toMutableStylePropertySet(a
ttributeStyle); |
| 1364 | 1364 |
| 1365 RefPtr<InspectorStyle> inspectorStyle = InspectorStyle::create(InspectorCSSI
d(), mutableAttributeStyle->ensureCSSStyleDeclaration(), 0); | 1365 RefPtrWillBeRawPtr<InspectorStyle> inspectorStyle = InspectorStyle::create(I
nspectorCSSId(), mutableAttributeStyle->ensureCSSStyleDeclaration(), 0); |
| 1366 return inspectorStyle->buildObjectForStyle(); | 1366 return inspectorStyle->buildObjectForStyle(); |
| 1367 } | 1367 } |
| 1368 | 1368 |
| 1369 void InspectorCSSAgent::didRemoveDocument(Document* document) | 1369 void InspectorCSSAgent::didRemoveDocument(Document* document) |
| 1370 { | 1370 { |
| 1371 if (document) | 1371 if (document) |
| 1372 m_documentToViaInspectorStyleSheet.remove(document); | 1372 m_documentToViaInspectorStyleSheet.remove(document); |
| 1373 } | 1373 } |
| 1374 | 1374 |
| 1375 void InspectorCSSAgent::didRemoveDOMNode(Node* node) | 1375 void InspectorCSSAgent::didRemoveDOMNode(Node* node) |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1446 visitor->trace(m_invalidatedDocuments); | 1446 visitor->trace(m_invalidatedDocuments); |
| 1447 visitor->trace(m_nodeToInspectorStyleSheet); | 1447 visitor->trace(m_nodeToInspectorStyleSheet); |
| 1448 visitor->trace(m_documentToViaInspectorStyleSheet); | 1448 visitor->trace(m_documentToViaInspectorStyleSheet); |
| 1449 #endif | 1449 #endif |
| 1450 visitor->trace(m_inspectorUserAgentStyleSheet); | 1450 visitor->trace(m_inspectorUserAgentStyleSheet); |
| 1451 InspectorBaseAgent::trace(visitor); | 1451 InspectorBaseAgent::trace(visitor); |
| 1452 } | 1452 } |
| 1453 | 1453 |
| 1454 } // namespace blink | 1454 } // namespace blink |
| 1455 | 1455 |
| OLD | NEW |