Changeset 106932 in webkit
- Timestamp:
- Feb 7, 2012 6:00:24 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 12 added
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r106928 r106932 1 2012-02-07 Pavel Feldman <pfeldman@google.com> 2 3 Web Inspector: add generic support for undo-ing DOM edits. 4 https://bugs.webkit.org/show_bug.cgi?id=77875 5 6 Reviewed by Yury Semikhatsky. 7 8 * http/tests/inspector/elements-test.js: 9 (initialize_ElementTest.InspectorTest.rangeText): 10 (initialize_ElementTest.InspectorTest.generateUndoTest): 11 * inspector/elements/undo-dom-edits-2-expected.txt: Added. 12 * inspector/elements/undo-dom-edits-2.html: Added. 13 * inspector/elements/undo-dom-edits-expected.txt: Added. 14 * inspector/elements/undo-dom-edits.html: Added. 15 * inspector/styles/undo-add-property-expected.txt: Added. 16 * inspector/styles/undo-add-property.html: Added. 17 * inspector/styles/undo-change-property-expected.txt: Added. 18 * inspector/styles/undo-change-property.html: Added. 19 * inspector/styles/undo-property-toggle-expected.txt: Added. 20 * inspector/styles/undo-property-toggle.html: Added. 21 1 22 2012-02-06 Yury Semikhatsky <yurys@chromium.org> 2 23 -
trunk/LayoutTests/http/tests/inspector/elements-test.js
r105070 r106932 382 382 return "[undefined-undefined]"; 383 383 return "[" + range.start + "-" + range.end + "]"; 384 }; 385 386 }; 384 } 385 386 InspectorTest.generateUndoTest = function(testBody) 387 { 388 function result(next) 389 { 390 var testNode = InspectorTest.expandedNodeWithId(/function\s([^(]*)/.exec(testBody)[1]); 391 InspectorTest.addResult("Initial:"); 392 InspectorTest.dumpElementsTree(testNode); 393 394 testBody(step1); 395 396 function step1() 397 { 398 InspectorTest.addResult("Post-action:"); 399 InspectorTest.dumpElementsTree(testNode); 400 DOMAgent.undo(step2); 401 } 402 403 function step2() 404 { 405 InspectorTest.addResult("Post-undo (initial):"); 406 InspectorTest.dumpElementsTree(testNode); 407 next(); 408 } 409 } 410 result.toString = function() 411 { 412 return testBody.toString(); 413 } 414 return result; 415 } 416 417 }; -
trunk/Source/WebCore/CMakeLists.txt
r106794 r106932 902 902 inspector/InspectorFrontendClientLocal.cpp 903 903 inspector/InspectorFrontendHost.cpp 904 inspector/InspectorHistory.cpp 904 905 inspector/InspectorIndexedDBAgent.cpp 905 906 inspector/InspectorInstrumentation.cpp -
trunk/Source/WebCore/ChangeLog
r106931 r106932 1 2012-02-07 Pavel Feldman <pfeldman@google.com> 2 3 Web Inspector: add generic support for undo-ing DOM edits. 4 https://bugs.webkit.org/show_bug.cgi?id=77875 5 6 Reviewed by Yury Semikhatsky. 7 8 This change introduces InspectorHistory::Action that encapsulates all DOM modifications 9 initiated by the inspector. There is a way to undo these actions up until the undoable 10 state marker. 11 12 Tests: inspector/elements/undo-dom-edits-2.html 13 inspector/elements/undo-dom-edits.html 14 inspector/styles/undo-add-property.html 15 inspector/styles/undo-change-property.html 16 inspector/styles/undo-property-toggle.html 17 18 * CMakeLists.txt: 19 * GNUmakefile.list.am: 20 * Target.pri: 21 * WebCore.gypi: 22 * WebCore.vcproj/WebCore.vcproj: 23 * WebCore.xcodeproj/project.pbxproj: 24 * inspector/Inspector.json: 25 * inspector/InspectorAllInOne.cpp: 26 * inspector/InspectorCSSAgent.cpp: 27 (InspectorCSSAgent::StyleSheetAction): 28 (WebCore::InspectorCSSAgent::StyleSheetAction::StyleSheetAction): 29 (WebCore::InspectorCSSAgent::StyleSheetAction::perform): 30 (WebCore::InspectorCSSAgent::StyleSheetAction::undo): 31 (WebCore): 32 (InspectorCSSAgent::SetStyleSheetTextAction): 33 (WebCore::InspectorCSSAgent::SetStyleSheetTextAction::SetStyleSheetTextAction): 34 (WebCore::InspectorCSSAgent::SetStyleSheetTextAction::perform): 35 (WebCore::InspectorCSSAgent::SetStyleSheetTextAction::undo): 36 (InspectorCSSAgent::SetPropertyTextAction): 37 (WebCore::InspectorCSSAgent::SetPropertyTextAction::SetPropertyTextAction): 38 (WebCore::InspectorCSSAgent::SetPropertyTextAction::toString): 39 (WebCore::InspectorCSSAgent::SetPropertyTextAction::perform): 40 (WebCore::InspectorCSSAgent::SetPropertyTextAction::undo): 41 (WebCore::InspectorCSSAgent::SetPropertyTextAction::mergeId): 42 (WebCore::InspectorCSSAgent::SetPropertyTextAction::merge): 43 (InspectorCSSAgent::TogglePropertyAction): 44 (WebCore::InspectorCSSAgent::TogglePropertyAction::TogglePropertyAction): 45 (WebCore::InspectorCSSAgent::TogglePropertyAction::perform): 46 (WebCore::InspectorCSSAgent::TogglePropertyAction::undo): 47 (WebCore::InspectorCSSAgent::getStyleSheetText): 48 (WebCore::InspectorCSSAgent::setStyleSheetText): 49 (WebCore::InspectorCSSAgent::setPropertyText): 50 (WebCore::InspectorCSSAgent::toggleProperty): 51 * inspector/InspectorCSSAgent.h: 52 (InspectorCSSAgent): 53 * inspector/InspectorDOMAgent.cpp: 54 (WebCore::InspectorDOMAgent::InspectorDOMAgent): 55 (WebCore::InspectorDOMAgent::reset): 56 (WebCore::InspectorDOMAgent::setAttributeValue): 57 (WebCore::InspectorDOMAgent::setAttributesAsText): 58 (WebCore::InspectorDOMAgent::removeAttribute): 59 (WebCore::InspectorDOMAgent::removeNode): 60 (WebCore::InspectorDOMAgent::setNodeName): 61 (WebCore::InspectorDOMAgent::setOuterHTML): 62 (WebCore::InspectorDOMAgent::setNodeValue): 63 (WebCore::InspectorDOMAgent::moveTo): 64 (WebCore::InspectorDOMAgent::undo): 65 (WebCore): 66 (WebCore::InspectorDOMAgent::markUndoableState): 67 * inspector/InspectorDOMAgent.h: 68 (InspectorDOMAgent): 69 (WebCore::InspectorDOMAgent::history): 70 * inspector/InspectorHistory.cpp: Added. 71 (WebCore::InspectorHistory::Action::Action): 72 (WebCore): 73 (WebCore::InspectorHistory::Action::~Action): 74 (WebCore::InspectorHistory::Action::toString): 75 (WebCore::InspectorHistory::Action::isUndoableStateMark): 76 (WebCore::InspectorHistory::Action::mergeId): 77 (WebCore::InspectorHistory::Action::merge): 78 (WebCore::InspectorHistory::InspectorHistory): 79 (WebCore::InspectorHistory::~InspectorHistory): 80 (WebCore::InspectorHistory::perform): 81 (WebCore::InspectorHistory::markUndoableState): 82 (WebCore::InspectorHistory::undo): 83 (WebCore::InspectorHistory::reset): 84 * inspector/InspectorHistory.h: Added. 85 (WebCore): 86 (InspectorHistory): 87 (Action): 88 * inspector/InspectorStyleSheet.cpp: 89 (WebCore::InspectorStyle::setPropertyText): 90 (WebCore::InspectorStyle::styleText): 91 (WebCore::InspectorStyleSheet::addRule): 92 (WebCore::InspectorStyleSheet::buildObjectForStyleSheet): 93 (WebCore::InspectorStyleSheet::buildObjectForStyle): 94 (WebCore::InspectorStyleSheet::setPropertyText): 95 (WebCore::InspectorStyleSheet::getText): 96 (WebCore::InspectorStyleSheetForInlineStyle::getText): 97 * inspector/InspectorStyleSheet.h: 98 (InspectorStyle): 99 (InspectorStyleSheet): 100 (InspectorStyleSheetForInlineStyle): 101 * inspector/front-end/CSSStyleModel.js: 102 (WebInspector.CSSProperty.prototype.setText): 103 * inspector/front-end/ElementsPanel.js: 104 (WebInspector.ElementsPanel.prototype._selectedNodeChanged): 105 (WebInspector.ElementsPanel.prototype._updateSidebars): 106 (WebInspector.ElementsPanel.prototype.handleShortcut): 107 * inspector/front-end/StylesSidebarPane.js: 108 (WebInspector.StylePropertiesSection.prototype.onpopulate): 109 (WebInspector.StylePropertiesSection.prototype.addNewBlankProperty): 110 (WebInspector.ComputedStylePropertiesSection.prototype.onpopulate): 111 (WebInspector.StylePropertyTreeElement): 112 (WebInspector.StylePropertyTreeElement.prototype): 113 1 114 2012-02-07 Chris Guan <chris.guan@torchmobile.com.cn> 2 115 -
trunk/Source/WebCore/GNUmakefile.list.am
r106901 r106932 2391 2391 Source/WebCore/inspector/InspectorFrontendHost.cpp \ 2392 2392 Source/WebCore/inspector/InspectorFrontendHost.h \ 2393 Source/WebCore/inspector/InspectorHistory.cpp \ 2394 Source/WebCore/inspector/InspectorHistory.h \ 2393 2395 Source/WebCore/inspector/InspectorIndexedDBAgent.h \ 2394 2396 Source/WebCore/inspector/InspectorIndexedDBAgent.cpp \ -
trunk/Source/WebCore/Target.pri
r106794 r106932 878 878 inspector/InspectorFrontendClientLocal.cpp \ 879 879 inspector/InspectorFrontendHost.cpp \ 880 inspector/InspectorHistory.cpp \ 880 881 inspector/InspectorInstrumentation.cpp \ 881 882 inspector/InspectorMemoryAgent.cpp \ … … 1944 1945 inspector/InspectorFrontendClientLocal.h \ 1945 1946 inspector/InspectorFrontendHost.h \ 1947 inspector/InspectorHistory.h \ 1946 1948 inspector/InspectorInstrumentation.h \ 1947 1949 inspector/InspectorMemoryAgent.h \ -
trunk/Source/WebCore/WebCore.gypi
r106794 r106932 2387 2387 'inspector/InspectorFrontendHost.cpp', 2388 2388 'inspector/InspectorFrontendHost.h', 2389 'inspector/InspectorHistory.cpp', 2390 'inspector/InspectorHistory.h', 2389 2391 'inspector/InspectorIndexedDBAgent.cpp', 2390 2392 'inspector/InspectorIndexedDBAgent.h', -
trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj
r106794 r106932 71659 71659 </File> 71660 71660 <File 71661 RelativePath="..\inspector\InspectorHistory.cpp" 71662 > 71663 <FileConfiguration 71664 Name="Release|Win32" 71665 ExcludedFromBuild="true" 71666 > 71667 <Tool 71668 Name="VCCLCompilerTool" 71669 /> 71670 </FileConfiguration> 71671 <FileConfiguration 71672 Name="Production|Win32" 71673 ExcludedFromBuild="true" 71674 > 71675 <Tool 71676 Name="VCCLCompilerTool" 71677 /> 71678 </FileConfiguration> 71679 </File> 71680 <File 71681 RelativePath="..\inspector\InspectorHistory.h" 71682 > 71683 </File> 71684 <File 71661 71685 RelativePath="..\inspector\InspectorIndexedDBAgent.cpp" 71662 71686 > -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r106910 r106932 1888 1888 7A24587B1021EAF4000A00AA /* InspectorDOMAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7A2458791021EAF4000A00AA /* InspectorDOMAgent.cpp */; }; 1889 1889 7A24587C1021EAF4000A00AA /* InspectorDOMAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A24587A1021EAF4000A00AA /* InspectorDOMAgent.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1890 7A54857F14E02D51006AE05A /* InspectorHistory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7A54857D14E02D51006AE05A /* InspectorHistory.cpp */; }; 1891 7A54858014E02D51006AE05A /* InspectorHistory.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A54857E14E02D51006AE05A /* InspectorHistory.h */; }; 1890 1892 7A674BDB0F9EBF4E006CF099 /* PageGroupLoadDeferrer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7A674BD90F9EBF4E006CF099 /* PageGroupLoadDeferrer.cpp */; }; 1891 1893 7A674BDC0F9EBF4E006CF099 /* PageGroupLoadDeferrer.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A674BDA0F9EBF4E006CF099 /* PageGroupLoadDeferrer.h */; }; … … 8769 8771 7A2458791021EAF4000A00AA /* InspectorDOMAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorDOMAgent.cpp; sourceTree = "<group>"; }; 8770 8772 7A24587A1021EAF4000A00AA /* InspectorDOMAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorDOMAgent.h; sourceTree = "<group>"; }; 8773 7A54857D14E02D51006AE05A /* InspectorHistory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorHistory.cpp; sourceTree = "<group>"; }; 8774 7A54857E14E02D51006AE05A /* InspectorHistory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorHistory.h; sourceTree = "<group>"; }; 8771 8775 7A563E5412DE32B000F4536D /* InjectedScriptSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedScriptSource.h; sourceTree = "<group>"; }; 8772 8776 7A563F9512DF5C9100F4536D /* InjectedScriptSource.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = InjectedScriptSource.js; sourceTree = "<group>"; }; … … 14058 14062 7A0E770C10C00A8800A0276E /* InspectorFrontendHost.h */, 14059 14063 7A0E770D10C00A8800A0276E /* InspectorFrontendHost.idl */, 14064 7A54857D14E02D51006AE05A /* InspectorHistory.cpp */, 14065 7A54857E14E02D51006AE05A /* InspectorHistory.h */, 14060 14066 7ACD88D114C08BD60084EDD2 /* InspectorIndexedDBAgent.cpp */, 14061 14067 7ACD88D214C08BD60084EDD2 /* InspectorIndexedDBAgent.h */, … … 24149 24155 1AAADDE414DC8C8F00AF64B3 /* ScrollingTreeNode.h in Headers */, 24150 24156 1AAADDE914DC8DF800AF64B3 /* ScrollingTreeNodeMac.h in Headers */, 24157 7A54858014E02D51006AE05A /* InspectorHistory.h in Headers */, 24151 24158 ); 24152 24159 runOnlyForDeploymentPostprocessing = 0; … … 27085 27092 1AAADDE314DC8C8F00AF64B3 /* ScrollingTreeNode.cpp in Sources */, 27086 27093 1AAADDE814DC8DF800AF64B3 /* ScrollingTreeNodeMac.mm in Sources */, 27094 7A54857F14E02D51006AE05A /* InspectorHistory.cpp in Sources */, 27087 27095 ); 27088 27096 runOnlyForDeploymentPostprocessing = 0; -
trunk/Source/WebCore/inspector/Inspector.json
r106811 r106932 1517 1517 "description": "Toggles mouse event-based touch event emulation.", 1518 1518 "hidden": true 1519 }, 1520 { 1521 "name": "undo", 1522 "description": "Undoes the last performed action.", 1523 "hidden": true 1524 }, 1525 { 1526 "name": "markUndoableState", 1527 "description": "Marks last undoable state.", 1528 "hidden": true 1519 1529 } 1520 1530 ], -
trunk/Source/WebCore/inspector/InspectorAllInOne.cpp
r106280 r106932 43 43 #include "InspectorFrontendClientLocal.cpp" 44 44 #include "InspectorFrontendHost.cpp" 45 #include "InspectorHistory.cpp" 45 46 #include "InspectorIndexedDBAgent.cpp" 46 47 #include "InspectorInstrumentation.cpp" -
trunk/Source/WebCore/inspector/InspectorCSSAgent.cpp
r106777 r106932 40 40 #include "HTMLHeadElement.h" 41 41 #include "InspectorDOMAgent.h" 42 #include "InspectorHistory.h" 42 43 #include "InspectorState.h" 43 44 #include "InspectorValues.h" … … 218 219 } 219 220 221 class InspectorCSSAgent::StyleSheetAction : public InspectorHistory::Action { 222 WTF_MAKE_NONCOPYABLE(StyleSheetAction); 223 public: 224 StyleSheetAction(const String& name, InspectorCSSAgent* cssAgent, const String& styleSheetId) 225 : InspectorHistory::Action(name) 226 , m_cssAgent(cssAgent) 227 , m_styleSheetId(styleSheetId) 228 { 229 } 230 231 virtual bool perform(ErrorString* errorString) 232 { 233 InspectorStyleSheet* styleSheet = m_cssAgent->assertStyleSheetForId(errorString, m_styleSheetId); 234 if (!styleSheet) 235 return false; 236 return perform(styleSheet, errorString); 237 } 238 239 virtual bool undo(ErrorString* errorString) 240 { 241 InspectorStyleSheet* styleSheet = m_cssAgent->assertStyleSheetForId(errorString, m_styleSheetId); 242 if (!styleSheet) 243 return false; 244 return undo(styleSheet, errorString); 245 } 246 247 virtual bool perform(InspectorStyleSheet*, ErrorString*) = 0; 248 249 virtual bool undo(InspectorStyleSheet*, ErrorString*) = 0; 250 251 protected: 252 InspectorCSSAgent* m_cssAgent; 253 String m_styleSheetId; 254 }; 255 256 class InspectorCSSAgent::SetStyleSheetTextAction : public InspectorCSSAgent::StyleSheetAction { 257 WTF_MAKE_NONCOPYABLE(SetStyleSheetTextAction); 258 public: 259 SetStyleSheetTextAction(InspectorCSSAgent* cssAgent, const String& styleSheetId, const String& text) 260 : InspectorCSSAgent::StyleSheetAction("SetStyleSheetText", cssAgent, styleSheetId) 261 , m_text(text) 262 { 263 } 264 265 virtual bool perform(InspectorStyleSheet* inspectorStyleSheet, ErrorString*) 266 { 267 if (!inspectorStyleSheet->getText(&m_oldText)) 268 return false; 269 270 if (inspectorStyleSheet->setText(m_text)) { 271 inspectorStyleSheet->reparseStyleSheet(m_text); 272 return true; 273 } 274 return false; 275 } 276 277 virtual bool undo(InspectorStyleSheet* inspectorStyleSheet, ErrorString*) 278 { 279 if (inspectorStyleSheet->setText(m_oldText)) { 280 inspectorStyleSheet->reparseStyleSheet(m_oldText); 281 return true; 282 } 283 return false; 284 } 285 286 private: 287 String m_text; 288 String m_oldText; 289 }; 290 291 class InspectorCSSAgent::SetPropertyTextAction : public InspectorCSSAgent::StyleSheetAction { 292 WTF_MAKE_NONCOPYABLE(SetPropertyTextAction); 293 public: 294 SetPropertyTextAction(InspectorCSSAgent* cssAgent, const String& styleSheetId, const InspectorCSSId& cssId, unsigned propertyIndex, const String& text, bool overwrite) 295 : InspectorCSSAgent::StyleSheetAction("SetPropertyText", cssAgent, styleSheetId) 296 , m_cssId(cssId) 297 , m_propertyIndex(propertyIndex) 298 , m_text(text) 299 , m_overwrite(overwrite) 300 { 301 } 302 303 virtual String toString() 304 { 305 return mergeId() + ": " + m_oldText + " -> " + m_text; 306 } 307 308 virtual bool perform(InspectorStyleSheet* inspectorStyleSheet, ErrorString* errorString) 309 { 310 String oldText; 311 bool result = inspectorStyleSheet->setPropertyText(errorString, m_cssId, m_propertyIndex, m_text, m_overwrite, &oldText); 312 m_oldText = oldText.stripWhiteSpace(); 313 // FIXME: remove this once the model handles this case. 314 if (!m_oldText.endsWith(";")) 315 m_oldText += ";"; 316 return result; 317 } 318 319 virtual bool undo(InspectorStyleSheet* inspectorStyleSheet, ErrorString* errorString) 320 { 321 String placeholder; 322 return inspectorStyleSheet->setPropertyText(errorString, m_cssId, m_propertyIndex, m_overwrite ? m_oldText : "", true, &placeholder); 323 } 324 325 virtual String mergeId() 326 { 327 return String::format("SetPropertyText %s:%u:%s", m_styleSheetId.utf8().data(), m_propertyIndex, m_overwrite ? "true" : "false"); 328 } 329 330 virtual void merge(PassOwnPtr<Action> action) 331 { 332 ASSERT(action->mergeId() == mergeId()); 333 334 SetPropertyTextAction* other = static_cast<SetPropertyTextAction*>(action.get()); 335 m_text = other->m_text; 336 } 337 338 private: 339 InspectorCSSId m_cssId; 340 unsigned m_propertyIndex; 341 String m_text; 342 String m_oldText; 343 bool m_overwrite; 344 }; 345 346 class InspectorCSSAgent::TogglePropertyAction : public InspectorCSSAgent::StyleSheetAction { 347 WTF_MAKE_NONCOPYABLE(TogglePropertyAction); 348 public: 349 TogglePropertyAction(InspectorCSSAgent* cssAgent, const String& styleSheetId, const InspectorCSSId& cssId, unsigned propertyIndex, bool disable) 350 : InspectorCSSAgent::StyleSheetAction("ToggleProperty", cssAgent, styleSheetId) 351 , m_cssId(cssId) 352 , m_propertyIndex(propertyIndex) 353 , m_disable(disable) 354 { 355 } 356 357 virtual bool perform(InspectorStyleSheet* inspectorStyleSheet, ErrorString* errorString) 358 { 359 return inspectorStyleSheet->toggleProperty(errorString, m_cssId, m_propertyIndex, m_disable); 360 } 361 362 virtual bool undo(InspectorStyleSheet* inspectorStyleSheet, ErrorString* errorString) 363 { 364 return inspectorStyleSheet->toggleProperty(errorString, m_cssId, m_propertyIndex, !m_disable); 365 } 366 367 private: 368 InspectorCSSId m_cssId; 369 unsigned m_propertyIndex; 370 bool m_disable; 371 }; 372 220 373 // static 221 374 CSSStyleRule* InspectorCSSAgent::asCSSStyleRule(CSSRule* rule) … … 439 592 return; 440 593 441 inspectorStyleSheet-> text(result);594 inspectorStyleSheet->getText(result); 442 595 } 443 596 444 597 void InspectorCSSAgent::setStyleSheetText(ErrorString* errorString, const String& styleSheetId, const String& text) 445 598 { 446 InspectorStyleSheet* inspectorStyleSheet = assertStyleSheetForId(errorString, styleSheetId); 447 if (!inspectorStyleSheet) 448 return; 449 450 if (inspectorStyleSheet->setText(text)) 451 inspectorStyleSheet->reparseStyleSheet(text); 452 else 453 *errorString = "Internal error setting style sheet text"; 599 m_domAgent->history()->perform(adoptPtr(new SetStyleSheetTextAction(this, styleSheetId, text)), errorString); 600 m_domAgent->history()->markUndoableState(); 454 601 } 455 602 … … 463 610 return; 464 611 465 bool success = inspectorStyleSheet->setPropertyText(errorString, compoundId, propertyIndex, text, overwrite);612 bool success = m_domAgent->history()->perform(adoptPtr(new SetPropertyTextAction(this, compoundId.styleSheetId(), compoundId, propertyIndex, text, overwrite)), errorString); 466 613 if (success) 467 614 result = inspectorStyleSheet->buildObjectForStyle(inspectorStyleSheet->styleForId(compoundId)); … … 477 624 return; 478 625 479 bool success = inspectorStyleSheet->toggleProperty(errorString, compoundId, propertyIndex, disable);626 bool success = m_domAgent->history()->perform(adoptPtr(new TogglePropertyAction(this, compoundId.styleSheetId(), compoundId, propertyIndex, disable)), errorString); 480 627 if (success) 481 628 result = inspectorStyleSheet->buildObjectForStyle(inspectorStyleSheet->styleForId(compoundId)); 629 m_domAgent->history()->markUndoableState(); 482 630 } 483 631 -
trunk/Source/WebCore/inspector/InspectorCSSAgent.h
r106777 r106932 99 99 100 100 private: 101 class StyleSheetAction; 102 class SetStyleSheetTextAction; 103 class SetPropertyTextAction; 104 class TogglePropertyAction; 105 101 106 InspectorCSSAgent(InstrumentingAgents*, InspectorState*, InspectorDOMAgent*); 102 107 -
trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp
r106833 r106932 96 96 namespace WebCore { 97 97 98 namespace { 99 100 class DOMAction : public InspectorHistory::Action { 101 public: 102 DOMAction(const String& name) : InspectorHistory::Action(name) { } 103 104 virtual bool perform(ErrorString* errorString) 105 { 106 ExceptionCode ec = 0; 107 bool result = perform(ec); 108 if (ec) { 109 ExceptionCodeDescription description(ec); 110 *errorString = description.name; 111 } 112 return result && !ec; 113 } 114 115 virtual bool undo(ErrorString* errorString) 116 { 117 ExceptionCode ec = 0; 118 bool result = undo(ec); 119 if (ec) { 120 ExceptionCodeDescription description(ec); 121 *errorString = description.name; 122 } 123 return result && !ec; 124 } 125 126 virtual bool perform(ExceptionCode&) = 0; 127 128 virtual bool undo(ExceptionCode&) = 0; 129 130 private: 131 RefPtr<Node> m_parentNode; 132 RefPtr<Node> m_node; 133 RefPtr<Node> m_anchorNode; 134 }; 135 136 class RemoveChildAction : public DOMAction { 137 WTF_MAKE_NONCOPYABLE(RemoveChildAction); 138 public: 139 RemoveChildAction(Node* parentNode, Node* node) 140 : DOMAction("RemoveChild") 141 , m_parentNode(parentNode) 142 , m_node(node) 143 { 144 } 145 146 virtual bool perform(ExceptionCode& ec) 147 { 148 m_anchorNode = m_node->nextSibling(); 149 return m_parentNode->removeChild(m_node.get(), ec); 150 } 151 152 virtual bool undo(ExceptionCode& ec) 153 { 154 return m_parentNode->insertBefore(m_node.get(), m_anchorNode.get(), ec); 155 } 156 157 private: 158 RefPtr<Node> m_parentNode; 159 RefPtr<Node> m_node; 160 RefPtr<Node> m_anchorNode; 161 }; 162 163 class InsertBeforeAction : public DOMAction { 164 WTF_MAKE_NONCOPYABLE(InsertBeforeAction); 165 public: 166 InsertBeforeAction(Node* parentNode, Node* node, Node* anchorNode) 167 : DOMAction("InsertBefore") 168 , m_parentNode(parentNode) 169 , m_node(node) 170 , m_anchorNode(anchorNode) 171 { 172 } 173 174 virtual bool perform(ExceptionCode& ec) 175 { 176 if (m_node->parentNode()) { 177 m_removeChildAction = adoptPtr(new RemoveChildAction(m_node->parentNode(), m_node.get())); 178 if (!m_removeChildAction->perform(ec)) 179 return false; 180 } 181 return m_parentNode->insertBefore(m_node.get(), m_anchorNode.get(), ec); 182 } 183 184 virtual bool undo(ExceptionCode& ec) 185 { 186 if (m_removeChildAction) 187 return m_removeChildAction->undo(ec); 188 189 return m_parentNode->removeChild(m_node.get(), ec); 190 } 191 192 private: 193 RefPtr<Node> m_parentNode; 194 RefPtr<Node> m_node; 195 RefPtr<Node> m_anchorNode; 196 OwnPtr<RemoveChildAction> m_removeChildAction; 197 }; 198 199 class RemoveAttributeAction : public DOMAction { 200 WTF_MAKE_NONCOPYABLE(RemoveAttributeAction); 201 public: 202 RemoveAttributeAction(Element* element, const String& name) 203 : DOMAction("RemoveAttribute") 204 , m_element(element) 205 , m_name(name) 206 { 207 } 208 209 virtual bool perform(ExceptionCode&) 210 { 211 m_value = m_element->getAttribute(m_name); 212 m_element->removeAttribute(m_name); 213 return true; 214 } 215 216 virtual bool undo(ExceptionCode& ec) 217 { 218 m_element->setAttribute(m_name, m_value, ec); 219 return true; 220 } 221 222 private: 223 RefPtr<Element> m_element; 224 String m_name; 225 String m_value; 226 }; 227 228 class SetAttributeAction : public DOMAction { 229 WTF_MAKE_NONCOPYABLE(SetAttributeAction); 230 public: 231 SetAttributeAction(Element* element, const String& name, const String& value) 232 : DOMAction("SetAttribute") 233 , m_element(element) 234 , m_name(name) 235 , m_value(value) 236 , m_hadAttribute(false) 237 { 238 } 239 240 virtual bool perform(ExceptionCode& ec) 241 { 242 m_hadAttribute = m_element->hasAttribute(m_name); 243 if (m_hadAttribute) 244 m_oldValue = m_element->getAttribute(m_name); 245 m_element->setAttribute(m_name, m_value, ec); 246 return !ec; 247 } 248 249 virtual bool undo(ExceptionCode& ec) 250 { 251 if (m_hadAttribute) 252 m_element->setAttribute(m_name, m_oldValue, ec); 253 else 254 m_element->removeAttribute(m_name); 255 return true; 256 } 257 258 private: 259 RefPtr<Element> m_element; 260 String m_name; 261 String m_value; 262 bool m_hadAttribute; 263 String m_oldValue; 264 }; 265 266 class SetOuterHTMLAction : public DOMAction { 267 WTF_MAKE_NONCOPYABLE(SetOuterHTMLAction); 268 public: 269 SetOuterHTMLAction(Node* node, const String& html) 270 : DOMAction("SetOuterHTML") 271 , m_node(node) 272 , m_html(html) 273 , m_newNode(0) 274 { 275 } 276 277 virtual bool perform(ExceptionCode& ec) 278 { 279 m_oldHTML = createMarkup(m_node.get()); 280 DOMEditor domEditor(m_node->ownerDocument()); 281 m_newNode = domEditor.patchNode(m_node.get(), m_html, ec); 282 return !ec; 283 } 284 285 virtual bool undo(ExceptionCode& ec) 286 { 287 DOMEditor domEditor(m_node->ownerDocument()); 288 domEditor.patchNode(m_node.get(), m_oldHTML, ec); 289 return !ec; 290 } 291 292 Node* newNode() 293 { 294 return m_newNode; 295 } 296 297 private: 298 RefPtr<Node> m_node; 299 String m_html; 300 String m_oldHTML; 301 Node* m_newNode; 302 }; 303 304 class ReplaceWholeTextAction : public DOMAction { 305 WTF_MAKE_NONCOPYABLE(ReplaceWholeTextAction); 306 public: 307 ReplaceWholeTextAction(Text* textNode, const String& text) 308 : DOMAction("ReplaceWholeText") 309 , m_textNode(textNode) 310 , m_text(text) 311 { 312 } 313 314 virtual bool perform(ExceptionCode& ec) 315 { 316 m_oldText = m_textNode->wholeText(); 317 m_textNode->replaceWholeText(m_text, ec); 318 return true; 319 } 320 321 virtual bool undo(ExceptionCode& ec) 322 { 323 m_textNode->replaceWholeText(m_oldText, ec); 324 return true; 325 } 326 327 private: 328 RefPtr<Text> m_textNode; 329 String m_text; 330 String m_oldText; 331 }; 332 333 } 334 98 335 namespace DOMAgentState { 99 336 static const char documentRequested[] = "documentRequested"; … … 187 424 , m_lastNodeId(1) 188 425 , m_searchingForNode(false) 426 , m_history(adoptPtr(new InspectorHistory())) 189 427 { 190 428 } … … 254 492 void InspectorDOMAgent::reset() 255 493 { 256 ErrorString error;494 m_history->reset(); 257 495 m_searchResults.clear(); 258 496 discardBindings(); … … 519 757 return; 520 758 521 ExceptionCode ec = 0; 522 element->setAttribute(name, value, ec); 523 if (ec) 524 *errorString = "Internal error: could not set attribute value"; 759 m_history->perform(adoptPtr(new SetAttributeAction(element, name, value)), errorString); 760 m_history->markUndoableState(); 525 761 } 526 762 … … 552 788 Element* childElement = toElement(child); 553 789 if (!childElement->hasAttributes() && name) { 554 element->removeAttribute(*name);790 m_history->perform(adoptPtr(new RemoveAttributeAction(element, *name)), errorString); 555 791 return; 556 792 } … … 562 798 const Attribute* attribute = childElement->attributeItem(i); 563 799 foundOriginalAttribute = foundOriginalAttribute || (name && attribute->name().toString() == *name); 564 element->setAttribute(attribute->name(), attribute->value()); 565 } 566 567 if (!foundOriginalAttribute && name) { 568 element->removeAttribute(*name); 569 return; 570 } 800 if (!m_history->perform(adoptPtr(new SetAttributeAction(element, attribute->name().toString(), attribute->value())), errorString)) 801 return; 802 } 803 804 if (!foundOriginalAttribute && name && !name->stripWhiteSpace().isEmpty()) 805 m_history->perform(adoptPtr(new RemoveAttributeAction(element, *name)), errorString); 806 807 m_history->markUndoableState(); 571 808 } 572 809 … … 574 811 { 575 812 Element* element = assertElement(errorString, elementId); 576 if (element) 577 element->removeAttribute(name); 813 if (!element) 814 return; 815 816 m_history->perform(adoptPtr(new RemoveAttributeAction(element, name)), errorString); 817 m_history->markUndoableState(); 578 818 } 579 819 … … 590 830 } 591 831 592 ExceptionCode ec = 0; 593 parentNode->removeChild(node, ec); 594 if (ec) 595 *errorString = "Could not remove node due to DOM exception"; 596 } 597 598 void InspectorDOMAgent::setNodeName(ErrorString*, int nodeId, const String& tagName, int* newId) 832 m_history->perform(adoptPtr(new RemoveChildAction(parentNode, node)), errorString); 833 m_history->markUndoableState(); 834 } 835 836 void InspectorDOMAgent::setNodeName(ErrorString* errorString, int nodeId, const String& tagName, int* newId) 599 837 { 600 838 *newId = 0; … … 614 852 // Copy over the original node's children. 615 853 Node* child; 616 while ((child = oldNode->firstChild())) 617 newElem->appendChild(child, ec); 854 while ((child = oldNode->firstChild())) { 855 if (!m_history->perform(adoptPtr(new InsertBeforeAction(newElem.get(), child, 0)), errorString)) 856 return; 857 } 618 858 619 859 // Replace the old node with the new node 620 860 ContainerNode* parent = oldNode->parentNode(); 621 parent->insertBefore(newElem, oldNode->nextSibling(), ec);622 parent->removeChild(oldNode, ec);623 624 if (ec)625 return;861 if (!m_history->perform(adoptPtr(new InsertBeforeAction(parent, newElem.get(), oldNode->nextSibling())), errorString)) 862 return; 863 if (!m_history->perform(adoptPtr(new RemoveChildAction(parent, oldNode)), errorString)) 864 return; 865 m_history->markUndoableState(); 626 866 627 867 *newId = pushNodePathToFrontend(newElem.get()); … … 659 899 DOMEditor domEditor(document); 660 900 661 ExceptionCode ec = 0; 662 Node* newNode = domEditor.patchNode(node, outerHTML, ec); 663 if (ec) { 664 ExceptionCodeDescription description(ec); 665 *errorString = description.name; 666 return; 667 } 901 OwnPtr<SetOuterHTMLAction> action = adoptPtr(new SetOuterHTMLAction(node, outerHTML)); 902 SetOuterHTMLAction* rawAction = action.get(); 903 Node* newNode = 0; 904 if (!m_history->perform(action.release(), errorString)) 905 return; 906 m_history->markUndoableState(); 907 908 newNode = rawAction->newNode(); 668 909 669 910 if (!newNode) { … … 690 931 } 691 932 692 Text* textNode = static_cast<Text*>(node); 693 ExceptionCode ec = 0; 694 textNode->replaceWholeText(value, ec); 695 if (ec) 696 *errorString = "DOM Error while setting the node value"; 933 m_history->perform(adoptPtr(new ReplaceWholeTextAction(static_cast<Text*>(node), value)), errorString); 697 934 } 698 935 … … 1031 1268 } 1032 1269 1033 void InspectorDOMAgent::moveTo(ErrorString* error , int nodeId, int targetElementId, const int* const anchorNodeId, int* newNodeId)1034 { 1035 Node* node = assertNode(error , nodeId);1270 void InspectorDOMAgent::moveTo(ErrorString* errorString, int nodeId, int targetElementId, const int* const anchorNodeId, int* newNodeId) 1271 { 1272 Node* node = assertNode(errorString, nodeId); 1036 1273 if (!node) 1037 1274 return; 1038 1275 1039 Element* targetElement = assertElement(error , targetElementId);1276 Element* targetElement = assertElement(errorString, targetElementId); 1040 1277 if (!targetElement) 1041 1278 return; … … 1043 1280 Node* anchorNode = 0; 1044 1281 if (anchorNodeId && *anchorNodeId) { 1045 anchorNode = assertNode(error , *anchorNodeId);1282 anchorNode = assertNode(errorString, *anchorNodeId); 1046 1283 if (!anchorNode) 1047 1284 return; 1048 1285 if (anchorNode->parentNode() != targetElement) { 1049 *error = "Anchor node must be child of the target element";1286 *errorString = "Anchor node must be child of the target element"; 1050 1287 return; 1051 1288 } 1052 1289 } 1053 1290 1054 ExceptionCode ec = 0; 1055 bool success = targetElement->insertBefore(node, anchorNode, ec); 1056 if (ec || !success) { 1057 *error = "Could not drop node"; 1058 return; 1059 } 1291 if (!m_history->perform(adoptPtr(new InsertBeforeAction(targetElement, node, anchorNode)), errorString)) 1292 return; 1293 m_history->markUndoableState(); 1294 1060 1295 *newNodeId = pushNodePathToFrontend(node); 1061 1296 } … … 1072 1307 UNUSED_PARAM(enabled); 1073 1308 #endif 1309 } 1310 1311 void InspectorDOMAgent::undo(ErrorString* errorString) 1312 { 1313 m_history->undo(errorString); 1314 } 1315 1316 void InspectorDOMAgent::markUndoableState(ErrorString*) 1317 { 1318 m_history->markUndoableState(); 1074 1319 } 1075 1320 -
trunk/Source/WebCore/inspector/InspectorDOMAgent.h
r106811 r106932 36 36 #include "InspectorBaseAgent.h" 37 37 #include "InspectorFrontend.h" 38 #include "InspectorHistory.h" 38 39 #include "InspectorValues.h" 39 40 #include "Timer.h" … … 144 145 virtual void moveTo(ErrorString*, int nodeId, int targetNodeId, const int* anchorNodeId, int* newNodeId); 145 146 virtual void setTouchEmulationEnabled(ErrorString*, bool); 147 virtual void undo(ErrorString*); 148 virtual void markUndoableState(ErrorString*); 146 149 147 150 Node* highlightedNode() const; … … 176 179 void drawHighlight(GraphicsContext&) const; 177 180 void getHighlight(Highlight*) const; 181 182 InspectorHistory* history() { return m_history.get(); } 178 183 179 184 // We represent embedded doms as a part of the same hierarchy. Hence we treat children of frame owners differently. … … 241 246 RefPtr<Node> m_nodeToFocus; 242 247 bool m_searchingForNode; 248 OwnPtr<InspectorHistory> m_history; 243 249 }; 244 250 -
trunk/Source/WebCore/inspector/InspectorStyleSheet.cpp
r106681 r106932 281 281 // The propertyText (if not empty) is checked to be a valid style declaration (containing at least one property). If not, 282 282 // the method returns false (denoting an error). 283 bool InspectorStyle::setPropertyText(ErrorString* errorString, unsigned index, const String& propertyText, bool overwrite )283 bool InspectorStyle::setPropertyText(ErrorString* errorString, unsigned index, const String& propertyText, bool overwrite, String* oldText) 284 284 { 285 285 ASSERT(m_parentStyleSheet); … … 329 329 330 330 InspectorStyleTextEditor editor(&allProperties, &m_disabledProperties, text, newLineAndWhitespaceDelimiters()); 331 if (overwrite) 331 if (overwrite) { 332 *oldText = allProperties.at(index).rawText; 332 333 editor.replaceProperty(index, propertyText); 333 else334 } else 334 335 editor.insertProperty(index, propertyText, sourceData->styleSourceData->styleBodyRange.length()); 335 336 … … 386 387 387 388 String styleSheetText; 388 bool success = m_parentStyleSheet-> text(&styleSheetText);389 bool success = m_parentStyleSheet->getText(&styleSheetText); 389 390 if (!success) 390 391 return false; … … 730 731 { 731 732 String styleSheetText; 732 bool success = text(&styleSheetText);733 bool success = getText(&styleSheetText); 733 734 if (!success) 734 735 return 0; … … 778 779 779 780 String styleSheetText; 780 bool success = text(&styleSheetText);781 bool success = getText(&styleSheetText); 781 782 if (success) 782 783 result->setString("text", styleSheetText); … … 858 859 if (sourceData) { 859 860 String sheetText; 860 bool success = text(&sheetText);861 bool success = getText(&sheetText); 861 862 if (success) { 862 863 const SourceRange& bodyRange = sourceData->styleSourceData->styleBodyRange; … … 868 869 } 869 870 870 bool InspectorStyleSheet::setPropertyText(ErrorString* errorString, const InspectorCSSId& id, unsigned propertyIndex, const String& text, bool overwrite )871 bool InspectorStyleSheet::setPropertyText(ErrorString* errorString, const InspectorCSSId& id, unsigned propertyIndex, const String& text, bool overwrite, String* oldText) 871 872 { 872 873 RefPtr<InspectorStyle> inspectorStyle = inspectorStyleForId(id); … … 876 877 } 877 878 878 return inspectorStyle->setPropertyText(errorString, propertyIndex, text, overwrite );879 return inspectorStyle->setPropertyText(errorString, propertyIndex, text, overwrite, oldText); 879 880 } 880 881 … … 897 898 } 898 899 899 bool InspectorStyleSheet:: text(String* result) const900 bool InspectorStyleSheet::getText(String* result) const 900 901 { 901 902 if (!ensureText()) … … 1242 1243 } 1243 1244 1244 bool InspectorStyleSheetForInlineStyle:: text(String* result) const1245 bool InspectorStyleSheetForInlineStyle::getText(String* result) const 1245 1246 { 1246 1247 if (!m_isStyleTextValid) { -
trunk/Source/WebCore/inspector/InspectorStyleSheet.h
r104710 r106932 132 132 PassRefPtr<InspectorArray> buildArrayForComputedStyle() const; 133 133 bool hasDisabledProperties() const { return !m_disabledProperties.isEmpty(); } 134 bool setPropertyText(ErrorString*, unsigned index, const String& text, bool overwrite );134 bool setPropertyText(ErrorString*, unsigned index, const String& text, bool overwrite, String* oldText); 135 135 bool toggleProperty(ErrorString*, unsigned index, bool disable); 136 136 … … 175 175 PassRefPtr<InspectorObject> buildObjectForRule(CSSStyleRule*); 176 176 PassRefPtr<InspectorObject> buildObjectForStyle(CSSStyleDeclaration*); 177 bool setPropertyText(ErrorString*, const InspectorCSSId&, unsigned propertyIndex, const String& text, bool overwrite );177 bool setPropertyText(ErrorString*, const InspectorCSSId&, unsigned propertyIndex, const String& text, bool overwrite, String* oldPropertyText); 178 178 bool toggleProperty(ErrorString*, const InspectorCSSId&, unsigned propertyIndex, bool disable); 179 179 180 virtual bool text(String* result) const;180 virtual bool getText(String* result) const; 181 181 virtual CSSStyleDeclaration* styleForId(const InspectorCSSId&) const; 182 182 … … 229 229 230 230 void didModifyElementAttribute(); 231 virtual bool text(String* result) const;231 virtual bool getText(String* result) const; 232 232 virtual CSSStyleDeclaration* styleForId(const InspectorCSSId& id) const { ASSERT_UNUSED(id, !id.ordinal()); return inlineStyle(); } 233 233 -
trunk/Source/WebCore/inspector/front-end/CSSStyleModel.js
r105067 r106932 644 644 // An index past all the properties adds a new property to the style. 645 645 CSSAgent.setPropertyText(this.ownerStyle.id, this.index, propertyText, this.index < this.ownerStyle.pastLastSourcePropertyIndex(), callback.bind(this)); 646 if (majorChange) 647 DOMAgent.markUndoableState(); 646 648 }, 647 649 -
trunk/Source/WebCore/inspector/front-end/ElementsPanel.js
r103799 r106932 168 168 this.updateBreadcrumb(false); 169 169 170 this._updateSidebars(); 171 172 if (selectedNode) { 173 ConsoleAgent.addInspectedNode(selectedNode.id); 174 this._lastValidSelectedNode = selectedNode; 175 } 176 }, 177 178 _updateSidebars: function() 179 { 170 180 for (var pane in this.sidebarPanes) 171 181 this.sidebarPanes[pane].needsUpdate = true; … … 175 185 this.updateProperties(); 176 186 this.updateEventListeners(); 177 178 if (selectedNode) {179 ConsoleAgent.addInspectedNode(selectedNode.id);180 this._lastValidSelectedNode = selectedNode;181 }182 187 }, 183 188 … … 908 913 // Cmd/Control + Shift + C should be a shortcut to clicking the Node Search Button. 909 914 // This shortcut matches Firebug. 910 if (event.keyIdentifier === "U+0043") { 915 if (event.keyIdentifier === "U+0043") { // C key 911 916 if (WebInspector.isMac()) 912 917 var isNodeSearchKey = event.metaKey && !event.ctrlKey && !event.altKey && event.shiftKey; … … 919 924 return; 920 925 } 921 } 926 return; 927 } 928 if (WebInspector.KeyboardShortcut.eventHasCtrlOrMeta(event) && event.keyIdentifier === "U+005A") // Z key 929 DOMAgent.undo(this._updateSidebars.bind(this)); 922 930 }, 923 931 -
trunk/Source/WebCore/inspector/front-end/StylesSidebarPane.js
r106809 r106932 1069 1069 var overloaded = this.isPropertyOverloaded(property.name, isShorthand); 1070 1070 1071 var item = new WebInspector.StylePropertyTreeElement(this ._parentPane, this.styleRule, style, property, isShorthand, inherited, overloaded);1071 var item = new WebInspector.StylePropertyTreeElement(this, this._parentPane, this.styleRule, style, property, isShorthand, inherited, overloaded); 1072 1072 this.propertiesTreeOutline.appendChild(item); 1073 1073 handledProperties[property.name] = property; … … 1093 1093 var style = this.styleRule.style; 1094 1094 var property = style.newBlankProperty(); 1095 var item = new WebInspector.StylePropertyTreeElement(this ._parentPane, this.styleRule, style, property, false, false, false);1095 var item = new WebInspector.StylePropertyTreeElement(this, this._parentPane, this.styleRule, style, property, false, false, false); 1096 1096 this.propertiesTreeOutline.appendChild(item); 1097 1097 item.listItemElement.textContent = ""; … … 1299 1299 var property = uniqueProperties[i]; 1300 1300 var inherited = this._isPropertyInherited(property.name); 1301 var item = new WebInspector.StylePropertyTreeElement( null, this.styleRule, style, property, false, inherited, false);1301 var item = new WebInspector.StylePropertyTreeElement(this, null, this.styleRule, style, property, false, inherited, false); 1302 1302 this.propertiesTreeOutline.appendChild(item); 1303 1303 this._propertyTreeElements[property.name] = item; … … 1425 1425 * @param {?WebInspector.StylesSidebarPane} parentPane 1426 1426 */ 1427 WebInspector.StylePropertyTreeElement = function( parentPane, styleRule, style, property, shorthand, inherited, overloaded)1427 WebInspector.StylePropertyTreeElement = function(section, parentPane, styleRule, style, property, shorthand, inherited, overloaded) 1428 1428 { 1429 this.section = section; 1429 1430 this._parentPane = parentPane; 1430 1431 this._styleRule = styleRule; … … 1820 1821 1821 1822 var liveProperty = this.style.getLiveProperty(name); 1822 var item = new WebInspector.StylePropertyTreeElement(this ._parentPane, this._styleRule, this.style, liveProperty, false, inherited, overloaded);1823 var item = new WebInspector.StylePropertyTreeElement(this, this._parentPane, this._styleRule, this.style, liveProperty, false, inherited, overloaded); 1823 1824 this.appendChild(item); 1824 1825 }
Note: See TracChangeset
for help on using the changeset viewer.