| 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 756 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 767 pseudoElements->addItem(matches.release()); | 767 pseudoElements->addItem(matches.release()); |
| 768 } | 768 } |
| 769 } | 769 } |
| 770 | 770 |
| 771 pseudoIdMatches = pseudoElements.release(); | 771 pseudoIdMatches = pseudoElements.release(); |
| 772 } | 772 } |
| 773 | 773 |
| 774 // Inherited styles. | 774 // Inherited styles. |
| 775 if (!elementPseudoId && !asBool(excludeInherited)) { | 775 if (!elementPseudoId && !asBool(excludeInherited)) { |
| 776 RefPtr<TypeBuilder::Array<TypeBuilder::CSS::InheritedStyleEntry> > entri
es = TypeBuilder::Array<TypeBuilder::CSS::InheritedStyleEntry>::create(); | 776 RefPtr<TypeBuilder::Array<TypeBuilder::CSS::InheritedStyleEntry> > entri
es = TypeBuilder::Array<TypeBuilder::CSS::InheritedStyleEntry>::create(); |
| 777 Element* parentElement = element->parentElement(); | 777 Element* parentElement = element->parentOrShadowHostElement(); |
| 778 while (parentElement) { | 778 while (parentElement) { |
| 779 StyleResolver& parentStyleResolver = parentElement->ownerDocument()-
>ensureStyleResolver(); | 779 StyleResolver& parentStyleResolver = parentElement->ownerDocument()-
>ensureStyleResolver(); |
| 780 RefPtrWillBeRawPtr<CSSRuleList> parentMatchedRules = parentStyleReso
lver.cssRulesForElement(parentElement, StyleResolver::AllCSSRules); | 780 RefPtrWillBeRawPtr<CSSRuleList> parentMatchedRules = parentStyleReso
lver.cssRulesForElement(parentElement, StyleResolver::AllCSSRules); |
| 781 RefPtr<TypeBuilder::CSS::InheritedStyleEntry> entry = TypeBuilder::C
SS::InheritedStyleEntry::create() | 781 RefPtr<TypeBuilder::CSS::InheritedStyleEntry> entry = TypeBuilder::C
SS::InheritedStyleEntry::create() |
| 782 .setMatchedCSSRules(buildArrayForMatchedRuleList(parentMatchedRu
les.get(), parentElement, NOPSEUDO)); | 782 .setMatchedCSSRules(buildArrayForMatchedRuleList(parentMatchedRu
les.get(), parentElement, NOPSEUDO)); |
| 783 if (parentElement->style() && parentElement->style()->length()) { | 783 if (parentElement->style() && parentElement->style()->length()) { |
| 784 InspectorStyleSheetForInlineStyle* styleSheet = asInspectorStyle
Sheet(parentElement); | 784 InspectorStyleSheetForInlineStyle* styleSheet = asInspectorStyle
Sheet(parentElement); |
| 785 if (styleSheet) | 785 if (styleSheet) |
| 786 entry->setInlineStyle(styleSheet->buildObjectForStyle(styleS
heet->styleAt(0))); | 786 entry->setInlineStyle(styleSheet->buildObjectForStyle(styleS
heet->styleAt(0))); |
| 787 } | 787 } |
| 788 | 788 |
| 789 entries->addItem(entry.release()); | 789 entries->addItem(entry.release()); |
| 790 parentElement = parentElement->parentElement(); | 790 parentElement = parentElement->parentOrShadowHostElement(); |
| 791 } | 791 } |
| 792 | 792 |
| 793 inheritedEntries = entries.release(); | 793 inheritedEntries = entries.release(); |
| 794 } | 794 } |
| 795 } | 795 } |
| 796 | 796 |
| 797 void InspectorCSSAgent::getInlineStylesForNode(ErrorString* errorString, int nod
eId, RefPtr<TypeBuilder::CSS::CSSStyle>& inlineStyle, RefPtr<TypeBuilder::CSS::C
SSStyle>& attributesStyle) | 797 void InspectorCSSAgent::getInlineStylesForNode(ErrorString* errorString, int nod
eId, RefPtr<TypeBuilder::CSS::CSSStyle>& inlineStyle, RefPtr<TypeBuilder::CSS::C
SSStyle>& attributesStyle) |
| 798 { | 798 { |
| 799 Element* element = elementForId(errorString, nodeId); | 799 Element* element = elementForId(errorString, nodeId); |
| 800 if (!element) | 800 if (!element) |
| (...skipping 788 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1589 visitor->trace(m_invalidatedDocuments); | 1589 visitor->trace(m_invalidatedDocuments); |
| 1590 visitor->trace(m_nodeToInspectorStyleSheet); | 1590 visitor->trace(m_nodeToInspectorStyleSheet); |
| 1591 visitor->trace(m_documentToViaInspectorStyleSheet); | 1591 visitor->trace(m_documentToViaInspectorStyleSheet); |
| 1592 #endif | 1592 #endif |
| 1593 visitor->trace(m_inspectorUserAgentStyleSheet); | 1593 visitor->trace(m_inspectorUserAgentStyleSheet); |
| 1594 InspectorBaseAgent::trace(visitor); | 1594 InspectorBaseAgent::trace(visitor); |
| 1595 } | 1595 } |
| 1596 | 1596 |
| 1597 } // namespace blink | 1597 } // namespace blink |
| 1598 | 1598 |
| OLD | NEW |