Index: Source/core/inspector/LayoutEditor.cpp |
diff --git a/Source/core/inspector/LayoutEditor.cpp b/Source/core/inspector/LayoutEditor.cpp |
index 25436dfb84399b523879286ca3d570fd0ad49501..863b45c4b4e0dea980a77cc9df8436ba8831d093 100644 |
--- a/Source/core/inspector/LayoutEditor.cpp |
+++ b/Source/core/inspector/LayoutEditor.cpp |
@@ -293,7 +293,7 @@ void LayoutEditor::overlayPropertyChanged(float cssDelta) |
if (m_changingProperty && m_factor) { |
String errorString; |
float newValue = toValidValue(m_changingProperty, cssDelta / m_factor + m_propertyInitialValue); |
- m_cssAgent->setCSSPropertyValue(&errorString, m_element.get(), m_changingProperty, truncateZeroes(String::format("%.2f", newValue)) + CSSPrimitiveValue::unitTypeToString(m_valueUnitType)); |
+ m_cssAgent->setCSSPropertyValueInRule(&errorString, m_element.get(), m_currentRuleIndex == -1 ? nullptr : m_matchedRules[m_currentRuleIndex].get(), m_changingProperty, truncateZeroes(String::format("%.2f", newValue)) + CSSPrimitiveValue::unitTypeToString(m_valueUnitType)); |
dgozman
2015/09/02 22:26:17
I don't like nullptr as an indicator of inline sty
sergeyv
2015/09/03 00:52:28
Done.
|
if (!errorString) |
m_isDirty = true; |
} |
@@ -327,16 +327,7 @@ void LayoutEditor::initializeCSSRules() |
if (!m_element) |
return; |
- Document* ownerDocument = m_element->ownerDocument(); |
- // A non-active document has no styles. |
- if (!ownerDocument->isActive()) |
- return; |
- |
- // Matched rules. |
- StyleResolver& styleResolver = ownerDocument->ensureStyleResolver(); |
- PseudoId elementPseudoId = m_element->pseudoId(); |
- m_element->updateDistribution(); |
- RefPtrWillBeRawPtr<CSSRuleList> matchedRules = styleResolver.pseudoCSSRulesForElement(m_element.get(), elementPseudoId, StyleResolver::AllCSSRules); |
+ RefPtrWillBeRawPtr<CSSRuleList> matchedRules = m_cssAgent->matchedRulesList(m_element.get()); |
if (!matchedRules) |
return; |
@@ -357,7 +348,7 @@ void LayoutEditor::initializeCSSRules() |
Vector<std::pair<unsigned, CSSStyleRule*>> selectors; |
for (unsigned i = 0; i < uniqRules.size(); ++i) { |
TrackExceptionState exceptionState; |
- RefPtrWillBeRawPtr<StaticElementList> elements = ownerDocument->querySelectorAll(AtomicString(uniqRules[i]->selectorText()), exceptionState); |
+ RefPtrWillBeRawPtr<StaticElementList> elements = m_element->ownerDocument()->querySelectorAll(AtomicString(uniqRules[i]->selectorText()), exceptionState); |
unsigned length = exceptionState.hadException() ? 0: elements->length(); |
selectors.append(std::make_pair(length, uniqRules[i])); |
} |