Web Inspector: Allow user to choose stylesheet when creating new rules
authordrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 Jun 2017 23:53:10 +0000 (23:53 +0000)
committerdrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 Jun 2017 23:53:10 +0000 (23:53 +0000)
commit08d36739e0b300cce19b1e8f8c554f0547b85874
tree95fe31dfa2f57f1c35fbb2110fd732066db3ef91
parent90a6cf929538ed1055ed4e68cfd4856b99834812
Web Inspector: Allow user to choose stylesheet when creating new rules
https://bugs.webkit.org/show_bug.cgi?id=172487

Reviewed by Joseph Pecoraro.

Source/WebCore:

New test: inspector/css/add-rule.html

* inspector/InspectorStyleSheet.cpp:
(WebCore::InspectorStyleSheet::addRule):
Reparse the content when a new rule is added to a non-inspector origin stylesheet.

Source/WebInspectorUI:

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Models/DOMNodeStyles.js:
(WebInspector.DOMNodeStyles.prototype.addRule.inspectorStyleSheetAvailable):
(WebInspector.DOMNodeStyles.prototype.addRule):
* UserInterface/Views/CSSStyleDetailsSidebarPanel.js:
(WebInspector.CSSStyleDetailsSidebarPanel.prototype.initialLayout):
(WebInspector.CSSStyleDetailsSidebarPanel.prototype._newRuleButtonContextMenu):
* UserInterface/Views/RulesStyleDetailsPanel.js:
(WebInspector.RulesStyleDetailsPanel.prototype.newRuleButtonClicked):
(WebInspector.RulesStyleDetailsPanel.prototype.newRuleButtonContextMenu):
* UserInterface/Views/VisualStyleSelectorSection.js:
(WebInspector.VisualStyleSelectorSection):
(WebInspector.VisualStyleSelectorSection.prototype._addNewRuleContextMenu):
(WebInspector.VisualStyleSelectorSection.prototype._addNewRule): Renamed _addNewRuleClick.

LayoutTests:

* inspector/css/add-rule-expected.html: Added.
* inspector/css/add-rule.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217911 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/inspector/css/add-rule-expected.txt [new file with mode: 0644]
LayoutTests/inspector/css/add-rule.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/inspector/InspectorStyleSheet.cpp
Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js
Source/WebInspectorUI/UserInterface/Models/DOMNodeStyles.js
Source/WebInspectorUI/UserInterface/Views/CSSStyleDetailsSidebarPanel.js
Source/WebInspectorUI/UserInterface/Views/RulesStyleDetailsPanel.js
Source/WebInspectorUI/UserInterface/Views/VisualStyleSelectorSection.js