2010-12-24 Alexander Pavlov <apavlov@chromium.org>
authorapavlov@chromium.org <apavlov@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 24 Dec 2010 16:39:32 +0000 (16:39 +0000)
committerapavlov@chromium.org <apavlov@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 24 Dec 2010 16:39:32 +0000 (16:39 +0000)
commit93e800a482e391e868128bcb4bbcc650aa3aa02e
tree5d5344909865056d0e2d4257d38b44293a38943d
parentee031041d6738007835ef624720944cc8d9e4010
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
14 files changed:
LayoutTests/ChangeLog
LayoutTests/http/tests/inspector/inspector-test2.js
LayoutTests/inspector/elements-delete-inline-style-expected.txt [new file with mode: 0755]
LayoutTests/inspector/elements-delete-inline-style.html [new file with mode: 0755]
LayoutTests/inspector/elements-tests2.js [new file with mode: 0755]
LayoutTests/inspector/styles-add-blank-property.html
WebCore/ChangeLog
WebCore/inspector/InspectorCSSAgent.cpp
WebCore/inspector/InspectorCSSAgent.h
WebCore/inspector/InspectorDOMAgent.cpp
WebCore/inspector/InspectorDOMAgent.h
WebCore/inspector/InspectorStyleSheet.cpp
WebCore/inspector/InspectorStyleSheet.h
WebCore/inspector/front-end/ElementsTreeOutline.js