| 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 764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 775 RefPtr<TypeBuilder::Array<TypeBuilder::CSS::InheritedStyleEntry> > entri
es = TypeBuilder::Array<TypeBuilder::CSS::InheritedStyleEntry>::create(); | 775 RefPtr<TypeBuilder::Array<TypeBuilder::CSS::InheritedStyleEntry> > entri
es = TypeBuilder::Array<TypeBuilder::CSS::InheritedStyleEntry>::create(); |
| 776 Element* parentElement = element->parentOrShadowHostElement(); | 776 Element* parentElement = element->parentOrShadowHostElement(); |
| 777 while (parentElement) { | 777 while (parentElement) { |
| 778 StyleResolver& parentStyleResolver = parentElement->ownerDocument()-
>ensureStyleResolver(); | 778 StyleResolver& parentStyleResolver = parentElement->ownerDocument()-
>ensureStyleResolver(); |
| 779 RefPtrWillBeRawPtr<CSSRuleList> parentMatchedRules = parentStyleReso
lver.cssRulesForElement(parentElement, StyleResolver::AllCSSRules); | 779 RefPtrWillBeRawPtr<CSSRuleList> parentMatchedRules = parentStyleReso
lver.cssRulesForElement(parentElement, StyleResolver::AllCSSRules); |
| 780 RefPtr<TypeBuilder::CSS::InheritedStyleEntry> entry = TypeBuilder::C
SS::InheritedStyleEntry::create() | 780 RefPtr<TypeBuilder::CSS::InheritedStyleEntry> entry = TypeBuilder::C
SS::InheritedStyleEntry::create() |
| 781 .setMatchedCSSRules(buildArrayForMatchedRuleList(parentMatchedRu
les.get(), parentElement, NOPSEUDO)); | 781 .setMatchedCSSRules(buildArrayForMatchedRuleList(parentMatchedRu
les.get(), parentElement, NOPSEUDO)); |
| 782 if (parentElement->style() && parentElement->style()->length()) { | 782 if (parentElement->style() && parentElement->style()->length()) { |
| 783 InspectorStyleSheetForInlineStyle* styleSheet = asInspectorStyle
Sheet(parentElement); | 783 InspectorStyleSheetForInlineStyle* styleSheet = asInspectorStyle
Sheet(parentElement); |
| 784 if (styleSheet) | 784 if (styleSheet) |
| 785 entry->setInlineStyle(styleSheet->buildObjectForStyle(styleS
heet->styleAt(0))); | 785 entry->setInlineStyle(styleSheet->buildObjectForStyle(styleS
heet->inlineStyle())); |
| 786 } | 786 } |
| 787 | 787 |
| 788 entries->addItem(entry.release()); | 788 entries->addItem(entry.release()); |
| 789 parentElement = parentElement->parentOrShadowHostElement(); | 789 parentElement = parentElement->parentOrShadowHostElement(); |
| 790 } | 790 } |
| 791 | 791 |
| 792 inheritedEntries = entries.release(); | 792 inheritedEntries = entries.release(); |
| 793 } | 793 } |
| 794 } | 794 } |
| 795 | 795 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 808 attributesStyle = attributes ? attributes.release() : nullptr; | 808 attributesStyle = attributes ? attributes.release() : nullptr; |
| 809 } | 809 } |
| 810 | 810 |
| 811 void InspectorCSSAgent::getComputedStyleForNode(ErrorString* errorString, int no
deId, RefPtr<TypeBuilder::Array<TypeBuilder::CSS::CSSComputedStyleProperty> >& s
tyle) | 811 void InspectorCSSAgent::getComputedStyleForNode(ErrorString* errorString, int no
deId, RefPtr<TypeBuilder::Array<TypeBuilder::CSS::CSSComputedStyleProperty> >& s
tyle) |
| 812 { | 812 { |
| 813 Node* node = m_domAgent->assertNode(errorString, nodeId); | 813 Node* node = m_domAgent->assertNode(errorString, nodeId); |
| 814 if (!node) | 814 if (!node) |
| 815 return; | 815 return; |
| 816 | 816 |
| 817 RefPtrWillBeRawPtr<CSSComputedStyleDeclaration> computedStyleInfo = CSSCompu
tedStyleDeclaration::create(node, true); | 817 RefPtrWillBeRawPtr<CSSComputedStyleDeclaration> computedStyleInfo = CSSCompu
tedStyleDeclaration::create(node, true); |
| 818 RefPtrWillBeRawPtr<InspectorStyle> inspectorStyle = InspectorStyle::create(0
, computedStyleInfo, 0); | 818 RefPtrWillBeRawPtr<InspectorStyle> inspectorStyle = InspectorStyle::create(c
omputedStyleInfo, nullptr, nullptr); |
| 819 style = inspectorStyle->buildArrayForComputedStyle(); | 819 style = inspectorStyle->buildArrayForComputedStyle(); |
| 820 } | 820 } |
| 821 | 821 |
| 822 void InspectorCSSAgent::collectPlatformFontsForLayoutObject(LayoutObject* layout
Object, HashCountedSet<String>* fontStats) | 822 void InspectorCSSAgent::collectPlatformFontsForLayoutObject(LayoutObject* layout
Object, HashCountedSet<String>* fontStats) |
| 823 { | 823 { |
| 824 if (!layoutObject->isText()) | 824 if (!layoutObject->isText()) |
| 825 return; | 825 return; |
| 826 LayoutText* layoutText = toLayoutText(layoutObject); | 826 LayoutText* layoutText = toLayoutText(layoutObject); |
| 827 for (InlineTextBox* box = layoutText->firstTextBox(); box; box = box->nextTe
xtBox()) { | 827 for (InlineTextBox* box = layoutText->firstTextBox(); box; box = box->nextTe
xtBox()) { |
| 828 const ComputedStyle& style = layoutText->styleRef(box->isFirstLineStyle(
)); | 828 const ComputedStyle& style = layoutText->styleRef(box->isFirstLineStyle(
)); |
| (...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1475 if (!element->isStyledElement()) | 1475 if (!element->isStyledElement()) |
| 1476 return nullptr; | 1476 return nullptr; |
| 1477 | 1477 |
| 1478 // FIXME: Ugliness below. | 1478 // FIXME: Ugliness below. |
| 1479 StylePropertySet* attributeStyle = const_cast<StylePropertySet*>(element->pr
esentationAttributeStyle()); | 1479 StylePropertySet* attributeStyle = const_cast<StylePropertySet*>(element->pr
esentationAttributeStyle()); |
| 1480 if (!attributeStyle) | 1480 if (!attributeStyle) |
| 1481 return nullptr; | 1481 return nullptr; |
| 1482 | 1482 |
| 1483 MutableStylePropertySet* mutableAttributeStyle = toMutableStylePropertySet(a
ttributeStyle); | 1483 MutableStylePropertySet* mutableAttributeStyle = toMutableStylePropertySet(a
ttributeStyle); |
| 1484 | 1484 |
| 1485 RefPtrWillBeRawPtr<InspectorStyle> inspectorStyle = InspectorStyle::create(0
, mutableAttributeStyle->ensureCSSStyleDeclaration(), 0); | 1485 RefPtrWillBeRawPtr<InspectorStyle> inspectorStyle = InspectorStyle::create(m
utableAttributeStyle->ensureCSSStyleDeclaration(), nullptr, nullptr); |
| 1486 return inspectorStyle->buildObjectForStyle(); | 1486 return inspectorStyle->buildObjectForStyle(); |
| 1487 } | 1487 } |
| 1488 | 1488 |
| 1489 void InspectorCSSAgent::didRemoveDocument(Document* document) | 1489 void InspectorCSSAgent::didRemoveDocument(Document* document) |
| 1490 { | 1490 { |
| 1491 if (document) | 1491 if (document) |
| 1492 m_documentToViaInspectorStyleSheet.remove(document); | 1492 m_documentToViaInspectorStyleSheet.remove(document); |
| 1493 } | 1493 } |
| 1494 | 1494 |
| 1495 void InspectorCSSAgent::didRemoveDOMNode(Node* node) | 1495 void InspectorCSSAgent::didRemoveDOMNode(Node* node) |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1565 visitor->trace(m_documentToCSSStyleSheets); | 1565 visitor->trace(m_documentToCSSStyleSheets); |
| 1566 visitor->trace(m_invalidatedDocuments); | 1566 visitor->trace(m_invalidatedDocuments); |
| 1567 visitor->trace(m_nodeToInspectorStyleSheet); | 1567 visitor->trace(m_nodeToInspectorStyleSheet); |
| 1568 visitor->trace(m_documentToViaInspectorStyleSheet); | 1568 visitor->trace(m_documentToViaInspectorStyleSheet); |
| 1569 #endif | 1569 #endif |
| 1570 visitor->trace(m_inspectorUserAgentStyleSheet); | 1570 visitor->trace(m_inspectorUserAgentStyleSheet); |
| 1571 InspectorBaseAgent::trace(visitor); | 1571 InspectorBaseAgent::trace(visitor); |
| 1572 } | 1572 } |
| 1573 | 1573 |
| 1574 } // namespace blink | 1574 } // namespace blink |
| OLD | NEW |