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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
87 CSSParser::parseSheet(CSSParserContext(*document, 0), styleSheetContents.get (), text); | 87 CSSParser::parseSheet(CSSParserContext(*document, 0), styleSheetContents.get (), text); |
88 | 88 |
89 RefPtrWillBeRawPtr<CSSStyleSheet> styleSheet = CSSStyleSheet::create(styleSh eetContents); | 89 RefPtrWillBeRawPtr<CSSStyleSheet> styleSheet = CSSStyleSheet::create(styleSh eetContents); |
90 CSSStyleRule* rule = toCSSStyleRule(styleSheet->item(0)); | 90 CSSStyleRule* rule = toCSSStyleRule(styleSheet->item(0)); |
91 CSSStyleDeclaration* style = rule->style(); | 91 CSSStyleDeclaration* style = rule->style(); |
92 TrackExceptionState exceptionState; | 92 TrackExceptionState exceptionState; |
93 style->setProperty(longhand, newValue, style->getPropertyPriority(longhand), exceptionState); | 93 style->setProperty(longhand, newValue, style->getPropertyPriority(longhand), exceptionState); |
94 return style->getPropertyValue(shorthand); | 94 return style->getPropertyValue(shorthand); |
95 } | 95 } |
96 | 96 |
97 PassRefPtrWillBeRawPtr<CSSRuleList> filterDuplicateRules(RefPtrWillBeRawPtr<CSSR uleList> ruleList) | |
98 { | |
99 if (!ruleList) | |
100 return nullptr; | |
101 | |
102 HashSet<CSSStyleRule*> uniqRulesSet; | |
103 RefPtrWillBeRawPtr<StaticCSSRuleList> uniqRules = StaticCSSRuleList::create( ); | |
104 for (unsigned i = ruleList->length(); i > 0; --i) { | |
105 CSSRule* rule = ruleList->item(i - 1); | |
106 if (!rule || rule->type() != CSSRule::STYLE_RULE) | |
107 continue; | |
108 | |
109 CSSStyleRule* styleRule = toCSSStyleRule(rule); | |
110 if (uniqRulesSet.contains(styleRule)) | |
111 continue; | |
112 uniqRulesSet.add(styleRule); | |
113 uniqRules->rules().prepend(styleRule); | |
dgozman
2015/09/03 23:04:20
Drop the n^2.
| |
114 } | |
115 return uniqRules.release(); | |
116 } | |
117 | |
97 } // namespace | 118 } // namespace |
98 | 119 |
99 namespace CSSAgentState { | 120 namespace CSSAgentState { |
100 static const char cssAgentEnabled[] = "cssAgentEnabled"; | 121 static const char cssAgentEnabled[] = "cssAgentEnabled"; |
101 } | 122 } |
102 | 123 |
103 typedef blink::InspectorBackendDispatcher::CSSCommandHandler::EnableCallback Ena bleCallback; | 124 typedef blink::InspectorBackendDispatcher::CSSCommandHandler::EnableCallback Ena bleCallback; |
104 | 125 |
105 namespace blink { | 126 namespace blink { |
106 | 127 |
(...skipping 1279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1386 // We should come up with a solution for matching pseudo-element selectors a gainst ordinary Elements, too. | 1407 // We should come up with a solution for matching pseudo-element selectors a gainst ordinary Elements, too. |
1387 return selectorPseudoId == elementPseudoId; | 1408 return selectorPseudoId == elementPseudoId; |
1388 } | 1409 } |
1389 | 1410 |
1390 PassRefPtr<TypeBuilder::Array<TypeBuilder::CSS::RuleMatch> > InspectorCSSAgent:: buildArrayForMatchedRuleList(CSSRuleList* ruleList, Element* element, PseudoId m atchesForPseudoId) | 1411 PassRefPtr<TypeBuilder::Array<TypeBuilder::CSS::RuleMatch> > InspectorCSSAgent:: buildArrayForMatchedRuleList(CSSRuleList* ruleList, Element* element, PseudoId m atchesForPseudoId) |
1391 { | 1412 { |
1392 RefPtr<TypeBuilder::Array<TypeBuilder::CSS::RuleMatch> > result = TypeBuilde r::Array<TypeBuilder::CSS::RuleMatch>::create(); | 1413 RefPtr<TypeBuilder::Array<TypeBuilder::CSS::RuleMatch> > result = TypeBuilde r::Array<TypeBuilder::CSS::RuleMatch>::create(); |
1393 if (!ruleList) | 1414 if (!ruleList) |
1394 return result.release(); | 1415 return result.release(); |
1395 | 1416 |
1396 HashSet<CSSStyleRule*> uniqRulesSet; | 1417 RefPtrWillBeRawPtr<CSSRuleList> uniqRules = filterDuplicateRules(ruleList); |
1397 Vector<CSSStyleRule*> uniqRules; | |
1398 for (unsigned i = ruleList->length(); i > 0; --i) { | |
1399 CSSStyleRule* rule = asCSSStyleRule(ruleList->item(i - 1)); | |
1400 if (uniqRulesSet.contains(rule)) | |
1401 continue; | |
1402 uniqRulesSet.add(rule); | |
1403 uniqRules.append(rule); | |
1404 } | |
1405 | 1418 |
1406 for (unsigned i = uniqRules.size(); i > 0; --i) { | 1419 for (unsigned i = uniqRules->length(); i > 0; --i) { |
1407 CSSStyleRule* rule = uniqRules.at(i - 1); | 1420 CSSStyleRule* rule = asCSSStyleRule(uniqRules->item(i - 1)); |
1408 RefPtr<TypeBuilder::CSS::CSSRule> ruleObject = buildObjectForRule(rule); | 1421 RefPtr<TypeBuilder::CSS::CSSRule> ruleObject = buildObjectForRule(rule); |
1409 if (!ruleObject) | 1422 if (!ruleObject) |
1410 continue; | 1423 continue; |
1411 RefPtr<TypeBuilder::Array<int> > matchingSelectors = TypeBuilder::Array< int>::create(); | 1424 RefPtr<TypeBuilder::Array<int> > matchingSelectors = TypeBuilder::Array< int>::create(); |
1412 const CSSSelectorList& selectorList = rule->styleRule()->selectorList(); | 1425 const CSSSelectorList& selectorList = rule->styleRule()->selectorList(); |
1413 long index = 0; | 1426 long index = 0; |
1414 PseudoId elementPseudoId = matchesForPseudoId ? matchesForPseudoId : ele ment->pseudoId(); | 1427 PseudoId elementPseudoId = matchesForPseudoId ? matchesForPseudoId : ele ment->pseudoId(); |
1415 for (const CSSSelector* selector = selectorList.first(); selector; selec tor = CSSSelectorList::next(*selector)) { | 1428 for (const CSSSelector* selector = selectorList.first(); selector; selec tor = CSSSelectorList::next(*selector)) { |
1416 const CSSSelector* firstTagHistorySelector = selector; | 1429 const CSSSelector* firstTagHistorySelector = selector; |
1417 bool matched = false; | 1430 bool matched = false; |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1508 Element* element = toElement(m_domAgent->nodeForId(state.key)); | 1521 Element* element = toElement(m_domAgent->nodeForId(state.key)); |
1509 if (element && element->ownerDocument()) | 1522 if (element && element->ownerDocument()) |
1510 documentsToChange.add(element->ownerDocument()); | 1523 documentsToChange.add(element->ownerDocument()); |
1511 } | 1524 } |
1512 | 1525 |
1513 m_nodeIdToForcedPseudoState.clear(); | 1526 m_nodeIdToForcedPseudoState.clear(); |
1514 for (auto& document : documentsToChange) | 1527 for (auto& document : documentsToChange) |
1515 document->setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTr acing::create(StyleChangeReason::Inspector)); | 1528 document->setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTr acing::create(StyleChangeReason::Inspector)); |
1516 } | 1529 } |
1517 | 1530 |
1518 PassRefPtrWillBeRawPtr<CSSStyleDeclaration> InspectorCSSAgent::findEffectiveDecl aration(Element* element, CSSPropertyID propertyId) | 1531 PassRefPtrWillBeRawPtr<CSSRuleList> InspectorCSSAgent::matchedRulesList(Element* element) |
1519 { | 1532 { |
1520 PseudoId elementPseudoId = element->pseudoId(); | 1533 PseudoId elementPseudoId = element->pseudoId(); |
1521 CSSStyleDeclaration* inlineStyle = element->style(); | |
1522 | |
1523 if (elementPseudoId) { | 1534 if (elementPseudoId) { |
1524 element = element->parentOrShadowHostElement(); | 1535 element = element->parentOrShadowHostElement(); |
1525 if (!element) | 1536 if (!element) |
1526 return nullptr; | 1537 return nullptr; |
1527 } | 1538 } |
1528 | 1539 |
1529 Document* ownerDocument = element->ownerDocument(); | 1540 Document* ownerDocument = element->ownerDocument(); |
1530 // A non-active document has no styles. | 1541 // A non-active document has no styles. |
1531 if (!ownerDocument->isActive()) | 1542 if (!ownerDocument->isActive()) |
1532 return nullptr; | 1543 return nullptr; |
1533 | 1544 |
1545 StyleResolver& styleResolver = ownerDocument->ensureStyleResolver(); | |
1546 element->updateDistribution(); | |
1547 return filterDuplicateRules(styleResolver.pseudoCSSRulesForElement(element, elementPseudoId, StyleResolver::AllCSSRules)); | |
1548 } | |
1549 | |
1550 PassRefPtrWillBeRawPtr<CSSStyleDeclaration> InspectorCSSAgent::findEffectiveDecl aration(CSSPropertyID propertyId, CSSRuleList* ruleList, CSSStyleDeclaration* in lineStyle) | |
1551 { | |
1552 if (!ruleList && !inlineStyle) | |
1553 return nullptr; | |
1554 | |
1534 String longhand = getPropertyNameString(propertyId); | 1555 String longhand = getPropertyNameString(propertyId); |
1535 | |
1536 RefPtrWillBeRawPtr<CSSStyleDeclaration> foundStyle = nullptr; | 1556 RefPtrWillBeRawPtr<CSSStyleDeclaration> foundStyle = nullptr; |
1537 bool isImportant = false; | 1557 bool isImportant = false; |
1538 | 1558 |
1539 if (inlineStyle && !inlineStyle->getPropertyValue(longhand).isEmpty()) { | 1559 if (inlineStyle && !inlineStyle->getPropertyValue(longhand).isEmpty()) { |
1540 foundStyle = inlineStyle; | 1560 foundStyle = inlineStyle; |
1541 isImportant = inlineStyle->getPropertyPriority(longhand) == "important"; | 1561 isImportant = inlineStyle->getPropertyPriority(longhand) == "important"; |
1542 } | 1562 } |
1543 | 1563 |
1544 StyleResolver& styleResolver = ownerDocument->ensureStyleResolver(); | |
1545 element->updateDistribution(); | |
1546 RefPtrWillBeRawPtr<CSSRuleList> ruleList = styleResolver.pseudoCSSRulesForEl ement(element, elementPseudoId, StyleResolver::AllCSSRules); | |
1547 | |
1548 for (unsigned i = 0, size = ruleList ? ruleList->length() : 0; i < size; ++i ) { | 1564 for (unsigned i = 0, size = ruleList ? ruleList->length() : 0; i < size; ++i ) { |
1549 if (isImportant) | 1565 if (isImportant) |
1550 break; | 1566 break; |
1551 | 1567 |
1552 if (ruleList->item(size - i - 1)->type() != CSSRule::STYLE_RULE) | 1568 if (ruleList->item(size - i - 1)->type() != CSSRule::STYLE_RULE) |
1553 continue; | 1569 continue; |
1554 | 1570 |
1555 CSSStyleRule* rule = toCSSStyleRule(ruleList->item(size - i - 1)); | 1571 CSSStyleRule* rule = toCSSStyleRule(ruleList->item(size - i - 1)); |
1556 if (!rule) | 1572 if (!rule) |
1557 continue; | 1573 continue; |
1558 | 1574 |
1559 CSSStyleDeclaration* style = rule->style(); | 1575 CSSStyleDeclaration* style = rule->style(); |
1560 if (!style) | 1576 if (!style) |
1561 continue; | 1577 continue; |
1562 | 1578 |
1563 if (style->getPropertyValue(longhand).isEmpty()) | 1579 if (style->getPropertyValue(longhand).isEmpty()) |
1564 continue; | 1580 continue; |
1565 | 1581 |
1566 isImportant = style->getPropertyPriority(longhand) == "important"; | 1582 isImportant = style->getPropertyPriority(longhand) == "important"; |
1567 if (isImportant || !foundStyle) | 1583 if (isImportant || !foundStyle) |
1568 foundStyle = style; | 1584 foundStyle = style; |
1569 } | 1585 } |
1570 | 1586 |
1571 return foundStyle.release(); | 1587 return foundStyle.release(); |
1572 } | 1588 } |
1573 | 1589 |
1574 void InspectorCSSAgent::setCSSPropertyValue(ErrorString* errorString, Element* e lement, CSSPropertyID propertyId, const String& value) | 1590 void InspectorCSSAgent::setCSSPropertyValue(ErrorString* errorString, Element* e lement, RefPtrWillBeRawPtr<CSSStyleDeclaration> style, CSSPropertyID propertyId, const String& value, bool forceImportant) |
1575 { | 1591 { |
1576 Document* ownerDocument = element->ownerDocument(); | |
1577 if (!ownerDocument->isActive()) { | |
1578 *errorString = "Can't edit a node from a non-active document"; | |
1579 return; | |
1580 } | |
1581 | |
1582 Vector<StylePropertyShorthand, 4> shorthands; | |
1583 getMatchingShorthandsForLonghand(propertyId, &shorthands); | |
1584 | |
1585 String shorthand = shorthands.size() > 0 ? getPropertyNameString(shorthands [0].id()) : String(); | |
1586 String longhand = getPropertyNameString(propertyId); | |
1587 | |
1588 RefPtrWillBeRawPtr<CSSStyleDeclaration> foundStyle = findEffectiveDeclaratio n(element, propertyId); | |
1589 CSSStyleDeclaration* inlineStyle = element->style(); | |
1590 if (!foundStyle || !foundStyle->parentStyleSheet()) | |
1591 foundStyle = inlineStyle; | |
1592 | |
1593 if (!foundStyle) { | |
1594 *errorString = "Can't find a style to edit"; | |
1595 return; | |
1596 } | |
1597 | |
1598 InspectorStyleSheetBase* inspectorStyleSheet = nullptr; | 1592 InspectorStyleSheetBase* inspectorStyleSheet = nullptr; |
1599 RefPtrWillBeRawPtr<CSSRuleSourceData> sourceData = nullptr; | 1593 RefPtrWillBeRawPtr<CSSRuleSourceData> sourceData = nullptr; |
1600 if (foundStyle != inlineStyle) { | 1594 // An absence of the parent rule means that given style is an inline style. |
1601 InspectorStyleSheet* styleSheet = bindStyleSheet(foundStyle->parentStyl eSheet()); | 1595 if (style->parentRule()) { |
1596 InspectorStyleSheet* styleSheet = bindStyleSheet(style->parentStyleSheet ()); | |
1602 inspectorStyleSheet = styleSheet; | 1597 inspectorStyleSheet = styleSheet; |
1603 sourceData = styleSheet->sourceDataForRule(foundStyle->parentRule()); | 1598 sourceData = styleSheet->sourceDataForRule(style->parentRule()); |
1604 } | 1599 } else { |
1605 | |
1606 if (!sourceData) { | |
1607 InspectorStyleSheetForInlineStyle* inlineStyleSheet = asInspectorStyleSh eet(element); | 1600 InspectorStyleSheetForInlineStyle* inlineStyleSheet = asInspectorStyleSh eet(element); |
1608 inspectorStyleSheet = inlineStyleSheet; | 1601 inspectorStyleSheet = inlineStyleSheet; |
1609 sourceData = inlineStyleSheet->ruleSourceData(); | 1602 sourceData = inlineStyleSheet->ruleSourceData(); |
1610 } | 1603 } |
1611 | 1604 |
1612 if (!sourceData) { | 1605 if (!sourceData) { |
1613 *errorString = "Can't find a source to edit"; | 1606 *errorString = "Can't find a source to edit"; |
1614 return; | 1607 return; |
1615 } | 1608 } |
1616 | 1609 |
1610 Vector<StylePropertyShorthand, 4> shorthands; | |
1611 getMatchingShorthandsForLonghand(propertyId, &shorthands); | |
1612 | |
1613 String shorthand = shorthands.size() > 0 ? getPropertyNameString(shorthands [0].id()) : String(); | |
1614 String longhand = getPropertyNameString(propertyId); | |
1615 | |
1617 int foundIndex = -1; | 1616 int foundIndex = -1; |
1618 WillBeHeapVector<CSSPropertySourceData> properties = sourceData->styleSource Data->propertyData; | 1617 WillBeHeapVector<CSSPropertySourceData> properties = sourceData->styleSource Data->propertyData; |
1619 for (unsigned i = 0; i < properties.size(); ++i) { | 1618 for (unsigned i = 0; i < properties.size(); ++i) { |
1620 CSSPropertySourceData property = properties[properties.size() - i - 1]; | 1619 CSSPropertySourceData property = properties[properties.size() - i - 1]; |
1621 String name = property.name; | 1620 String name = property.name; |
1622 if (property.disabled) | 1621 if (property.disabled) |
1623 continue; | 1622 continue; |
1624 | 1623 |
1625 if (name != shorthand && name != longhand) | 1624 if (name != shorthand && name != longhand) |
1626 continue; | 1625 continue; |
1627 | 1626 |
1628 if (property.important || foundIndex == -1) | 1627 if (property.important || foundIndex == -1) |
1629 foundIndex = properties.size() - i - 1; | 1628 foundIndex = properties.size() - i - 1; |
1630 | 1629 |
1631 if (property.important) | 1630 if (property.important) |
1632 break; | 1631 break; |
1633 } | 1632 } |
1634 | 1633 |
1635 SourceRange bodyRange = sourceData->ruleBodyRange; | 1634 SourceRange bodyRange = sourceData->ruleBodyRange; |
1636 String styleSheetText; | 1635 String styleSheetText; |
1637 inspectorStyleSheet->getText(&styleSheetText); | 1636 inspectorStyleSheet->getText(&styleSheetText); |
1638 String styleText = styleSheetText.substring(bodyRange.start, bodyRange.lengt h()); | 1637 String styleText = styleSheetText.substring(bodyRange.start, bodyRange.lengt h()); |
1639 SourceRange changeRange; | 1638 SourceRange changeRange; |
1640 if (foundIndex == -1) { | 1639 if (foundIndex == -1) { |
1641 bool isImportant = inlineStyle->getPropertyPriority(longhand) == "import ant"; | 1640 String newPropertyText = "\n" + longhand + ": " + value + (forceImportan t ? " !important" : "") + ";"; |
1642 String newPropertyText = "\n" + longhand + ": " + value + (isImportant ? " !important" : "") + ";"; | |
1643 if (!styleText.isEmpty() && !styleText.stripWhiteSpace().endsWith(';')) | 1641 if (!styleText.isEmpty() && !styleText.stripWhiteSpace().endsWith(';')) |
1644 newPropertyText = ";" + newPropertyText; | 1642 newPropertyText = ";" + newPropertyText; |
1645 styleText.append(newPropertyText); | 1643 styleText.append(newPropertyText); |
1646 changeRange.start = bodyRange.end; | 1644 changeRange.start = bodyRange.end; |
1647 changeRange.end = bodyRange.end + newPropertyText.length(); | 1645 changeRange.end = bodyRange.end + newPropertyText.length(); |
1648 } else { | 1646 } else { |
1649 CSSPropertySourceData declaration = properties[foundIndex]; | 1647 CSSPropertySourceData declaration = properties[foundIndex]; |
1650 String newValueText; | 1648 String newValueText; |
1651 if (declaration.name == shorthand) | 1649 if (declaration.name == shorthand) |
1652 newValueText = createShorthandValue(ownerDocument, shorthand, declar ation.value, longhand, value); | 1650 newValueText = createShorthandValue(element->ownerDocument(), shorth and, declaration.value, longhand, value); |
1653 else | 1651 else |
1654 newValueText = value; | 1652 newValueText = value; |
1655 | 1653 |
1656 String newPropertyText = declaration.name + ": " + newValueText + (decla ration.important ? " !important" : "") + ";"; | 1654 String newPropertyText = declaration.name + ": " + newValueText + (decla ration.important || forceImportant ? " !important" : "") + ";"; |
1657 styleText.replace(declaration.range.start - bodyRange.start, declaration .range.length(), newPropertyText); | 1655 styleText.replace(declaration.range.start - bodyRange.start, declaration .range.length(), newPropertyText); |
1658 changeRange.start = declaration.range.start; | 1656 changeRange.start = declaration.range.start; |
1659 changeRange.end = changeRange.start + newPropertyText.length(); | 1657 changeRange.end = changeRange.start + newPropertyText.length(); |
1660 } | 1658 } |
1661 CSSStyleDeclaration* resultStyle = setStyleText(errorString, inspectorStyleS heet, bodyRange, styleText); | 1659 CSSStyleDeclaration* resultStyle = setStyleText(errorString, inspectorStyleS heet, bodyRange, styleText); |
1662 if (resultStyle) { | 1660 if (resultStyle) { |
1663 frontend()->layoutEditorChange(inspectorStyleSheet->id(), inspectorStyle Sheet->buildSourceRangeObject(changeRange)); | 1661 frontend()->layoutEditorChange(inspectorStyleSheet->id(), inspectorStyle Sheet->buildSourceRangeObject(changeRange)); |
1664 frontend()->flush(); | 1662 frontend()->flush(); |
1665 } | 1663 } |
1666 } | 1664 } |
1667 | 1665 |
1668 void InspectorCSSAgent::setEffectivePropertyValueForNode(ErrorString* errorStrin g, int nodeId, const String& propertyName, const String& value) | 1666 void InspectorCSSAgent::setEffectivePropertyValueForNode(ErrorString* errorStrin g, int nodeId, const String& propertyName, const String& value) |
1669 { | 1667 { |
1668 // TODO: move testing from CSSAgent to layout editor. | |
1670 Element* element = elementForId(errorString, nodeId); | 1669 Element* element = elementForId(errorString, nodeId); |
1671 if (!element) | 1670 if (!element) |
1672 return; | 1671 return; |
1673 | 1672 |
1674 CSSPropertyID property = cssPropertyID(propertyName); | 1673 CSSPropertyID property = cssPropertyID(propertyName); |
1675 if (!property) { | 1674 if (!property) { |
1676 *errorString = "Invalid property name"; | 1675 *errorString = "Invalid property name"; |
1677 return; | 1676 return; |
1678 } | 1677 } |
1679 setCSSPropertyValue(errorString, element, cssPropertyID(propertyName), value ); | 1678 |
1679 Document* ownerDocument = element->ownerDocument(); | |
1680 if (!ownerDocument->isActive()) { | |
1681 *errorString = "Can't edit a node from a non-active document"; | |
1682 return; | |
1683 } | |
1684 | |
1685 CSSPropertyID propertyId = cssPropertyID(propertyName); | |
1686 CSSStyleDeclaration* inlineStyle = element->style(); | |
1687 RefPtrWillBeRawPtr<CSSRuleList> ruleList = matchedRulesList(element); | |
1688 RefPtrWillBeRawPtr<CSSStyleDeclaration> foundStyle = findEffectiveDeclaratio n(propertyId, ruleList.get(), inlineStyle); | |
1689 if (!foundStyle || !foundStyle->parentStyleSheet()) | |
1690 foundStyle = inlineStyle; | |
1691 | |
1692 if (!foundStyle) { | |
1693 *errorString = "Can't find a style to edit"; | |
1694 return; | |
1695 } | |
1696 | |
1697 setCSSPropertyValue(errorString, element, foundStyle.get(), propertyId, valu e); | |
1680 } | 1698 } |
1681 | 1699 |
1682 DEFINE_TRACE(InspectorCSSAgent) | 1700 DEFINE_TRACE(InspectorCSSAgent) |
1683 { | 1701 { |
1684 visitor->trace(m_domAgent); | 1702 visitor->trace(m_domAgent); |
1685 visitor->trace(m_pageAgent); | 1703 visitor->trace(m_pageAgent); |
1686 visitor->trace(m_resourceAgent); | 1704 visitor->trace(m_resourceAgent); |
1687 visitor->trace(m_resourceContentLoader); | 1705 visitor->trace(m_resourceContentLoader); |
1688 #if ENABLE(OILPAN) | 1706 #if ENABLE(OILPAN) |
1689 visitor->trace(m_idToInspectorStyleSheet); | 1707 visitor->trace(m_idToInspectorStyleSheet); |
1690 visitor->trace(m_idToInspectorStyleSheetForInlineStyle); | 1708 visitor->trace(m_idToInspectorStyleSheetForInlineStyle); |
1691 visitor->trace(m_cssStyleSheetToInspectorStyleSheet); | 1709 visitor->trace(m_cssStyleSheetToInspectorStyleSheet); |
1692 visitor->trace(m_documentToCSSStyleSheets); | 1710 visitor->trace(m_documentToCSSStyleSheets); |
1693 visitor->trace(m_invalidatedDocuments); | 1711 visitor->trace(m_invalidatedDocuments); |
1694 visitor->trace(m_nodeToInspectorStyleSheet); | 1712 visitor->trace(m_nodeToInspectorStyleSheet); |
1695 visitor->trace(m_documentToViaInspectorStyleSheet); | 1713 visitor->trace(m_documentToViaInspectorStyleSheet); |
1696 #endif | 1714 #endif |
1697 visitor->trace(m_inspectorUserAgentStyleSheet); | 1715 visitor->trace(m_inspectorUserAgentStyleSheet); |
1698 InspectorBaseAgent::trace(visitor); | 1716 InspectorBaseAgent::trace(visitor); |
1699 } | 1717 } |
1700 | 1718 |
1701 } // namespace blink | 1719 } // namespace blink |
OLD | NEW |