2010-12-24 Alexander Pavlov <apavlov@chromium.org>
Reviewed by Yury Semikhatsky.
Web Inspector: Inline HTML style property out of sync with element.style in Sidebar
https://bugs.webkit.org/show_bug.cgi?id=51478
Now the element attribute modifications (including "style") are tracked, which results in the
source offsets update (in the backend) and Styles/Metrics pane updates (in the frontend)
on the "style" attribute modification through the Elements tree. Also, it appears that
a complete "style" attribute removal destroys the inline style declaration
(StyledElement::m_inlineStyleDecl), while the code used to rely on it being immutable (hence a crash).
Test: inspector/elements-delete-inline-style.html
WebCore:
* inspector/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::didModifyDOMAttr):
* inspector/InspectorCSSAgent.h:
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::didModifyDOMAttr):
* inspector/InspectorDOMAgent.h:
* inspector/InspectorStyleSheet.cpp:
(WebCore::InspectorStyleSheetForInlineStyle::InspectorStyleSheetForInlineStyle):
(WebCore::InspectorStyleSheetForInlineStyle::didModifyElementAttribute):
(WebCore::InspectorStyleSheetForInlineStyle::text):
(WebCore::InspectorStyleSheetForInlineStyle::setStyleText):
(WebCore::InspectorStyleSheetForInlineStyle::getStyleAttributeRanges):
* inspector/InspectorStyleSheet.h:
* inspector/front-end/ElementsTreeOutline.js:
(WebInspector.ElementsTreeElement.prototype._attributeEditingCommitted):
LayoutTests:
* http/tests/inspector/inspector-test2.js:
(initialize_InspectorTest.InspectorTest.addResults):
(initialize_InspectorTest.InspectorTest.createKeyEvent):
* inspector/elements-delete-inline-style-expected.txt: Added.
* inspector/elements-delete-inline-style.html: Added.
* inspector/elements-tests2.js: Added.
(initialize_ElementTest.InspectorTest.expandDOMSubtree.processChildren):
(initialize_ElementTest.InspectorTest.expandDOMSubtree):
(initialize_ElementTest.InspectorTest.expandDOMSubtreeAndRun):
(initialize_ElementTest.InspectorTest.nodeForId):
(initialize_ElementTest.InspectorTest.selectElementAndRun):
(initialize_ElementTest.InspectorTest.dumpSelectedElementStyles):
(initialize_ElementTest.InspectorTest.getSelectedElementStyles):
(initialize_ElementTest.InspectorTest.getElementStylePropertyTreeItem):
(initialize_ElementTest.InspectorTest.dumpStyleTreeOutline):
(initialize_ElementTest.InspectorTest.dumpStyleTreeItem):
(initialize_ElementTest):
* inspector/styles-add-blank-property.html: Remove unnecessary function.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@74634
268f45cc-cd09-0410-ab3c-
d52691b4dbfc