OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "config.h" | 5 #include "config.h" |
6 #include "core/inspector/LayoutEditor.h" | 6 #include "core/inspector/LayoutEditor.h" |
7 | 7 |
8 #include "core/css/CSSComputedStyleDeclaration.h" | 8 #include "core/css/CSSComputedStyleDeclaration.h" |
9 #include "core/css/CSSImportRule.h" | 9 #include "core/css/CSSImportRule.h" |
10 #include "core/css/CSSMediaRule.h" | 10 #include "core/css/CSSMediaRule.h" |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 , m_changingProperty(CSSPropertyInvalid) | 204 , m_changingProperty(CSSPropertyInvalid) |
205 , m_propertyInitialValue(0) | 205 , m_propertyInitialValue(0) |
206 , m_isDirty(false) | 206 , m_isDirty(false) |
207 , m_matchedRules(m_cssAgent->matchedRulesList(element)) | 207 , m_matchedRules(m_cssAgent->matchedRulesList(element)) |
208 , m_currentRuleIndex(m_matchedRules->length()) | 208 , m_currentRuleIndex(m_matchedRules->length()) |
209 { | 209 { |
210 } | 210 } |
211 | 211 |
212 LayoutEditor::~LayoutEditor() | 212 LayoutEditor::~LayoutEditor() |
213 { | 213 { |
| 214 } |
| 215 |
| 216 void LayoutEditor::dispose() |
| 217 { |
214 if (!m_isDirty) | 218 if (!m_isDirty) |
215 return; | 219 return; |
216 | 220 |
217 ErrorString errorString; | 221 ErrorString errorString; |
218 m_domAgent->undo(&errorString); | 222 m_domAgent->undo(&errorString); |
219 } | 223 } |
220 | 224 |
221 DEFINE_TRACE(LayoutEditor) | 225 DEFINE_TRACE(LayoutEditor) |
222 { | 226 { |
223 visitor->trace(m_element); | 227 visitor->trace(m_element); |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
437 } | 441 } |
438 | 442 |
439 CSSStyleDeclaration* style = currentStyleIsInline() ? m_element->style() : t
oCSSStyleRule(m_matchedRules->item(m_currentRuleIndex))->style(); | 443 CSSStyleDeclaration* style = currentStyleIsInline() ? m_element->style() : t
oCSSStyleRule(m_matchedRules->item(m_currentRuleIndex))->style(); |
440 | 444 |
441 String errorString; | 445 String errorString; |
442 m_cssAgent->setCSSPropertyValue(&errorString, m_element.get(), style, m_chan
gingProperty, value, forceImportant); | 446 m_cssAgent->setCSSPropertyValue(&errorString, m_element.get(), style, m_chan
gingProperty, value, forceImportant); |
443 return errorString.isEmpty(); | 447 return errorString.isEmpty(); |
444 } | 448 } |
445 | 449 |
446 } // namespace blink | 450 } // namespace blink |
OLD | NEW |