Web Inspector: remove Legacy Style Editor
authordrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 21 Sep 2018 18:30:10 +0000 (18:30 +0000)
committerdrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 21 Sep 2018 18:30:10 +0000 (18:30 +0000)
https://bugs.webkit.org/show_bug.cgi?id=189808

Reviewed by Joseph Pecoraro.

Source/WebInspectorUI:

The Legacy Style Editor has been hidden behind an "experimental" setting for almost a year.
It's time that we remove it, especially since the new Style Editor is at a similar, if not
more advanced, state.

* .eslintrc:
* WebInspectorUI.vcxproj/WebInspectorUI.vcxproj:
* WebInspectorUI.vcxproj/WebInspectorUI.vcxproj.filters:
* Localizations/en.lproj/localizedStrings.js:
* Tools/PrettyPrinting/index.html:
* UserInterface/Main.html:
* UserInterface/Test.html:
* UserInterface/Base/Setting.js:

* UserInterface/Base/TextUtilities.js: Removed.
* UserInterface/Base/Utilities.js:

* UserInterface/Views/RulesStyleDetailsPanel.css: Removed.
* UserInterface/Views/RulesStyleDetailsPanel.js: Removed.
* UserInterface/Views/CSSStyleDeclarationSection.css: Removed.
* UserInterface/Views/CSSStyleDeclarationSection.js: Removed.
* UserInterface/Views/CSSStyleDeclarationTextEditor.css: Removed.
* UserInterface/Views/CSSStyleDeclarationTextEditor.js: Removed.

* UserInterface/Models/CSSProperty.js:
(WI.CSSProperty.prototype.get text):
(WI.CSSProperty.prototype.get synthesizedText): Deleted.

* UserInterface/Models/CSSStyleDeclaration.js:
(WI.CSSStyleDeclaration):
(WI.CSSStyleDeclaration.prototype.set text):
(WI.CSSStyleDeclaration.prototype.resetText): Deleted.
(WI.CSSStyleDeclaration.prototype.get modified): Deleted.
(WI.CSSStyleDeclaration.prototype.generateCSSRuleString): Deleted.
(WI.CSSStyleDeclaration.prototype.isInspectorRule): Deleted.

* UserInterface/Models/CSSSelector.js:
(WI.CSSSelector.prototype.isGreaterThan): Deleted.

* UserInterface/Models/CSSRule.js:
(WI.CSSRule.prototype.update):
(WI.CSSRule.prototype.get matchedSelectors): Deleted.
(WI.CSSRule.prototype.get matchedSelectorText): Deleted.
(WI.CSSRule.prototype.hasMatchedPseudoElementSelector): Deleted.
(WI.CSSRule.prototype.get mediaText): Deleted.
(WI.CSSRule.prototype.get mostSpecificSelector): Deleted.
(WI.CSSRule.prototype.selectorIsGreater): Deleted.
(WI.CSSRule.prototype._determineMostSpecificSelector): Deleted.

* UserInterface/Models/DOMNodeStyles.js:
(WI.DOMNodeStyles.prototype.changeRule.changeCompleted): Deleted.
(WI.DOMNodeStyles.prototype.changeRule.styleChanged): Deleted.
(WI.DOMNodeStyles.prototype.changeRule.changeText): Deleted.
(WI.DOMNodeStyles.prototype.changeRule.ruleSelectorChanged): Deleted.
(WI.DOMNodeStyles.prototype.changeRule): Deleted.

* UserInterface/Models/CSSCompletions.js:
(WI.CSSCompletions.prototype.isValidPropertyName):
(WI.CSSCompletions):
(WI.CSSCompletions.prototype.keySet): Deleted.
(WI.CSSCompletions.prototype.propertyRequiresWebkitPrefix): Deleted.
(WI.CSSCompletions.prototype.getClosestPropertyName): Deleted.

* UserInterface/Views/ComputedStyleDetailsPanel.js:
(WI.ComputedStyleDetailsPanel.prototype.cssStyleDeclarationTextEditorStartEditingAdjacentRule): Deleted.

* UserInterface/Views/RulesStyleDetailsSidebarPanel.js:
(WI.RulesStyleDetailsSidebarPanel):

* UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:
(WI.SpreadsheetCSSStyleDeclarationEditor.prototype.spreadsheetStylePropertyFocusMoved):

* UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
(WI.SpreadsheetCSSStyleDeclarationSection.prototype.spreadsheetCSSStyleDeclarationEditorStartEditingRuleSelector): Added.
(WI.SpreadsheetCSSStyleDeclarationSection.prototype.cssStyleDeclarationTextEditorStartEditingRuleSelector): Deleted.

* UserInterface/Views/SpreadsheetRulesStyleDetailsPanel.js:
(WI.SpreadsheetRulesStyleDetailsPanel):
* UserInterface/Views/SpreadsheetRulesStyleDetailsPanel.css:
(.sidebar > .panel.details.css-style .rules): Added.
(.sidebar > .panel.details.css-style > .content > .rules .section-header): Added.
(.sidebar > .panel.details.css-style > .content > .rules .section-header .node-link): Added.
(.sidebar > .panel.details.css-style > .content > .rules .section-header .node-link:hover): Added.
(.sidebar > .panel.details.css-style > .content > .rules > .message-text-view): Added.
(.sidebar > .panel.details.css-style > .content > .rules:not(.filter-non-matching) > .message-text-view): Added.
(@media (prefers-dark-interface)):
(.sidebar > .panel.details.css-style > .content > .rules .section-header): Added.
(.sidebar > .panel.details.css-style > .content > .rules .section-header .node-link:hover): Added.
(.spreadsheet-style-panel .section-header): Deleted.
(.spreadsheet-style-panel .section-header .node-link): Deleted.
(.spreadsheet-style-panel .section-header .node-link:hover): Deleted.
(.spreadsheet-style-panel .section-header): Deleted.
(.spreadsheet-style-panel .section-header .node-link:hover): Deleted.

* UserInterface/Views/CodeMirrorAdditions.js:
(extendedCSSRuleStartState): Removed.
* UserInterface/Views/CodeMirrorFormatters.js:
Remove "css-rule" CodeMirror mode.

* UserInterface/Views/CodeMirrorTextMarkers.js:
(createCodeMirrorVariableTextMarkers): Deleted.

* UserInterface/Views/SettingsTabContentView.js:
(WI.SettingsTabContentView.prototype._createExperimentalSettingsView):

LayoutTests:

* platform/gtk/TestExpectations:
* platform/mac/TestExpectations:

* inspector/css/css-property-expected.txt:
* inspector/css/css-property.html:
* inspector/css/modify-css-property.html:
* inspector/css/shadow-scoped-style.html:
Update tests for functionality that has been deleted.

* inspector/unit-tests/test-harness-expect-functions-expected.txt:
* inspector/unit-tests/test-harness-expect-functions.html:
The changes to `WI.CSSRule` now make it small enough that `InspectorTest` will print it as
JSON instead of an object instance. Change the test to use different objects so this doesn't
happen.

* inspector/unit-tests/text-utilities-expected.txt: Removed.
* inspector/unit-tests/text-utilities.html: Removed.
* inspector/css/generate-css-rule-string-expected.txt: Removed.
* inspector/css/generate-css-rule-string.html: Removed.
Remove tests for functionality that has been deleted.

* inspector/codemirror/prettyprinting-css-rules.html: Removed.
* inspector/codemirror/resources/prettyprinting/css-rule-tests/add-whitespace-after-colon-expected.css: Removed.
* inspector/codemirror/resources/prettyprinting/css-rule-tests/add-whitespace-after-colon.css: Removed.
* inspector/codemirror/resources/prettyprinting/css-rule-tests/add-whitespace-after-comma-expected.css: Removed.
* inspector/codemirror/resources/prettyprinting/css-rule-tests/add-whitespace-after-comma.css: Removed.
* inspector/codemirror/resources/prettyprinting/css-rule-tests/add-whitespace-between-rules-expected.css: Removed.
* inspector/codemirror/resources/prettyprinting/css-rule-tests/add-whitespace-between-rules.css: Removed.
* inspector/codemirror/resources/prettyprinting/css-rule-tests/add-whitespace-between-values-expected.css: Removed.
* inspector/codemirror/resources/prettyprinting/css-rule-tests/add-whitespace-between-values.css: Removed.
* inspector/codemirror/resources/prettyprinting/css-rule-tests/css-variables-expected.css: Removed.
* inspector/codemirror/resources/prettyprinting/css-rule-tests/css-variables.css: Removed.
* inspector/codemirror/resources/prettyprinting/css-rule-tests/do-not-add-whitespace-before-prefixed-property-value-expected.css: Removed.
* inspector/codemirror/resources/prettyprinting/css-rule-tests/do-not-add-whitespace-before-prefixed-property-value.css: Removed.
* inspector/codemirror/resources/prettyprinting/css-rule-tests/do-not-append-semicolon-expected.css: Removed.
* inspector/codemirror/resources/prettyprinting/css-rule-tests/do-not-append-semicolon.css: Removed.
* inspector/codemirror/resources/prettyprinting/css-rule-tests/invalid-property-is-not-removed-expected.css: Removed.
* inspector/codemirror/resources/prettyprinting/css-rule-tests/invalid-property-is-not-removed.css: Removed.
* inspector/codemirror/resources/prettyprinting/css-rule-tests/keep-prefixed-value-expected.css: Removed.
* inspector/codemirror/resources/prettyprinting/css-rule-tests/keep-prefixed-value.css: Removed.
* inspector/codemirror/resources/prettyprinting/css-rule-tests/remove-newline-between-values-expected.css: Removed.
* inspector/codemirror/resources/prettyprinting/css-rule-tests/remove-newline-between-values.css: Removed.
* inspector/codemirror/resources/prettyprinting/css-rule-tests/remove-whitespace-before-colon-expected.css: Removed.
* inspector/codemirror/resources/prettyprinting/css-rule-tests/remove-whitespace-before-colon.css: Removed.
* inspector/codemirror/resources/prettyprinting/css-rule-tests/remove-whitespace-before-comment-expected.css: Removed.
* inspector/codemirror/resources/prettyprinting/css-rule-tests/remove-whitespace-before-comment.css: Removed.
* inspector/codemirror/resources/prettyprinting/css-rule-tests/remove-whitespace-before-invalid-property-expected.css: Removed.
* inspector/codemirror/resources/prettyprinting/css-rule-tests/remove-whitespace-before-invalid-property.css: Removed.
* inspector/codemirror/resources/prettyprinting/css-rule-tests/remove-whitespace-before-prefixed-property-expected.css: Removed.
* inspector/codemirror/resources/prettyprinting/css-rule-tests/remove-whitespace-before-prefixed-property.css: Removed.
* inspector/codemirror/resources/prettyprinting/css-rule-tests/remove-whitespace-before-property-expected.css: Removed.
* inspector/codemirror/resources/prettyprinting/css-rule-tests/remove-whitespace-before-property.css: Removed.
* inspector/codemirror/resources/prettyprinting/css-rule-tests/remove-whitespace-before-semicolon-expected.css: Removed.
* inspector/codemirror/resources/prettyprinting/css-rule-tests/remove-whitespace-before-semicolon.css: Removed.
* inspector/codemirror/resources/prettyprinting/css-rule-tests/split-comment-followed-by-comment-expected.css: Removed.
* inspector/codemirror/resources/prettyprinting/css-rule-tests/split-comment-followed-by-comment.css: Removed.
* inspector/codemirror/resources/prettyprinting/css-rule-tests/split-comment-followed-by-invalid-property-expected.css: Removed.
* inspector/codemirror/resources/prettyprinting/css-rule-tests/split-comment-followed-by-invalid-property.css: Removed.
* inspector/codemirror/resources/prettyprinting/css-rule-tests/split-comment-followed-by-prefixed-property-expected.css: Removed.
* inspector/codemirror/resources/prettyprinting/css-rule-tests/split-comment-followed-by-prefixed-property.css: Removed.
* inspector/codemirror/resources/prettyprinting/css-rule-tests/split-comment-followed-by-property-expected.css: Removed.
* inspector/codemirror/resources/prettyprinting/css-rule-tests/split-comment-followed-by-property.css: Removed.
* inspector/codemirror/resources/prettyprinting/css-rule-tests/split-invalid-property-followed-by-comment-expected.css: Removed.
* inspector/codemirror/resources/prettyprinting/css-rule-tests/split-invalid-property-followed-by-comment.css: Removed.
* inspector/codemirror/resources/prettyprinting/css-rule-tests/split-invalid-property-followed-by-invalid-property-expected.css: Removed.
* inspector/codemirror/resources/prettyprinting/css-rule-tests/split-invalid-property-followed-by-invalid-property.css: Removed.
* inspector/codemirror/resources/prettyprinting/css-rule-tests/split-invalid-property-followed-by-prefixed-property-expected.css: Removed.
* inspector/codemirror/resources/prettyprinting/css-rule-tests/split-invalid-property-followed-by-prefixed-property.css: Removed.
* inspector/codemirror/resources/prettyprinting/css-rule-tests/split-invalid-property-followed-by-property-expected.css: Removed.
* inspector/codemirror/resources/prettyprinting/css-rule-tests/split-invalid-property-followed-by-property.css: Removed.
* inspector/codemirror/resources/prettyprinting/css-rule-tests/split-property-followed-by-comment-expected.css: Removed.
* inspector/codemirror/resources/prettyprinting/css-rule-tests/split-property-followed-by-comment.css: Removed.
* inspector/codemirror/resources/prettyprinting/css-rule-tests/split-property-followed-by-invalid-property-expected.css: Removed.
* inspector/codemirror/resources/prettyprinting/css-rule-tests/split-property-followed-by-invalid-property.css: Removed.
* inspector/codemirror/resources/prettyprinting/css-rule-tests/split-property-followed-by-prefixed-property-expected.css: Removed.
* inspector/codemirror/resources/prettyprinting/css-rule-tests/split-property-followed-by-prefixed-property.css: Removed.
* inspector/codemirror/resources/prettyprinting/css-rule-tests/split-property-followed-by-property-expected.css: Removed.
* inspector/codemirror/resources/prettyprinting/css-rule-tests/split-property-followed-by-property.css: Removed.
* inspector/codemirror/resources/prettyprinting/css-rule-tests/split-property-without-semicolon-followed-by-comment-and-property-expected.css: Removed.
* inspector/codemirror/resources/prettyprinting/css-rule-tests/split-property-without-semicolon-followed-by-comment-and-property.css: Removed.
Remove all tests for the "css-rule" CodeMirror mode since it's been removed.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236336 268f45cc-cd09-0410-ab3c-d52691b4dbfc

105 files changed:
LayoutTests/ChangeLog
LayoutTests/inspector/codemirror/prettyprinting-css-rules.html [deleted file]
LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/add-whitespace-after-colon-expected.css [deleted file]
LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/add-whitespace-after-colon.css [deleted file]
LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/add-whitespace-after-comma-expected.css [deleted file]
LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/add-whitespace-after-comma.css [deleted file]
LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/add-whitespace-between-rules-expected.css [deleted file]
LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/add-whitespace-between-rules.css [deleted file]
LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/add-whitespace-between-values-expected.css [deleted file]
LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/add-whitespace-between-values.css [deleted file]
LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/css-variables-expected.css [deleted file]
LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/css-variables.css [deleted file]
LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/do-not-add-whitespace-before-prefixed-property-value-expected.css [deleted file]
LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/do-not-add-whitespace-before-prefixed-property-value.css [deleted file]
LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/do-not-append-semicolon-expected.css [deleted file]
LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/do-not-append-semicolon.css [deleted file]
LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/invalid-property-is-not-removed-expected.css [deleted file]
LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/invalid-property-is-not-removed.css [deleted file]
LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/keep-prefixed-value-expected.css [deleted file]
LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/keep-prefixed-value.css [deleted file]
LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/remove-newline-between-values-expected.css [deleted file]
LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/remove-newline-between-values.css [deleted file]
LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/remove-whitespace-before-colon-expected.css [deleted file]
LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/remove-whitespace-before-colon.css [deleted file]
LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/remove-whitespace-before-comment-expected.css [deleted file]
LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/remove-whitespace-before-comment.css [deleted file]
LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/remove-whitespace-before-invalid-property-expected.css [deleted file]
LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/remove-whitespace-before-invalid-property.css [deleted file]
LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/remove-whitespace-before-prefixed-property-expected.css [deleted file]
LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/remove-whitespace-before-prefixed-property.css [deleted file]
LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/remove-whitespace-before-property-expected.css [deleted file]
LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/remove-whitespace-before-property.css [deleted file]
LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/remove-whitespace-before-semicolon-expected.css [deleted file]
LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/remove-whitespace-before-semicolon.css [deleted file]
LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/split-comment-followed-by-comment-expected.css [deleted file]
LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/split-comment-followed-by-comment.css [deleted file]
LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/split-comment-followed-by-invalid-property-expected.css [deleted file]
LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/split-comment-followed-by-invalid-property.css [deleted file]
LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/split-comment-followed-by-prefixed-property-expected.css [deleted file]
LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/split-comment-followed-by-prefixed-property.css [deleted file]
LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/split-comment-followed-by-property-expected.css [deleted file]
LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/split-comment-followed-by-property.css [deleted file]
LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/split-invalid-property-followed-by-comment-expected.css [deleted file]
LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/split-invalid-property-followed-by-comment.css [deleted file]
LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/split-invalid-property-followed-by-invalid-property-expected.css [deleted file]
LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/split-invalid-property-followed-by-invalid-property.css [deleted file]
LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/split-invalid-property-followed-by-prefixed-property-expected.css [deleted file]
LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/split-invalid-property-followed-by-prefixed-property.css [deleted file]
LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/split-invalid-property-followed-by-property-expected.css [deleted file]
LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/split-invalid-property-followed-by-property.css [deleted file]
LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/split-property-followed-by-comment-expected.css [deleted file]
LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/split-property-followed-by-comment.css [deleted file]
LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/split-property-followed-by-invalid-property-expected.css [deleted file]
LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/split-property-followed-by-invalid-property.css [deleted file]
LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/split-property-followed-by-prefixed-property-expected.css [deleted file]
LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/split-property-followed-by-prefixed-property.css [deleted file]
LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/split-property-followed-by-property-expected.css [deleted file]
LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/split-property-followed-by-property.css [deleted file]
LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/split-property-without-semicolon-followed-by-comment-and-property-expected.css [deleted file]
LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/split-property-without-semicolon-followed-by-comment-and-property.css [deleted file]
LayoutTests/inspector/css/css-property-expected.txt
LayoutTests/inspector/css/css-property.html
LayoutTests/inspector/css/generate-css-rule-string-expected.txt [deleted file]
LayoutTests/inspector/css/generate-css-rule-string.html [deleted file]
LayoutTests/inspector/css/modify-css-property.html
LayoutTests/inspector/css/shadow-scoped-style.html
LayoutTests/inspector/unit-tests/test-harness-expect-functions-expected.txt
LayoutTests/inspector/unit-tests/test-harness-expect-functions.html
LayoutTests/inspector/unit-tests/text-utilities-expected.txt [deleted file]
LayoutTests/inspector/unit-tests/text-utilities.html [deleted file]
LayoutTests/platform/gtk/TestExpectations
LayoutTests/platform/mac/TestExpectations
Source/WebInspectorUI/.eslintrc
Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js
Source/WebInspectorUI/Tools/PrettyPrinting/index.html
Source/WebInspectorUI/UserInterface/Base/Setting.js
Source/WebInspectorUI/UserInterface/Base/TextUtilities.js [deleted file]
Source/WebInspectorUI/UserInterface/Base/Utilities.js
Source/WebInspectorUI/UserInterface/Main.html
Source/WebInspectorUI/UserInterface/Models/CSSCompletions.js
Source/WebInspectorUI/UserInterface/Models/CSSProperty.js
Source/WebInspectorUI/UserInterface/Models/CSSRule.js
Source/WebInspectorUI/UserInterface/Models/CSSSelector.js
Source/WebInspectorUI/UserInterface/Models/CSSStyleDeclaration.js
Source/WebInspectorUI/UserInterface/Models/DOMNodeStyles.js
Source/WebInspectorUI/UserInterface/Test.html
Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationSection.css [deleted file]
Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationSection.js [deleted file]
Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationTextEditor.css [deleted file]
Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationTextEditor.js [deleted file]
Source/WebInspectorUI/UserInterface/Views/CodeMirrorAdditions.js
Source/WebInspectorUI/UserInterface/Views/CodeMirrorFormatters.js
Source/WebInspectorUI/UserInterface/Views/CodeMirrorTextMarkers.js
Source/WebInspectorUI/UserInterface/Views/ComputedStyleDetailsPanel.js
Source/WebInspectorUI/UserInterface/Views/RulesStyleDetailsPanel.css [deleted file]
Source/WebInspectorUI/UserInterface/Views/RulesStyleDetailsPanel.js [deleted file]
Source/WebInspectorUI/UserInterface/Views/RulesStyleDetailsSidebarPanel.js
Source/WebInspectorUI/UserInterface/Views/SettingsTabContentView.js
Source/WebInspectorUI/UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js
Source/WebInspectorUI/UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js
Source/WebInspectorUI/UserInterface/Views/SpreadsheetRulesStyleDetailsPanel.css
Source/WebInspectorUI/UserInterface/Views/SpreadsheetRulesStyleDetailsPanel.js
Source/WebInspectorUI/WebInspectorUI.vcxproj/WebInspectorUI.vcxproj
Source/WebInspectorUI/WebInspectorUI.vcxproj/WebInspectorUI.vcxproj.filters

index e3d0781..b8e33c4 100644 (file)
@@ -1,3 +1,92 @@
+2018-09-21  Devin Rousso  <drousso@apple.com>
+
+        Web Inspector: remove Legacy Style Editor
+        https://bugs.webkit.org/show_bug.cgi?id=189808
+
+        Reviewed by Joseph Pecoraro.
+
+        * platform/gtk/TestExpectations:
+        * platform/mac/TestExpectations:
+
+        * inspector/css/css-property-expected.txt:
+        * inspector/css/css-property.html:
+        * inspector/css/modify-css-property.html:
+        * inspector/css/shadow-scoped-style.html:
+        Update tests for functionality that has been deleted.
+
+        * inspector/unit-tests/test-harness-expect-functions-expected.txt:
+        * inspector/unit-tests/test-harness-expect-functions.html:
+        The changes to `WI.CSSRule` now make it small enough that `InspectorTest` will print it as
+        JSON instead of an object instance. Change the test to use different objects so this doesn't
+        happen.
+
+        * inspector/unit-tests/text-utilities-expected.txt: Removed.
+        * inspector/unit-tests/text-utilities.html: Removed.
+        * inspector/css/generate-css-rule-string-expected.txt: Removed.
+        * inspector/css/generate-css-rule-string.html: Removed.
+        Remove tests for functionality that has been deleted.
+
+        * inspector/codemirror/prettyprinting-css-rules.html: Removed.
+        * inspector/codemirror/resources/prettyprinting/css-rule-tests/add-whitespace-after-colon-expected.css: Removed.
+        * inspector/codemirror/resources/prettyprinting/css-rule-tests/add-whitespace-after-colon.css: Removed.
+        * inspector/codemirror/resources/prettyprinting/css-rule-tests/add-whitespace-after-comma-expected.css: Removed.
+        * inspector/codemirror/resources/prettyprinting/css-rule-tests/add-whitespace-after-comma.css: Removed.
+        * inspector/codemirror/resources/prettyprinting/css-rule-tests/add-whitespace-between-rules-expected.css: Removed.
+        * inspector/codemirror/resources/prettyprinting/css-rule-tests/add-whitespace-between-rules.css: Removed.
+        * inspector/codemirror/resources/prettyprinting/css-rule-tests/add-whitespace-between-values-expected.css: Removed.
+        * inspector/codemirror/resources/prettyprinting/css-rule-tests/add-whitespace-between-values.css: Removed.
+        * inspector/codemirror/resources/prettyprinting/css-rule-tests/css-variables-expected.css: Removed.
+        * inspector/codemirror/resources/prettyprinting/css-rule-tests/css-variables.css: Removed.
+        * inspector/codemirror/resources/prettyprinting/css-rule-tests/do-not-add-whitespace-before-prefixed-property-value-expected.css: Removed.
+        * inspector/codemirror/resources/prettyprinting/css-rule-tests/do-not-add-whitespace-before-prefixed-property-value.css: Removed.
+        * inspector/codemirror/resources/prettyprinting/css-rule-tests/do-not-append-semicolon-expected.css: Removed.
+        * inspector/codemirror/resources/prettyprinting/css-rule-tests/do-not-append-semicolon.css: Removed.
+        * inspector/codemirror/resources/prettyprinting/css-rule-tests/invalid-property-is-not-removed-expected.css: Removed.
+        * inspector/codemirror/resources/prettyprinting/css-rule-tests/invalid-property-is-not-removed.css: Removed.
+        * inspector/codemirror/resources/prettyprinting/css-rule-tests/keep-prefixed-value-expected.css: Removed.
+        * inspector/codemirror/resources/prettyprinting/css-rule-tests/keep-prefixed-value.css: Removed.
+        * inspector/codemirror/resources/prettyprinting/css-rule-tests/remove-newline-between-values-expected.css: Removed.
+        * inspector/codemirror/resources/prettyprinting/css-rule-tests/remove-newline-between-values.css: Removed.
+        * inspector/codemirror/resources/prettyprinting/css-rule-tests/remove-whitespace-before-colon-expected.css: Removed.
+        * inspector/codemirror/resources/prettyprinting/css-rule-tests/remove-whitespace-before-colon.css: Removed.
+        * inspector/codemirror/resources/prettyprinting/css-rule-tests/remove-whitespace-before-comment-expected.css: Removed.
+        * inspector/codemirror/resources/prettyprinting/css-rule-tests/remove-whitespace-before-comment.css: Removed.
+        * inspector/codemirror/resources/prettyprinting/css-rule-tests/remove-whitespace-before-invalid-property-expected.css: Removed.
+        * inspector/codemirror/resources/prettyprinting/css-rule-tests/remove-whitespace-before-invalid-property.css: Removed.
+        * inspector/codemirror/resources/prettyprinting/css-rule-tests/remove-whitespace-before-prefixed-property-expected.css: Removed.
+        * inspector/codemirror/resources/prettyprinting/css-rule-tests/remove-whitespace-before-prefixed-property.css: Removed.
+        * inspector/codemirror/resources/prettyprinting/css-rule-tests/remove-whitespace-before-property-expected.css: Removed.
+        * inspector/codemirror/resources/prettyprinting/css-rule-tests/remove-whitespace-before-property.css: Removed.
+        * inspector/codemirror/resources/prettyprinting/css-rule-tests/remove-whitespace-before-semicolon-expected.css: Removed.
+        * inspector/codemirror/resources/prettyprinting/css-rule-tests/remove-whitespace-before-semicolon.css: Removed.
+        * inspector/codemirror/resources/prettyprinting/css-rule-tests/split-comment-followed-by-comment-expected.css: Removed.
+        * inspector/codemirror/resources/prettyprinting/css-rule-tests/split-comment-followed-by-comment.css: Removed.
+        * inspector/codemirror/resources/prettyprinting/css-rule-tests/split-comment-followed-by-invalid-property-expected.css: Removed.
+        * inspector/codemirror/resources/prettyprinting/css-rule-tests/split-comment-followed-by-invalid-property.css: Removed.
+        * inspector/codemirror/resources/prettyprinting/css-rule-tests/split-comment-followed-by-prefixed-property-expected.css: Removed.
+        * inspector/codemirror/resources/prettyprinting/css-rule-tests/split-comment-followed-by-prefixed-property.css: Removed.
+        * inspector/codemirror/resources/prettyprinting/css-rule-tests/split-comment-followed-by-property-expected.css: Removed.
+        * inspector/codemirror/resources/prettyprinting/css-rule-tests/split-comment-followed-by-property.css: Removed.
+        * inspector/codemirror/resources/prettyprinting/css-rule-tests/split-invalid-property-followed-by-comment-expected.css: Removed.
+        * inspector/codemirror/resources/prettyprinting/css-rule-tests/split-invalid-property-followed-by-comment.css: Removed.
+        * inspector/codemirror/resources/prettyprinting/css-rule-tests/split-invalid-property-followed-by-invalid-property-expected.css: Removed.
+        * inspector/codemirror/resources/prettyprinting/css-rule-tests/split-invalid-property-followed-by-invalid-property.css: Removed.
+        * inspector/codemirror/resources/prettyprinting/css-rule-tests/split-invalid-property-followed-by-prefixed-property-expected.css: Removed.
+        * inspector/codemirror/resources/prettyprinting/css-rule-tests/split-invalid-property-followed-by-prefixed-property.css: Removed.
+        * inspector/codemirror/resources/prettyprinting/css-rule-tests/split-invalid-property-followed-by-property-expected.css: Removed.
+        * inspector/codemirror/resources/prettyprinting/css-rule-tests/split-invalid-property-followed-by-property.css: Removed.
+        * inspector/codemirror/resources/prettyprinting/css-rule-tests/split-property-followed-by-comment-expected.css: Removed.
+        * inspector/codemirror/resources/prettyprinting/css-rule-tests/split-property-followed-by-comment.css: Removed.
+        * inspector/codemirror/resources/prettyprinting/css-rule-tests/split-property-followed-by-invalid-property-expected.css: Removed.
+        * inspector/codemirror/resources/prettyprinting/css-rule-tests/split-property-followed-by-invalid-property.css: Removed.
+        * inspector/codemirror/resources/prettyprinting/css-rule-tests/split-property-followed-by-prefixed-property-expected.css: Removed.
+        * inspector/codemirror/resources/prettyprinting/css-rule-tests/split-property-followed-by-prefixed-property.css: Removed.
+        * inspector/codemirror/resources/prettyprinting/css-rule-tests/split-property-followed-by-property-expected.css: Removed.
+        * inspector/codemirror/resources/prettyprinting/css-rule-tests/split-property-followed-by-property.css: Removed.
+        * inspector/codemirror/resources/prettyprinting/css-rule-tests/split-property-without-semicolon-followed-by-comment-and-property-expected.css: Removed.
+        * inspector/codemirror/resources/prettyprinting/css-rule-tests/split-property-without-semicolon-followed-by-comment-and-property.css: Removed.
+        Remove all tests for the "css-rule" CodeMirror mode since it's been removed.
+
 2018-09-21  Antoine Quint  <graouts@apple.com>
 
         REGRESSION (r235962-r235963): Layout Test animations/suspend-resume-animation-events.html is a flaky failure
diff --git a/LayoutTests/inspector/codemirror/prettyprinting-css-rules.html b/LayoutTests/inspector/codemirror/prettyprinting-css-rules.html
deleted file mode 100644 (file)
index 0626f2a..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../http/tests/inspector/resources/inspector-test.js"></script>
-<script src="resources/prettyprinting/utilities.js"></script>
-<script>
-function test()
-{
-    let suite = InspectorTest.createAsyncSuite("CodeMirror.PrettyPrinting.CSSRules");
-
-    addPrettyPrintingTests(suite, "css-rule", [
-        "resources/prettyprinting/css-rule-tests/invalid-property-is-not-removed.css",
-        "resources/prettyprinting/css-rule-tests/remove-newline-between-values.css",
-        "resources/prettyprinting/css-rule-tests/remove-whitespace-before-colon.css",
-        "resources/prettyprinting/css-rule-tests/remove-whitespace-before-semicolon.css",
-        "resources/prettyprinting/css-rule-tests/remove-whitespace-before-property.css",
-        "resources/prettyprinting/css-rule-tests/remove-whitespace-before-prefixed-property.css",
-        "resources/prettyprinting/css-rule-tests/remove-whitespace-before-invalid-property.css",
-        "resources/prettyprinting/css-rule-tests/remove-whitespace-before-comment.css",
-        "resources/prettyprinting/css-rule-tests/split-comment-followed-by-property.css",
-        "resources/prettyprinting/css-rule-tests/split-comment-followed-by-prefixed-property.css",
-        "resources/prettyprinting/css-rule-tests/split-comment-followed-by-invalid-property.css",
-        "resources/prettyprinting/css-rule-tests/split-comment-followed-by-comment.css",
-        "resources/prettyprinting/css-rule-tests/split-property-followed-by-property.css",
-        "resources/prettyprinting/css-rule-tests/split-property-followed-by-prefixed-property.css",
-        "resources/prettyprinting/css-rule-tests/split-property-followed-by-invalid-property.css",
-        "resources/prettyprinting/css-rule-tests/split-property-followed-by-comment.css",
-        "resources/prettyprinting/css-rule-tests/split-invalid-property-followed-by-property.css",
-        "resources/prettyprinting/css-rule-tests/split-invalid-property-followed-by-prefixed-property.css",
-        "resources/prettyprinting/css-rule-tests/split-invalid-property-followed-by-invalid-property.css",
-        "resources/prettyprinting/css-rule-tests/split-invalid-property-followed-by-comment.css",
-        "resources/prettyprinting/css-rule-tests/split-property-without-semicolon-followed-by-comment-and-property.css",
-        "resources/prettyprinting/css-rule-tests/add-whitespace-between-values.css",
-        "resources/prettyprinting/css-rule-tests/add-whitespace-between-rules.css",
-        "resources/prettyprinting/css-rule-tests/add-whitespace-after-colon.css",
-        "resources/prettyprinting/css-rule-tests/add-whitespace-after-comma.css",
-        "resources/prettyprinting/css-rule-tests/do-not-append-semicolon.css",
-        "resources/prettyprinting/css-rule-tests/do-not-add-whitespace-before-prefixed-property-value.css",
-        "resources/prettyprinting/css-rule-tests/keep-prefixed-value.css",
-        "resources/prettyprinting/css-rule-tests/css-variables.css",
-    ]);
-
-    suite.runTestCasesAndFinish();
-}
-</script>
-</head>
-<body onload="runTest()">
-<p>Test CSS Rule pretty printing with CodeMirror.</p>
-</body>
-</html>
diff --git a/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/add-whitespace-after-colon-expected.css b/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/add-whitespace-after-colon-expected.css
deleted file mode 100644 (file)
index c486d5e..0000000
+++ /dev/null
@@ -1 +0,0 @@
-display: none;
diff --git a/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/add-whitespace-after-colon.css b/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/add-whitespace-after-colon.css
deleted file mode 100644 (file)
index 3e934b4..0000000
+++ /dev/null
@@ -1 +0,0 @@
-display:none;
diff --git a/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/add-whitespace-after-comma-expected.css b/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/add-whitespace-after-comma-expected.css
deleted file mode 100644 (file)
index 53351cb..0000000
+++ /dev/null
@@ -1 +0,0 @@
-font-family: Helvetica, Arial;
diff --git a/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/add-whitespace-after-comma.css b/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/add-whitespace-after-comma.css
deleted file mode 100644 (file)
index a5843f2..0000000
+++ /dev/null
@@ -1 +0,0 @@
-font-family: Helvetica,Arial;
diff --git a/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/add-whitespace-between-rules-expected.css b/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/add-whitespace-between-rules-expected.css
deleted file mode 100644 (file)
index 8a7109d..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-color: red;
-margin: auto;
-background-color: rgba(0, 0, 0, 0.5);
diff --git a/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/add-whitespace-between-rules.css b/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/add-whitespace-between-rules.css
deleted file mode 100644 (file)
index 35ca4cb..0000000
+++ /dev/null
@@ -1 +0,0 @@
-color:red;margin:auto;background-color:rgba(0,0,0,0.5);
\ No newline at end of file
diff --git a/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/add-whitespace-between-values-expected.css b/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/add-whitespace-between-values-expected.css
deleted file mode 100644 (file)
index b0071fd..0000000
+++ /dev/null
@@ -1 +0,0 @@
-border: 1px solid black;
diff --git a/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/add-whitespace-between-values.css b/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/add-whitespace-between-values.css
deleted file mode 100644 (file)
index 9d459b9..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-border
-:
-1px
-solid
-black
-;
\ No newline at end of file
diff --git a/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/css-variables-expected.css b/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/css-variables-expected.css
deleted file mode 100644 (file)
index a449fd1..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-color: var(--foo-color);
---foo-color: red;
---foo-index: 1;
---foo-bar: 0;
diff --git a/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/css-variables.css b/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/css-variables.css
deleted file mode 100644 (file)
index 75801fa..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-color: var(--foo-color);
---foo-color: red; --foo-index: 1;
---foo-bar:0;
\ No newline at end of file
diff --git a/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/do-not-add-whitespace-before-prefixed-property-value-expected.css b/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/do-not-add-whitespace-before-prefixed-property-value-expected.css
deleted file mode 100644 (file)
index b767a1e..0000000
+++ /dev/null
@@ -1 +0,0 @@
-width: -webkit-calc(1px - 1px);
diff --git a/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/do-not-add-whitespace-before-prefixed-property-value.css b/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/do-not-add-whitespace-before-prefixed-property-value.css
deleted file mode 100644 (file)
index b767a1e..0000000
+++ /dev/null
@@ -1 +0,0 @@
-width: -webkit-calc(1px - 1px);
diff --git a/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/do-not-append-semicolon-expected.css b/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/do-not-append-semicolon-expected.css
deleted file mode 100644 (file)
index 4d0c857..0000000
+++ /dev/null
@@ -1 +0,0 @@
-display: none
diff --git a/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/do-not-append-semicolon.css b/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/do-not-append-semicolon.css
deleted file mode 100644 (file)
index 4d0c857..0000000
+++ /dev/null
@@ -1 +0,0 @@
-display: none
diff --git a/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/invalid-property-is-not-removed-expected.css b/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/invalid-property-is-not-removed-expected.css
deleted file mode 100644 (file)
index 16371dd..0000000
+++ /dev/null
@@ -1 +0,0 @@
-color;
diff --git a/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/invalid-property-is-not-removed.css b/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/invalid-property-is-not-removed.css
deleted file mode 100644 (file)
index 16371dd..0000000
+++ /dev/null
@@ -1 +0,0 @@
-color;
diff --git a/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/keep-prefixed-value-expected.css b/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/keep-prefixed-value-expected.css
deleted file mode 100644 (file)
index 19ab7f5..0000000
+++ /dev/null
@@ -1 +0,0 @@
-border: solid blue -webkit-calc(1px);
diff --git a/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/keep-prefixed-value.css b/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/keep-prefixed-value.css
deleted file mode 100644 (file)
index 19ab7f5..0000000
+++ /dev/null
@@ -1 +0,0 @@
-border: solid blue -webkit-calc(1px);
diff --git a/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/remove-newline-between-values-expected.css b/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/remove-newline-between-values-expected.css
deleted file mode 100644 (file)
index 45cb933..0000000
+++ /dev/null
@@ -1 +0,0 @@
-background: repeating-radial-gradient(circle, purple, purple 10px, #4b026f 10px, #4b026f 20px);
diff --git a/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/remove-newline-between-values.css b/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/remove-newline-between-values.css
deleted file mode 100644 (file)
index 1aa9ef1..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-background: repeating-radial-gradient(
-    circle,
-    purple,
-    purple 10px,
-    #4b026f 10px,
-    #4b026f 20px
-);
\ No newline at end of file
diff --git a/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/remove-whitespace-before-colon-expected.css b/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/remove-whitespace-before-colon-expected.css
deleted file mode 100644 (file)
index c486d5e..0000000
+++ /dev/null
@@ -1 +0,0 @@
-display: none;
diff --git a/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/remove-whitespace-before-colon.css b/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/remove-whitespace-before-colon.css
deleted file mode 100644 (file)
index 2f7d69b..0000000
+++ /dev/null
@@ -1 +0,0 @@
-display : none;
diff --git a/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/remove-whitespace-before-comment-expected.css b/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/remove-whitespace-before-comment-expected.css
deleted file mode 100644 (file)
index 5ae881e..0000000
+++ /dev/null
@@ -1 +0,0 @@
-/* display: none; */
diff --git a/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/remove-whitespace-before-comment.css b/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/remove-whitespace-before-comment.css
deleted file mode 100644 (file)
index 5ae881e..0000000
+++ /dev/null
@@ -1 +0,0 @@
-/* display: none; */
diff --git a/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/remove-whitespace-before-invalid-property-expected.css b/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/remove-whitespace-before-invalid-property-expected.css
deleted file mode 100644 (file)
index a61f4a3..0000000
+++ /dev/null
@@ -1 +0,0 @@
-invalid;
diff --git a/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/remove-whitespace-before-invalid-property.css b/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/remove-whitespace-before-invalid-property.css
deleted file mode 100644 (file)
index 9cf034f..0000000
+++ /dev/null
@@ -1 +0,0 @@
- invalid;
diff --git a/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/remove-whitespace-before-prefixed-property-expected.css b/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/remove-whitespace-before-prefixed-property-expected.css
deleted file mode 100644 (file)
index f7f970f..0000000
+++ /dev/null
@@ -1 +0,0 @@
--webkit-property: value;
diff --git a/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/remove-whitespace-before-prefixed-property.css b/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/remove-whitespace-before-prefixed-property.css
deleted file mode 100644 (file)
index 734291b..0000000
+++ /dev/null
@@ -1 +0,0 @@
- -webkit-property: value;
diff --git a/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/remove-whitespace-before-property-expected.css b/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/remove-whitespace-before-property-expected.css
deleted file mode 100644 (file)
index c486d5e..0000000
+++ /dev/null
@@ -1 +0,0 @@
-display: none;
diff --git a/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/remove-whitespace-before-property.css b/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/remove-whitespace-before-property.css
deleted file mode 100644 (file)
index 3cf77a3..0000000
+++ /dev/null
@@ -1 +0,0 @@
- display: none;
diff --git a/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/remove-whitespace-before-semicolon-expected.css b/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/remove-whitespace-before-semicolon-expected.css
deleted file mode 100644 (file)
index 16371dd..0000000
+++ /dev/null
@@ -1 +0,0 @@
-color;
diff --git a/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/remove-whitespace-before-semicolon.css b/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/remove-whitespace-before-semicolon.css
deleted file mode 100644 (file)
index 0067fb1..0000000
+++ /dev/null
@@ -1 +0,0 @@
-color ;
diff --git a/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/split-comment-followed-by-comment-expected.css b/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/split-comment-followed-by-comment-expected.css
deleted file mode 100644 (file)
index 3e62f0d..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-/* display: none; */
-/*another comment*/
diff --git a/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/split-comment-followed-by-comment.css b/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/split-comment-followed-by-comment.css
deleted file mode 100644 (file)
index 181b8eb..0000000
+++ /dev/null
@@ -1 +0,0 @@
-/* display: none; */ /*another comment*/
diff --git a/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/split-comment-followed-by-invalid-property-expected.css b/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/split-comment-followed-by-invalid-property-expected.css
deleted file mode 100644 (file)
index cbeb310..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-/* display: none; */
-invalid;
diff --git a/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/split-comment-followed-by-invalid-property.css b/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/split-comment-followed-by-invalid-property.css
deleted file mode 100644 (file)
index ac0ea29..0000000
+++ /dev/null
@@ -1 +0,0 @@
-/* display: none; */ invalid;
diff --git a/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/split-comment-followed-by-prefixed-property-expected.css b/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/split-comment-followed-by-prefixed-property-expected.css
deleted file mode 100644 (file)
index 0053020..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-/* display: none; */
--webkit-property: value;
diff --git a/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/split-comment-followed-by-prefixed-property.css b/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/split-comment-followed-by-prefixed-property.css
deleted file mode 100644 (file)
index 11568dc..0000000
+++ /dev/null
@@ -1 +0,0 @@
-/* display: none; */ -webkit-property: value;
diff --git a/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/split-comment-followed-by-property-expected.css b/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/split-comment-followed-by-property-expected.css
deleted file mode 100644 (file)
index 1296ed4..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-/* display: none; */
-color: red;
diff --git a/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/split-comment-followed-by-property.css b/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/split-comment-followed-by-property.css
deleted file mode 100644 (file)
index 4259fb5..0000000
+++ /dev/null
@@ -1 +0,0 @@
-/* display: none; */ color: red;
diff --git a/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/split-invalid-property-followed-by-comment-expected.css b/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/split-invalid-property-followed-by-comment-expected.css
deleted file mode 100644 (file)
index 531e72d..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-color;
-/* comment */
diff --git a/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/split-invalid-property-followed-by-comment.css b/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/split-invalid-property-followed-by-comment.css
deleted file mode 100644 (file)
index 50a7dcd..0000000
+++ /dev/null
@@ -1 +0,0 @@
-color; /* comment */
diff --git a/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/split-invalid-property-followed-by-invalid-property-expected.css b/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/split-invalid-property-followed-by-invalid-property-expected.css
deleted file mode 100644 (file)
index 0e987d5..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-color;
-invalid;
diff --git a/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/split-invalid-property-followed-by-invalid-property.css b/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/split-invalid-property-followed-by-invalid-property.css
deleted file mode 100644 (file)
index f5be8d8..0000000
+++ /dev/null
@@ -1 +0,0 @@
-color; invalid;
diff --git a/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/split-invalid-property-followed-by-prefixed-property-expected.css b/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/split-invalid-property-followed-by-prefixed-property-expected.css
deleted file mode 100644 (file)
index b4f8b81..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-color;
--webkit-property: value;
diff --git a/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/split-invalid-property-followed-by-prefixed-property.css b/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/split-invalid-property-followed-by-prefixed-property.css
deleted file mode 100644 (file)
index 271b502..0000000
+++ /dev/null
@@ -1 +0,0 @@
-color; -webkit-property: value;
diff --git a/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/split-invalid-property-followed-by-property-expected.css b/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/split-invalid-property-followed-by-property-expected.css
deleted file mode 100644 (file)
index f577faa..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-color;
-display: none;
diff --git a/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/split-invalid-property-followed-by-property.css b/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/split-invalid-property-followed-by-property.css
deleted file mode 100644 (file)
index a743d7e..0000000
+++ /dev/null
@@ -1 +0,0 @@
-color;display: none;
diff --git a/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/split-property-followed-by-comment-expected.css b/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/split-property-followed-by-comment-expected.css
deleted file mode 100644 (file)
index f2de963..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-display: none;
-/* comment */
diff --git a/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/split-property-followed-by-comment.css b/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/split-property-followed-by-comment.css
deleted file mode 100644 (file)
index 1645af9..0000000
+++ /dev/null
@@ -1 +0,0 @@
-display: none; /* comment */
diff --git a/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/split-property-followed-by-invalid-property-expected.css b/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/split-property-followed-by-invalid-property-expected.css
deleted file mode 100644 (file)
index f1c07c7..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-display: none;
-color;
diff --git a/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/split-property-followed-by-invalid-property.css b/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/split-property-followed-by-invalid-property.css
deleted file mode 100644 (file)
index 7d4d32b..0000000
+++ /dev/null
@@ -1 +0,0 @@
-display: none; color;
diff --git a/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/split-property-followed-by-prefixed-property-expected.css b/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/split-property-followed-by-prefixed-property-expected.css
deleted file mode 100644 (file)
index 9484fd3..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-color: red;
--webkit-property: value;
diff --git a/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/split-property-followed-by-prefixed-property.css b/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/split-property-followed-by-prefixed-property.css
deleted file mode 100644 (file)
index dbbdff6..0000000
+++ /dev/null
@@ -1 +0,0 @@
-color: red; -webkit-property: value;
diff --git a/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/split-property-followed-by-property-expected.css b/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/split-property-followed-by-property-expected.css
deleted file mode 100644 (file)
index 68b5fbe..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-color: red;
-display: none;
diff --git a/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/split-property-followed-by-property.css b/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/split-property-followed-by-property.css
deleted file mode 100644 (file)
index fc8fde3..0000000
+++ /dev/null
@@ -1 +0,0 @@
-color: red; display: none;
diff --git a/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/split-property-without-semicolon-followed-by-comment-and-property-expected.css b/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/split-property-without-semicolon-followed-by-comment-and-property-expected.css
deleted file mode 100644 (file)
index 1b56bb1..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-color: red
-/* comment */
-display: none;
diff --git a/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/split-property-without-semicolon-followed-by-comment-and-property.css b/LayoutTests/inspector/codemirror/resources/prettyprinting/css-rule-tests/split-property-without-semicolon-followed-by-comment-and-property.css
deleted file mode 100644 (file)
index 0feff3d..0000000
+++ /dev/null
@@ -1 +0,0 @@
-color: red /* comment */ display: none;
index e844f50..7b7d402 100644 (file)
@@ -47,7 +47,7 @@ PASS: "background-repeat-x" has the text "background-repeat-x: repeat;".
 PASS: "background-repeat-x" has the _text (private) "background-repeat-x: repeat;".
 PASS: "background-repeat-invalid" has the text "background-repeat-invalid: repeat;".
 PASS: "background-repeat-invalid" has the _text (private) "background-repeat-invalid: repeat;".
-PASS: "background-repeat-y" has the text "background-repeat-y: repeat;".
+PASS: "background-repeat-y" has the text "".
 PASS: "background-repeat-y" has the _text (private) "".
 
 -- Running test case: CSSProperty.prototype.remove
index 921620a..d3c6794 100644 (file)
@@ -187,7 +187,7 @@ function test() {
                         InspectorTest.expectEqual(property._text, "background-repeat-x: repeat;", `"${property.name}" has the _text (private) "background-repeat-x: repeat;".`);
                         break;
                     case "background-repeat-y":
-                        InspectorTest.expectEqual(property.text, "background-repeat-y: repeat;", `"${property.name}" has the text "background-repeat-y: repeat;".`);
+                        InspectorTest.expectEqual(property.text, "", `"${property.name}" has the text "".`);
                         InspectorTest.expectEqual(property._text, "", `"${property.name}" has the _text (private) "".`);
                         break;
                     case "background-repeat-invalid":
diff --git a/LayoutTests/inspector/css/generate-css-rule-string-expected.txt b/LayoutTests/inspector/css/generate-css-rule-string-expected.txt
deleted file mode 100644 (file)
index 1ae85ea..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-Testing that generated CSS rule strings have proper formatting.
-
-== Running test suite: CSS.generateCSSRuleString
--- Running test case: InlineStyleString
-#test-node {
-    background-color: red;
-}
-
--- Running test case: CSSRuleString0
-@media only screen and (min-width: 0px) {
-    body > div {
-        display: block;
-        width: 100%;
-        text-align: center;
-    }
-}
-
--- Running test case: CSSRuleString1
-* {
-    margin: 0;
-    padding: 0;
-}
-
--- Running test case: CSSRuleString2
-address, article, aside, div, footer, header, hgroup, layer, main, nav, section {
-}
-
diff --git a/LayoutTests/inspector/css/generate-css-rule-string.html b/LayoutTests/inspector/css/generate-css-rule-string.html
deleted file mode 100644 (file)
index bdbeb45..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<style>
-* { margin: 0; padding: 0; }
-
-@media only screen and (min-width: 0px) {
-    body > div {
-        display: block;
-        width: 100%;
-        text-align: center;
-    }
-}
-</style>
-<script src="../../http/tests/inspector/resources/inspector-test.js"></script>
-<script>
-function test() {
-    let nodeStyles;
-    let suite = InspectorTest.createAsyncSuite("CSS.generateCSSRuleString");
-
-    function validateSelectors()
-    {
-        suite.addTestCase({
-            name: "InlineStyleString",
-            description: "Check the formatting of the generated inline style string.",
-            test(resolve, reject) {
-                InspectorTest.log(nodeStyles.inlineStyle.generateCSSRuleString());
-                resolve();
-            }
-        });
-
-        for (let i = 0; i < nodeStyles.matchedRules.length; ++i) {
-            let rule = nodeStyles.matchedRules[i];
-            suite.addTestCase({
-                name: "CSSRuleString" + i,
-                description: "Check the formatting of the generated string for the matched CSS rule.",
-                test(resolve, reject) {
-                    InspectorTest.log(rule.style.generateCSSRuleString());
-                    resolve();
-                }
-            });
-        }
-
-        suite.runTestCasesAndFinish();
-    }
-
-    WI.domTreeManager.requestDocument((documentNode) => {
-        WI.domTreeManager.querySelector(documentNode.id, "#test-node", (contentNodeId) => {
-            if (!contentNodeId) {
-                InspectorTest.log("DOM node not found.");
-                InspectorTest.completeTest();
-                return;
-            }
-
-            let domNode = WI.domTreeManager.nodeForId(contentNodeId);
-            nodeStyles = WI.cssStyleManager.stylesForNode(domNode);
-            if (nodeStyles.needsRefresh) {
-                nodeStyles.awaitEvent(WI.DOMNodeStyles.Event.Refreshed)
-                .then(validateSelectors);
-            } else
-                validateSelectors();
-        });
-    });
-}
-</script>
-</head>
-<body onload="runTest()">
-    <p>Testing that generated CSS rule strings have proper formatting.</p>
-
-    <div id="test-node" style="background-color: red;"></div>
-</body>
-</html>
index 626e8cf..b195254 100644 (file)
@@ -114,14 +114,14 @@ function test() {
 
             styleDeclaration.locked = true;
             getProperty("width").rawValue = "64px";
-            InspectorTest.expectEqual(styleDeclaration.text, `\nwidth: 64px;`, `Style declaration text should update immediately.`);
+            InspectorTest.expectEqual(styleDeclaration.text, `width: 64px;`, `Style declaration text should update immediately.`);
 
             // WI.CSSStyleDeclaration.Event.PropertiesChanged event should not fire when the style declaration is locked.
             InspectorTest.evaluateInPage(`makeNarrow()`);
 
             styleDeclaration.locked = false;
             getProperty("width").rawValue = "128px";
-            InspectorTest.expectEqual(styleDeclaration.text, `\nwidth: 64px;`, `Style declaration text should stay "width: 64px".`);
+            InspectorTest.expectEqual(styleDeclaration.text, `width: 64px;`, `Style declaration text should stay "width: 64px".`);
 
             InspectorTest.evaluateInPage(`makeWide()`);
         }
index 9e61f91..e0a540c 100644 (file)
@@ -11,10 +11,27 @@ function test()
         return true;
     }
 
+    function generateCSSRuleString(style) {
+        let styleText = style.selectorText + " {\n";
+        for (let property of style.properties) {
+            if (property.anonymous)
+                continue;
+
+            styleText += "    " + property.text.trim();
+
+            if (!styleText.endsWith(";"))
+                styleText += ";";
+
+            styleText += "\n";
+        }
+        styleText += "}";
+        return styleText;
+    }
+
     function dumpStyleDeclarations(styles) {
         InspectorTest.log("STYLES:");
         for (let style of styles)
-            InspectorTest.log(style.generateCSSRuleString());
+            InspectorTest.log(generateCSSRuleString(style));
     }
 
     let documentNode;
index 5055d16..66bdbab 100644 (file)
@@ -98,7 +98,7 @@ FAIL: expectNotNull(null)
 Expected to PASS
 PASS: expectEqual(true, true)
 PASS: expectEqual({"a":1,"b":2}, {"a":1,"b":2})
-PASS: expectEqual(CSSStyleDeclaration instance #1, CSSStyleDeclaration instance #1)
+PASS: expectEqual(SourceCode instance #1, SourceCode instance #1)
 PASS: expectEqual(1.23, 1.23)
 PASS: expectEqual("abc", "abc")
 PASS: expectEqual(null, null)
@@ -110,9 +110,9 @@ FAIL: expectEqual(true, false)
 FAIL: expectEqual({"a":1,"b":2}, {"a":1,"b":2})
     Expected: {"a":1,"b":2}
     Actual: {"a":1,"b":2}
-FAIL: expectEqual(CSSStyleDeclaration instance #1, CSSRule instance #2)
-    Expected: CSSRule instance #2
-    Actual: CSSStyleDeclaration instance #1
+FAIL: expectEqual(SourceCode instance #1, Resource instance #2)
+    Expected: Resource instance #2
+    Actual: SourceCode instance #1
 FAIL: expectEqual(1.23, 4.56)
     Expected: 4.56
     Actual: 1.23
@@ -136,7 +136,7 @@ FAIL: expectEqual([], [])
 Expected to PASS
 PASS: expectNotEqual(true, false)
 PASS: expectNotEqual({"a":1,"b":2}, {"a":1,"b":2})
-PASS: expectNotEqual(CSSStyleDeclaration instance #1, CSSRule instance #2)
+PASS: expectNotEqual(SourceCode instance #1, Resource instance #2)
 PASS: expectNotEqual(1.23, 4.56)
 PASS: expectNotEqual("abc", "def")
 PASS: expectNotEqual(null, undefined)
@@ -150,9 +150,9 @@ FAIL: expectNotEqual(true, true)
 FAIL: expectNotEqual({"a":1,"b":2}, {"a":1,"b":2})
     Expected: not {"a":1,"b":2}
     Actual: {"a":1,"b":2}
-FAIL: expectNotEqual(CSSStyleDeclaration instance #1, CSSStyleDeclaration instance #1)
-    Expected: not CSSStyleDeclaration instance #1
-    Actual: CSSStyleDeclaration instance #1
+FAIL: expectNotEqual(SourceCode instance #1, SourceCode instance #1)
+    Expected: not SourceCode instance #1
+    Actual: SourceCode instance #1
 FAIL: expectNotEqual(1.23, 1.23)
     Expected: not 1.23
     Actual: 1.23
index cbe66ff..91e8580 100644 (file)
@@ -58,8 +58,8 @@ function test()
 
     let object1 = {a: 1, b: 2};
     let object2 = {a: 1, b: 2};
-    let customObject1 = new WI.CSSStyleDeclaration;
-    let customObject2 = new WI.CSSRule;
+    let customObject1 = new WI.SourceCode;
+    let customObject2 = new WI.Resource("foo.bar");
     let expectEqualTestCase = {
         functionName: "expectEqual",
         passingInputs: [
diff --git a/LayoutTests/inspector/unit-tests/text-utilities-expected.txt b/LayoutTests/inspector/unit-tests/text-utilities-expected.txt
deleted file mode 100644 (file)
index 1774ea5..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-Testing basic functionality of functions defined in TextUtilities.js.
-
-
-== Running test suite: TextUtilities
--- Running test case: WI.rangeForNextCSSNameOrValue
-PASS: Next name/value token in "" starting at index 0 is "" [0, 0]
-PASS: Next name/value token in "" starting at index 2 is "" [0, 0]
-PASS: Next name/value token in "foo" starting at index 0 is "foo" [0, 3]
-PASS: Next name/value token in "foo" starting at index 2 is "foo" [0, 3]
-PASS: Next name/value token in "foo:bar" starting at index 0 is "foo" [0, 3]
-PASS: Next name/value token in "foo:bar" starting at index 2 is "foo" [0, 3]
-PASS: Next name/value token in "foo:bar" starting at index 3 is "bar" [4, 7]
-PASS: Next name/value token in "foo:bar" starting at index 5 is "bar" [4, 7]
-PASS: Next name/value token in "foo:  bar  ;" starting at index 0 is "foo" [0, 3]
-PASS: Next name/value token in "foo:  bar  ;" starting at index 2 is "foo" [0, 3]
-PASS: Next name/value token in "foo:  bar  ;" starting at index 3 is "bar" [6, 9]
-PASS: Next name/value token in "foo:  bar  ;" starting at index 5 is "bar" [6, 9]
-PASS: Next name/value token in "foo: url(http://baz);" starting at index 0 is "foo" [0, 3]
-PASS: Next name/value token in "foo: url(http://baz);" starting at index 2 is "foo" [0, 3]
-PASS: Next name/value token in "foo: url(http://baz);" starting at index 3 is "url(http://baz)" [5, 20]
-PASS: Next name/value token in "foo: url(http://baz);" starting at index 5 is "url(http://baz)" [5, 20]
-
diff --git a/LayoutTests/inspector/unit-tests/text-utilities.html b/LayoutTests/inspector/unit-tests/text-utilities.html
deleted file mode 100644 (file)
index 8aaccee..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../http/tests/inspector/resources/inspector-test.js"></script>
-<script>
-function test()
-{
-    let suite = InspectorTest.createSyncSuite("TextUtilities");
-
-    suite.addTestCase({
-        name: "WI.rangeForNextCSSNameOrValue",
-        test() {
-            function testValid(text, index, expected) {
-                let actual = WI.rangeForNextCSSNameOrValue(text, index);
-                InspectorTest.expectShallowEqual(actual, expected, `Next name/value token in "${text}" starting at index ${index} is "${text.substring(actual.from, actual.to)}" [${actual.from}, ${actual.to}]`);
-            }
-
-            // Test empty string and out-of-bounds index
-            testValid("", 0, {from: 0, to: 0});
-            testValid("", 2, {from: 0, to: 0});
-
-            // Test basic string
-            testValid("foo", 0, {from: 0, to: 3});
-            testValid("foo", 2, {from: 0, to: 3});
-
-            // Test string with single colon
-            testValid("foo:bar", 0, {from: 0, to: 3});
-            testValid("foo:bar", 2, {from: 0, to: 3});
-            testValid("foo:bar", 3, {from: 4, to: 7});
-            testValid("foo:bar", 5, {from: 4, to: 7});
-
-            // Test string with extra whitespace
-            testValid("foo:  bar  ;", 0, {from: 0, to: 3});
-            testValid("foo:  bar  ;", 2, {from: 0, to: 3});
-            testValid("foo:  bar  ;", 3, {from: 6, to: 9});
-            testValid("foo:  bar  ;", 5, {from: 6, to: 9});
-
-            // Test string with multiple colons
-            testValid("foo: url(http://baz);", 0, {from: 0, to: 3});
-            testValid("foo: url(http://baz);", 2, {from: 0, to: 3});
-            testValid("foo: url(http://baz);", 3, {from: 5, to: 20});
-            testValid("foo: url(http://baz);", 5, {from: 5, to: 20});
-
-            return true;
-        }
-    });
-
-    suite.runTestCasesAndFinish();
-}
-</script>
-</head>
-<body onLoad="runTest()">
-    <p>Testing basic functionality of functions defined in TextUtilities.js.</p>
-</body>
-</html>
index aa97d3c..58102b7 100644 (file)
@@ -2101,7 +2101,6 @@ webkit.org/b/116958 http/tests/navigation/slowtimerredirect-basic.html [ Pass Sl
 
 webkit.org/b/149916 http/tests/inspector/dom/disconnect-dom-tree-after-main-frame-navigation.html [ Pass Slow ]
 webkit.org/b/149916 inspector/codemirror/prettyprinting-css.html [ Pass Slow ]
-webkit.org/b/149916 inspector/codemirror/prettyprinting-css-rules.html [ Pass Timeout ]
 webkit.org/b/149916 inspector/codemirror/prettyprinting-javascript.html [ Pass Slow ]
 webkit.org/b/149916 inspector/console/clearMessages.html [ Pass Slow ]
 webkit.org/b/149916 inspector/console/command-line-api.html [ Pass Slow ]
@@ -2112,7 +2111,6 @@ webkit.org/b/149916 inspector/console/messageRepeatCountUpdated.html [ Pass Slow
 webkit.org/b/149916 inspector/console/messagesCleared.html [ Pass Slow ]
 webkit.org/b/149916 inspector/controller/runtime-controller.html [ Pass Slow ]
 webkit.org/b/149916 inspector/css/createStyleSheet.html [ Pass Slow ]
-webkit.org/b/149916 inspector/css/generate-css-rule-string.html [ Pass Slow ]
 webkit.org/b/149916 inspector/css/getAllStyleSheets.html [ Pass Slow ]
 webkit.org/b/149916 inspector/css/get-system-fonts.html [ Pass Slow ]
 webkit.org/b/149916 inspector/css/manager-preferredInspectorStyleSheetForFrame.html [ Pass Slow ]
index 45d06f5..0d500cd 100644 (file)
@@ -1051,7 +1051,6 @@ webkit.org/b/174066 inspector/canvas/create-context-webgl2.html [ Pass Timeout ]
 webkit.org/b/174066 inspector/canvas/create-context-webgpu.html [ Pass Timeout ]
 webkit.org/b/174272 inspector/canvas/css-canvas-clients.html [ Pass Timeout ]
 webkit.org/b/174066 inspector/canvas/shaderProgram-add-remove-webgl2.html [ Pass Failure Timeout ]
-webkit.org/b/153460 inspector/codemirror/prettyprinting-css-rules.html [ Pass Timeout ]
 webkit.org/b/160048 [ Debug ] inspector/codemirror/prettyprinting-javascript.html [ Pass Timeout ]
 webkit.org/b/152025 [ Debug ] inspector/console/messagesCleared.html [ Pass Timeout ]
 webkit.org/b/152452 [ Debug ] inspector/console/messageRepeatCountUpdated.html [ Pass Timeout ]
index 5e6df59..75ea80b 100644 (file)
         "createCodeMirrorCubicBezierTextMarkers": true,
         "createCodeMirrorGradientTextMarkers": true,
         "createCodeMirrorSpringTextMarkers": true,
-        "createCodeMirrorVariableTextMarkers": true,
     },
     "rules": {
         "array-bracket-spacing": [2, "never"],
index ca8bcc5..1278e33 100644 (file)
@@ -1,3 +1,114 @@
+2018-09-21  Devin Rousso  <drousso@apple.com>
+
+        Web Inspector: remove Legacy Style Editor
+        https://bugs.webkit.org/show_bug.cgi?id=189808
+
+        Reviewed by Joseph Pecoraro.
+
+        The Legacy Style Editor has been hidden behind an "experimental" setting for almost a year.
+        It's time that we remove it, especially since the new Style Editor is at a similar, if not
+        more advanced, state.
+
+        * .eslintrc:
+        * WebInspectorUI.vcxproj/WebInspectorUI.vcxproj:
+        * WebInspectorUI.vcxproj/WebInspectorUI.vcxproj.filters:
+        * Localizations/en.lproj/localizedStrings.js:
+        * Tools/PrettyPrinting/index.html:
+        * UserInterface/Main.html:
+        * UserInterface/Test.html:
+        * UserInterface/Base/Setting.js:
+
+        * UserInterface/Base/TextUtilities.js: Removed.
+        * UserInterface/Base/Utilities.js:
+
+        * UserInterface/Views/RulesStyleDetailsPanel.css: Removed.
+        * UserInterface/Views/RulesStyleDetailsPanel.js: Removed.
+        * UserInterface/Views/CSSStyleDeclarationSection.css: Removed.
+        * UserInterface/Views/CSSStyleDeclarationSection.js: Removed.
+        * UserInterface/Views/CSSStyleDeclarationTextEditor.css: Removed.
+        * UserInterface/Views/CSSStyleDeclarationTextEditor.js: Removed.
+
+        * UserInterface/Models/CSSProperty.js:
+        (WI.CSSProperty.prototype.get text):
+        (WI.CSSProperty.prototype.get synthesizedText): Deleted.
+
+        * UserInterface/Models/CSSStyleDeclaration.js:
+        (WI.CSSStyleDeclaration):
+        (WI.CSSStyleDeclaration.prototype.set text):
+        (WI.CSSStyleDeclaration.prototype.resetText): Deleted.
+        (WI.CSSStyleDeclaration.prototype.get modified): Deleted.
+        (WI.CSSStyleDeclaration.prototype.generateCSSRuleString): Deleted.
+        (WI.CSSStyleDeclaration.prototype.isInspectorRule): Deleted.
+
+        * UserInterface/Models/CSSSelector.js:
+        (WI.CSSSelector.prototype.isGreaterThan): Deleted.
+
+        * UserInterface/Models/CSSRule.js:
+        (WI.CSSRule.prototype.update):
+        (WI.CSSRule.prototype.get matchedSelectors): Deleted.
+        (WI.CSSRule.prototype.get matchedSelectorText): Deleted.
+        (WI.CSSRule.prototype.hasMatchedPseudoElementSelector): Deleted.
+        (WI.CSSRule.prototype.get mediaText): Deleted.
+        (WI.CSSRule.prototype.get mostSpecificSelector): Deleted.
+        (WI.CSSRule.prototype.selectorIsGreater): Deleted.
+        (WI.CSSRule.prototype._determineMostSpecificSelector): Deleted.
+
+        * UserInterface/Models/DOMNodeStyles.js:
+        (WI.DOMNodeStyles.prototype.changeRule.changeCompleted): Deleted.
+        (WI.DOMNodeStyles.prototype.changeRule.styleChanged): Deleted.
+        (WI.DOMNodeStyles.prototype.changeRule.changeText): Deleted.
+        (WI.DOMNodeStyles.prototype.changeRule.ruleSelectorChanged): Deleted.
+        (WI.DOMNodeStyles.prototype.changeRule): Deleted.
+
+        * UserInterface/Models/CSSCompletions.js:
+        (WI.CSSCompletions.prototype.isValidPropertyName):
+        (WI.CSSCompletions):
+        (WI.CSSCompletions.prototype.keySet): Deleted.
+        (WI.CSSCompletions.prototype.propertyRequiresWebkitPrefix): Deleted.
+        (WI.CSSCompletions.prototype.getClosestPropertyName): Deleted.
+
+        * UserInterface/Views/ComputedStyleDetailsPanel.js:
+        (WI.ComputedStyleDetailsPanel.prototype.cssStyleDeclarationTextEditorStartEditingAdjacentRule): Deleted.
+
+        * UserInterface/Views/RulesStyleDetailsSidebarPanel.js:
+        (WI.RulesStyleDetailsSidebarPanel):
+
+        * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:
+        (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.spreadsheetStylePropertyFocusMoved):
+
+        * UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
+        (WI.SpreadsheetCSSStyleDeclarationSection.prototype.spreadsheetCSSStyleDeclarationEditorStartEditingRuleSelector): Added.
+        (WI.SpreadsheetCSSStyleDeclarationSection.prototype.cssStyleDeclarationTextEditorStartEditingRuleSelector): Deleted.
+
+        * UserInterface/Views/SpreadsheetRulesStyleDetailsPanel.js:
+        (WI.SpreadsheetRulesStyleDetailsPanel):
+        * UserInterface/Views/SpreadsheetRulesStyleDetailsPanel.css:
+        (.sidebar > .panel.details.css-style .rules): Added.
+        (.sidebar > .panel.details.css-style > .content > .rules .section-header): Added.
+        (.sidebar > .panel.details.css-style > .content > .rules .section-header .node-link): Added.
+        (.sidebar > .panel.details.css-style > .content > .rules .section-header .node-link:hover): Added.
+        (.sidebar > .panel.details.css-style > .content > .rules > .message-text-view): Added.
+        (.sidebar > .panel.details.css-style > .content > .rules:not(.filter-non-matching) > .message-text-view): Added.
+        (@media (prefers-dark-interface)):
+        (.sidebar > .panel.details.css-style > .content > .rules .section-header): Added.
+        (.sidebar > .panel.details.css-style > .content > .rules .section-header .node-link:hover): Added.
+        (.spreadsheet-style-panel .section-header): Deleted.
+        (.spreadsheet-style-panel .section-header .node-link): Deleted.
+        (.spreadsheet-style-panel .section-header .node-link:hover): Deleted.
+        (.spreadsheet-style-panel .section-header): Deleted.
+        (.spreadsheet-style-panel .section-header .node-link:hover): Deleted.
+
+        * UserInterface/Views/CodeMirrorAdditions.js:
+        (extendedCSSRuleStartState): Removed.
+        * UserInterface/Views/CodeMirrorFormatters.js:
+        Remove "css-rule" CodeMirror mode.
+
+        * UserInterface/Views/CodeMirrorTextMarkers.js:
+        (createCodeMirrorVariableTextMarkers): Deleted.
+
+        * UserInterface/Views/SettingsTabContentView.js:
+        (WI.SettingsTabContentView.prototype._createExperimentalSettingsView):
+
 2018-09-21  Mike Gorse  <mgorse@suse.com>
 
         Build tools should work when the /usr/bin/python is python3
index 5056c5a..31beba7 100644 (file)
@@ -68,7 +68,6 @@ localizedStrings["Accessibility Audit:"] = "Accessibility Audit:";
 localizedStrings["Action"] = "Action";
 localizedStrings["Activity Viewer"] = "Activity Viewer";
 localizedStrings["Add"] = "Add";
-localizedStrings["Add %s Rule"] = "Add %s Rule";
 localizedStrings["Add Action"] = "Add Action";
 localizedStrings["Add Breakpoint"] = "Add Breakpoint";
 localizedStrings["Add Event Breakpoint"] = "Add Event Breakpoint";
@@ -198,7 +197,6 @@ localizedStrings["Collapse All"] = "Collapse All";
 localizedStrings["Collapse columns"] = "Collapse columns";
 localizedStrings["Collect garbage"] = "Collect garbage";
 localizedStrings["Comment"] = "Comment";
-localizedStrings["Comment All Properties"] = "Comment All Properties";
 localizedStrings["Compare snapshots"] = "Compare snapshots";
 localizedStrings["Comparison of total memory size at the end of the selected time range to the maximum memory size in this recording"] = "Comparison of total memory size at the end of the selected time range to the maximum memory size in this recording";
 localizedStrings["Composite"] = "Composite";
@@ -234,14 +232,12 @@ localizedStrings["Copy Action"] = "Copy Action";
 localizedStrings["Copy Link Address"] = "Copy Link Address";
 localizedStrings["Copy Path to Property"] = "Copy Path to Property";
 localizedStrings["Copy Row"] = "Copy Row";
-localizedStrings["Copy Rule"] = "Copy Rule";
 localizedStrings["Copy Selected"] = "Copy Selected";
 localizedStrings["Copy Table"] = "Copy Table";
 localizedStrings["Copy as HTML"] = "Copy as HTML";
 localizedStrings["Copy as cURL"] = "Copy as cURL";
 localizedStrings["Could not fetch properties. Object may no longer exist."] = "Could not fetch properties. Object may no longer exist.";
 localizedStrings["Count"] = "Count";
-localizedStrings["Create %s Rule"] = "Create %s Rule";
 localizedStrings["Create a new tab"] = "Create a new tab";
 localizedStrings["Current"] = "Current";
 localizedStrings["Custom"] = "Custom";
@@ -270,7 +266,6 @@ localizedStrings["Delete Breakpoints"] = "Delete Breakpoints";
 localizedStrings["Detach into separate window"] = "Detach into separate window";
 localizedStrings["Detached"] = "Detached";
 localizedStrings["Details"] = "Details";
-localizedStrings["Did you mean “%s”?\nClick to replace."] = "Did you mean “%s”?\nClick to replace.";
 localizedStrings["Dimensions"] = "Dimensions";
 localizedStrings["Disable Breakpoint"] = "Disable Breakpoint";
 localizedStrings["Disable Breakpoints"] = "Disable Breakpoints";
@@ -294,9 +289,7 @@ localizedStrings["Domain"] = "Domain";
 localizedStrings["Done"] = "Done";
 localizedStrings["Download"] = "Download";
 localizedStrings["Download Web Archive"] = "Download Web Archive";
-localizedStrings["Duplicate Selector"] = "Duplicate Selector";
 localizedStrings["Duplicate property"] = "Duplicate property";
-localizedStrings["Duplicate property “%s”.\nClick to delete this property."] = "Duplicate property “%s”.\nClick to delete this property.";
 localizedStrings["Duration"] = "Duration";
 localizedStrings["Dynamically calculated for the parent element"] = "Dynamically calculated for the parent element";
 localizedStrings["Dynamically calculated for the selected element"] = "Dynamically calculated for the selected element";
@@ -389,7 +382,6 @@ localizedStrings["Filter Full URL"] = "Filter Full URL";
 localizedStrings["Find Next (%s)"] = "Find Next (%s)";
 localizedStrings["Find Previous (%s)"] = "Find Previous (%s)";
 localizedStrings["Flows"] = "Flows";
-localizedStrings["Focus %s Rule"] = "Focus %s Rule";
 localizedStrings["Focus on Subtree"] = "Focus on Subtree";
 localizedStrings["Focused"] = "Focused";
 localizedStrings["Font"] = "Font";
@@ -472,7 +464,6 @@ localizedStrings["Indexed Databases"] = "Indexed Databases";
 localizedStrings["Info: "] = "Info: ";
 localizedStrings["Infos"] = "Infos";
 localizedStrings["Inherited From"] = "Inherited From";
-localizedStrings["Inherited From: "] = "Inherited From: ";
 localizedStrings["Initial State"] = "Initial State";
 localizedStrings["Initial Velocity"] = "Initial Velocity";
 localizedStrings["Initiated"] = "Initiated";
@@ -501,7 +492,6 @@ localizedStrings["Layers:"] = "Layers:";
 localizedStrings["Layout"] = "Layout";
 localizedStrings["Layout & Rendering"] = "Layout & Rendering";
 localizedStrings["Layout Invalidated"] = "Layout Invalidated";
-localizedStrings["Legacy Style Editor"] = "Legacy Style Editor";
 localizedStrings["Line %d"] = "Line %d";
 localizedStrings["Line %d:%d"] = "Line %d:%d";
 localizedStrings["Line Number"] = "Line Number";
@@ -541,7 +531,6 @@ localizedStrings["Maximum Size: %s"] = "Maximum Size: %s";
 localizedStrings["Maximum maximum memory size in this recording"] = "Maximum maximum memory size in this recording";
 localizedStrings["Media"] = "Media";
 localizedStrings["Media Logging:"] = "Media Logging:";
-localizedStrings["Media: "] = "Media: ";
 localizedStrings["Medium"] = "Medium";
 localizedStrings["Memory"] = "Memory";
 localizedStrings["Memory Cache"] = "Memory Cache";
@@ -576,7 +565,6 @@ localizedStrings["No Layer Available"] = "No Layer Available";
 localizedStrings["No Parameters"] = "No Parameters";
 localizedStrings["No Preview Available"] = "No Preview Available";
 localizedStrings["No Properties"] = "No Properties";
-localizedStrings["No Properties \u2014 Click to Edit"] = "No Properties \u2014 Click to Edit";
 localizedStrings["No Query Parameters"] = "No Query Parameters";
 localizedStrings["No Request Headers"] = "No Request Headers";
 localizedStrings["No Response Headers"] = "No Response Headers";
@@ -845,7 +833,6 @@ localizedStrings["Style rule"] = "Style rule";
 localizedStrings["Styles"] = "Styles";
 localizedStrings["Styles Invalidated"] = "Styles Invalidated";
 localizedStrings["Styles Recalculated"] = "Styles Recalculated";
-localizedStrings["Styles Sidebar:"] = "Styles Sidebar:";
 localizedStrings["Styles \u2014 Computed"] = "Styles \u2014 Computed";
 localizedStrings["Styles \u2014 Rules"] = "Styles \u2014 Rules";
 localizedStrings["Stylesheet"] = "Stylesheet";
@@ -862,17 +849,10 @@ localizedStrings["Text"] = "Text";
 localizedStrings["Text Frame"] = "Text Frame";
 localizedStrings["Text Node"] = "Text Node";
 localizedStrings["The page's content has changed"] = "The page's content has changed";
-localizedStrings["The selector “%s” is invalid.\nClick to revert to the previous selector."] = "The selector “%s” is invalid.\nClick to revert to the previous selector.";
-localizedStrings["The value “%s” is not supported for this property.\nClick to delete and open autocomplete."] = "The value “%s” is not supported for this property.\nClick to delete and open autocomplete.";
-localizedStrings["The value “%s” needs units.\nClick to add “px” to the value."] = "The value “%s” needs units.\nClick to add “px” to the value.";
-localizedStrings["The variable “%s” does not exist.\nClick to delete and open autocomplete."] = "The variable “%s” does not exist.\nClick to delete and open autocomplete.";
 localizedStrings["The “%s”\ntable is empty."] = "The “%s”\ntable is empty.";
-localizedStrings["The “webkit” prefix is needed for this property.\nClick to insert a duplicate with the prefix."] = "The “webkit” prefix is needed for this property.\nClick to insert a duplicate with the prefix.";
-localizedStrings["The “webkit” prefix is not necessary.\nClick to insert a duplicate without the prefix."] = "The “webkit” prefix is not necessary.\nClick to insert a duplicate without the prefix.";
 localizedStrings["This action causes no visual change"] = "This action causes no visual change";
 localizedStrings["This object is a root"] = "This object is a root";
 localizedStrings["This object is referenced by internal objects"] = "This object is referenced by internal objects";
-localizedStrings["This property needs a value.\nClick to open autocomplete."] = "This property needs a value.\nClick to open autocomplete.";
 localizedStrings["This text resource could benefit from compression"] = "This text resource could benefit from compression";
 localizedStrings["Time"] = "Time";
 localizedStrings["Time to First Byte"] = "Time to First Byte";
@@ -908,14 +888,12 @@ localizedStrings["URL"] = "URL";
 localizedStrings["Unable to determine path to property from root"] = "Unable to determine path to property from root";
 localizedStrings["Unable to parse as JSON: %s"] = "Unable to parse as JSON: %s";
 localizedStrings["Uncaught Exceptions"] = "Uncaught Exceptions";
-localizedStrings["Uncomment All Properties"] = "Uncomment All Properties";
 localizedStrings["Undefined custom element"] = "Undefined custom element";
 localizedStrings["Unique"] = "Unique";
 localizedStrings["Unknown error"] = "Unknown error";
 localizedStrings["Unknown node"] = "Unknown node";
 localizedStrings["Unsupported property name"] = "Unsupported property name";
 localizedStrings["Unsupported property value"] = "Unsupported property value";
-localizedStrings["Unsupported property “%s”"] = "Unsupported property “%s”";
 localizedStrings["Untitled"] = "Untitled";
 localizedStrings["Use Default Media Styles"] = "Use Default Media Styles";
 localizedStrings["Use the resource cache when loading resources"] = "Use the resource cache when loading resources";
@@ -923,7 +901,6 @@ localizedStrings["User Agent"] = "User Agent";
 localizedStrings["User Agent Stylesheet"] = "User Agent Stylesheet";
 localizedStrings["User Interface:"] = "User Interface:";
 localizedStrings["User Stylesheet"] = "User Stylesheet";
-localizedStrings["Using previous selector “%s”"] = "Using previous selector “%s”";
 localizedStrings["Value"] = "Value";
 localizedStrings["Variables"] = "Variables";
 localizedStrings["Verbose"] = "Verbose";
index ddd9ebb..d42166a 100644 (file)
@@ -23,7 +23,6 @@
     <select id="mode">
         <option selected value="text/javascript">JavaScript</option>
         <option value="text/css">CSS</option>
-        <option value="css-rule">CSS-Rule</option>
     </select>
     <button id="populate">Populate</button>
     <button id="run-tests">Run Tests</button>
         lineNumbers: true,
     });
 
-    // In the frontend, keywords are added to the css mode to force the parser to recognize them as values.
-    // Here, the "calc" keyword is added to allow the css-rule tests to perform as they would in the frontend.
-    var modeSpec = CodeMirror.resolveMode("text/css");
-    modeSpec.valueKeywords["calc"] = true;
-
     // Initial values from URL.
     var queryParams = {};
     if (window.location.search.length > 0) {
 
         if (modePicker.value === "text/javascript")
             runJavaScriptTests(completedCallback);
-        else if (modePicker.value === "css-rule")
-            runCssRuleTests(completedCallback);
         else
             runCSSTests(completedCallback);
     }
             "javascript-tests/switch-case-default.js",
         ]);
     }
-    function runCssRuleTests(callback) {
-        _runTests(callback, [
-            "css-rule-tests/invalid-property-is-not-removed.css",
-            "css-rule-tests/remove-newline-between-values.css",
-            "css-rule-tests/remove-whitespace-before-colon.css",
-            "css-rule-tests/remove-whitespace-before-semicolon.css",
-            "css-rule-tests/remove-whitespace-before-property.css",
-            "css-rule-tests/remove-whitespace-before-prefixed-property.css",
-            "css-rule-tests/remove-whitespace-before-invalid-property.css",
-            "css-rule-tests/remove-whitespace-before-comment.css",
-            "css-rule-tests/split-comment-followed-by-property.css",
-            "css-rule-tests/split-comment-followed-by-prefixed-property.css",
-            "css-rule-tests/split-comment-followed-by-invalid-property.css",
-            "css-rule-tests/split-comment-followed-by-comment.css",
-            "css-rule-tests/split-property-followed-by-property.css",
-            "css-rule-tests/split-property-followed-by-prefixed-property.css",
-            "css-rule-tests/split-property-followed-by-invalid-property.css",
-            "css-rule-tests/split-property-followed-by-comment.css",
-            "css-rule-tests/split-invalid-property-followed-by-property.css",
-            "css-rule-tests/split-invalid-property-followed-by-prefixed-property.css",
-            "css-rule-tests/split-invalid-property-followed-by-invalid-property.css",
-            "css-rule-tests/split-invalid-property-followed-by-comment.css",
-            "css-rule-tests/split-property-without-semicolon-followed-by-comment-and-property.css",
-            "css-rule-tests/add-whitespace-between-values.css",
-            "css-rule-tests/add-whitespace-between-rules.css",
-            "css-rule-tests/add-whitespace-after-colon.css",
-            "css-rule-tests/add-whitespace-after-comma.css",
-            "css-rule-tests/do-not-append-semicolon.css",
-            "css-rule-tests/do-not-add-whitespace-before-prefixed-property-value.css",
-            "css-rule-tests/keep-prefixed-value.css",
-        ]);
-    }
     function runCSSTests(callback) {
         _runTests(callback, [
             "css-tests/basic.css",
index 8d84ef3..505ff82 100644 (file)
@@ -121,7 +121,6 @@ WI.settings = {
     // Experimental
     experimentalEnableLayersTab: new WI.Setting("experimental-enable-layers-tab", false),
     experimentalEnableSourcesTab: new WI.Setting("experimental-enable-sources-bar", false),
-    experimentalLegacyStyleEditor: new WI.Setting("experimental-legacy-style-editor", false),
     experimentalEnableNewTabBar: new WI.Setting("experimental-enable-new-tab-bar", false),
     experimentalEnableAccessibilityAuditTab: new WI.Setting("experimental-enable-accessibility-audit-tab", false),
     experimentalRecordingHasVisualEffect: new WI.Setting("experimental-recording-has-visual-effect", false),
diff --git a/Source/WebInspectorUI/UserInterface/Base/TextUtilities.js b/Source/WebInspectorUI/UserInterface/Base/TextUtilities.js
deleted file mode 100644 (file)
index 2f41532..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (C) 2017 Devin Rousso <webkit@devinrousso.com>. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-WI.rangeForNextCSSNameOrValue = function(text, index = 0) {
-    let from = 0;
-    let to = 0;
-
-    let colonIndex = text.indexOf(":");
-    if (index < colonIndex) {
-        from = 0;
-        to = colonIndex;
-    } else {
-        from = colonIndex + 1;
-        to = text.length;
-    }
-
-    let substring = text.substring(from, to);
-
-    // Don't select leading/trailing whitespace.
-    from += substring.match(/^\s*/)[0].length;
-    to -= substring.match(/[\s;]*$/)[0].length;
-
-    return {from, to};
-};
index 6cc4618..cd5d5de 100644 (file)
@@ -920,22 +920,6 @@ Object.defineProperty(String.prototype, "removeWordBreakCharacters",
     }
 });
 
-Object.defineProperty(String.prototype, "getMatchingIndexes",
-{
-    value(needle)
-    {
-        var indexesOfNeedle = [];
-        var index = this.indexOf(needle);
-
-        while (index >= 0) {
-            indexesOfNeedle.push(index);
-            index = this.indexOf(needle, index + 1);
-        }
-
-        return indexesOfNeedle;
-    }
-});
-
 Object.defineProperty(String.prototype, "levenshteinDistance",
 {
     value(s)
index 884ec76..89aceba 100644 (file)
@@ -38,8 +38,6 @@
     <link rel="stylesheet" href="Views/BreakpointTreeElement.css">
     <link rel="stylesheet" href="Views/ButtonNavigationItem.css">
     <link rel="stylesheet" href="Views/ButtonToolbarItem.css">
-    <link rel="stylesheet" href="Views/CSSStyleDeclarationSection.css">
-    <link rel="stylesheet" href="Views/CSSStyleDeclarationTextEditor.css">
     <link rel="stylesheet" href="Views/CallFrameIcons.css">
     <link rel="stylesheet" href="Views/CallFrameTreeElement.css">
     <link rel="stylesheet" href="Views/CallFrameView.css">
     <link rel="stylesheet" href="Views/ResourceTimelineDataGridNode.css">
     <link rel="stylesheet" href="Views/ResourceTimingBreakdownView.css">
     <link rel="stylesheet" href="Views/ResourceTreeElement.css">
-    <link rel="stylesheet" href="Views/RulesStyleDetailsPanel.css">
     <link rel="stylesheet" href="Views/ScopeBar.css">
     <link rel="stylesheet" href="Views/ScopeChainDetailsSidebarPanel.css">
     <link rel="stylesheet" href="Views/ScopeRadioButtonNavigationItem.css">
     <script src="Base/ImageUtilities.js"></script>
     <script src="Base/LoadLocalizedStrings.js"></script>
     <script src="Base/MIMETypeUtilities.js"></script>
-    <script src="Base/TextUtilities.js"></script>
     <script src="Base/URLUtilities.js"></script>
     <script src="Base/Utilities.js"></script>
     <script src="Base/Setting.js"></script>
     <script src="Views/BreakpointActionView.js"></script>
     <script src="Views/BreakpointTreeElement.js"></script>
     <script src="Views/ButtonToolbarItem.js"></script>
-    <script src="Views/CSSStyleDeclarationSection.js"></script>
-    <script src="Views/CSSStyleDeclarationTextEditor.js"></script>
     <script src="Views/CSSStyleSheetTreeElement.js"></script>
     <script src="Views/CallFrameTreeElement.js"></script>
     <script src="Views/CallFrameView.js"></script>
     <script src="Views/ResourceTimingBreakdownView.js"></script>
     <script src="Views/ResourceTimingContentView.js"></script>
     <script src="Views/ResourceTimingPopoverDataGridNode.js"></script>
-    <script src="Views/RulesStyleDetailsPanel.js"></script>
     <script src="Views/ScopeBar.js"></script>
     <script src="Views/ScopeBarItem.js"></script>
     <script src="Views/ScopeChainDetailsSidebarPanel.js"></script>
index 160944c..bb51ef3 100644 (file)
@@ -222,13 +222,6 @@ WI.CSSCompletions = class CSSCompletions
         return foundIndex;
     }
 
-    keySet()
-    {
-        if (!this._keySet)
-            this._keySet = this._values.keySet();
-        return this._keySet;
-    }
-
     next(str, prefix)
     {
         return this._closest(str, prefix, 1);
@@ -273,27 +266,6 @@ WI.CSSCompletions = class CSSCompletions
     {
         return this._values.includes(name);
     }
-
-    propertyRequiresWebkitPrefix(name)
-    {
-        return this._values.includes("-webkit-" + name) && !this._values.includes(name);
-    }
-
-    getClosestPropertyName(name)
-    {
-        var bestMatches = [{distance: Infinity, name: null}];
-
-        for (var property of this._values) {
-            var distance = name.levenshteinDistance(property);
-
-            if (distance < bestMatches[0].distance)
-                bestMatches = [{distance, name: property}];
-            else if (distance === bestMatches[0].distance)
-                bestMatches.push({distance, name: property});
-        }
-
-        return bestMatches.length < 3 ? bestMatches[0].name : false;
-    }
 };
 
 WI.CSSCompletions.cssNameCompletions = null;
index 98025a8..ed8460c 100644 (file)
@@ -150,19 +150,9 @@ WI.CSSProperty = class CSSProperty extends WI.Object
             this.text = this._text.slice(2, -2).trim();
     }
 
-    get synthesizedText()
-    {
-        var name = this.name;
-        if (!name)
-            return "";
-
-        var priority = this.priority;
-        return name + ": " + this.value.trim() + (priority ? " !" + priority : "") + ";";
-    }
-
     get text()
     {
-        return this._text || this.synthesizedText;
+        return this._text;
     }
 
     set text(newText)
index a327b14..fc5dd58 100644 (file)
@@ -80,13 +80,9 @@ WI.CSSRule = class CSSRule extends WI.Object
         this._selectorText = selectorText;
         this._selectors = selectors;
         this._matchedSelectorIndices = matchedSelectorIndices;
-        this._mostSpecificSelector = null;
         this._style = style;
         this._mediaList = mediaList;
 
-        this._matchedSelectors = null;
-        this._matchedSelectorText = null;
-
         if (this._style)
             this._style.ownerRule = this;
 
@@ -133,36 +129,6 @@ WI.CSSRule = class CSSRule extends WI.Object
         return this._matchedSelectorIndices;
     }
 
-    get matchedSelectors()
-    {
-        if (this._matchedSelectors)
-            return this._matchedSelectors;
-
-        this._matchedSelectors = this._selectors.filter(function(element, index) {
-            return this._matchedSelectorIndices.includes(index);
-        }, this);
-
-        return this._matchedSelectors;
-    }
-
-    get matchedSelectorText()
-    {
-        if ("_matchedSelectorText" in this)
-            return this._matchedSelectorText;
-
-        this._matchedSelectorText = this.matchedSelectors.map(function(x) { return x.text; }).join(", ");
-
-        return this._matchedSelectorText;
-    }
-
-    hasMatchedPseudoElementSelector()
-    {
-        if (this.nodeStyles && this.nodeStyles.node && this.nodeStyles.node.isPseudoElement())
-            return true;
-
-        return this.matchedSelectors.some((selector) => selector.isPseudoElementSelector());
-    }
-
     get style()
     {
         return this._style;
@@ -173,18 +139,6 @@ WI.CSSRule = class CSSRule extends WI.Object
         return this._mediaList;
     }
 
-    get mediaText()
-    {
-        if (!this._mediaList.length)
-            return "";
-
-        let mediaText = "";
-        for (let media of this._mediaList)
-            mediaText += media.text;
-
-        return mediaText;
-    }
-
     isEqualTo(rule)
     {
         if (!rule)
@@ -193,24 +147,6 @@ WI.CSSRule = class CSSRule extends WI.Object
         return Object.shallowEqual(this._id, rule.id);
     }
 
-    get mostSpecificSelector()
-    {
-        if (!this._mostSpecificSelector)
-            this._mostSpecificSelector = this._determineMostSpecificSelector();
-
-        return this._mostSpecificSelector;
-    }
-
-    selectorIsGreater(otherSelector)
-    {
-        var mostSpecificSelector = this.mostSpecificSelector;
-
-        if (!mostSpecificSelector)
-            return false;
-
-        return mostSpecificSelector.isGreaterThan(otherSelector);
-    }
-
     // Protected
 
     get nodeStyles()
@@ -220,26 +156,6 @@ WI.CSSRule = class CSSRule extends WI.Object
 
     // Private
 
-    _determineMostSpecificSelector()
-    {
-        if (!this._selectors || !this._selectors.length)
-            return null;
-
-        var selectors = this.matchedSelectors;
-
-        if (!selectors.length)
-            selectors = this._selectors;
-
-        var specificSelector = selectors[0];
-
-        for (var selector of selectors) {
-            if (selector.isGreaterThan(specificSelector))
-                specificSelector = selector;
-        }
-
-        return specificSelector;
-    }
-
     _selectorRejected(error)
     {
         this.dispatchEventToListeners(WI.CSSRule.Event.SelectorChanged, {valid: !error});
index 0496a27..bd39b86 100644 (file)
@@ -40,21 +40,6 @@ WI.CSSSelector = class CSSSelector
     get specificity() { return this._specificity; }
     get dynamic() { return this._dynamic; }
 
-    isGreaterThan(selector)
-    {
-        if (!selector || !selector.specificity)
-            return true;
-
-        for (var i = 0; i < this._specificity.length; ++i) {
-            if (this._specificity[i] === selector.specificity[i])
-                continue;
-
-            return this._specificity[i] > selector.specificity[i];
-        }
-
-        return false;
-    }
-
     isPseudoElementSelector()
     {
         return WI.CSSStyleManager.PseudoElementNames.some((name) => this._text.includes(`:${name}`));
index fb13e5f..62f1140 100644 (file)
@@ -44,9 +44,6 @@ WI.CSSStyleDeclaration = class CSSStyleDeclaration extends WI.Object
         this._pendingProperties = [];
         this._propertyNameMap = {};
 
-        this._initialText = text;
-        this._hasModifiedInitialText = false;
-
         this._allProperties = [];
         this._allVisibleProperties = null;
 
@@ -209,19 +206,13 @@ WI.CSSStyleDeclaration = class CSSStyleDeclaration extends WI.Object
         if (this._text === text)
             return;
 
-        let trimmedText = WI.CSSStyleDeclaration.PrefixWhitespace + text.trim();
+        let trimmedText = text.trim();
         if (this._text === trimmedText)
             return;
 
-        if (trimmedText === WI.CSSStyleDeclaration.PrefixWhitespace || this._type === WI.CSSStyleDeclaration.Type.Inline)
+        if (!trimmedText.length || this._type === WI.CSSStyleDeclaration.Type.Inline)
             text = trimmedText;
 
-        let modified = text !== this._initialText;
-        if (modified !== this._hasModifiedInitialText) {
-            this._hasModifiedInitialText = modified;
-            this.dispatchEventToListeners(WI.CSSStyleDeclaration.Event.InitialTextModified);
-        }
-
         // Update text immediately when it was modified via the styles sidebar.
         if (this._locked)
             this._text = text;
@@ -229,16 +220,6 @@ WI.CSSStyleDeclaration = class CSSStyleDeclaration extends WI.Object
         this._nodeStyles.changeStyleText(this, text);
     }
 
-    resetText()
-    {
-        this.text = this._initialText;
-    }
-
-    get modified()
-    {
-        return this._hasModifiedInitialText;
-    }
-
     get properties()
     {
         return this._properties;
@@ -333,42 +314,6 @@ WI.CSSStyleDeclaration = class CSSStyleDeclaration extends WI.Object
         return newProperty;
     }
 
-    generateCSSRuleString()
-    {
-        let indentString = WI.indentString();
-        let styleText = "";
-        let mediaList = this.mediaList;
-        let mediaQueriesCount = mediaList.length;
-        for (let i = mediaQueriesCount - 1; i >= 0; --i)
-            styleText += indentString.repeat(mediaQueriesCount - i - 1) + "@media " + mediaList[i].text + " {\n";
-
-        styleText += indentString.repeat(mediaQueriesCount) + this.selectorText + " {\n";
-
-        for (let property of this._properties) {
-            if (property.anonymous)
-                continue;
-
-            styleText += indentString.repeat(mediaQueriesCount + 1) + property.text.trim();
-
-            if (!styleText.endsWith(";"))
-                styleText += ";";
-
-            styleText += "\n";
-        }
-
-        for (let i = mediaQueriesCount; i > 0; --i)
-            styleText += indentString.repeat(i) + "}\n";
-
-        styleText += "}";
-
-        return styleText;
-    }
-
-    isInspectorRule()
-    {
-        return this._ownerRule && this._ownerRule.type === WI.CSSStyleSheet.Type.Inspector;
-    }
-
     hasProperties()
     {
         return !!this._properties.length;
@@ -447,7 +392,6 @@ WI.CSSStyleDeclaration = class CSSStyleDeclaration extends WI.Object
 
 WI.CSSStyleDeclaration.Event = {
     PropertiesChanged: "css-style-declaration-properties-changed",
-    InitialTextModified: "css-style-declaration-initial-text-modified"
 };
 
 WI.CSSStyleDeclaration.Type = {
@@ -456,5 +400,3 @@ WI.CSSStyleDeclaration.Type = {
     Attribute: "css-style-declaration-type-attribute",
     Computed: "css-style-declaration-type-computed"
 };
-
-WI.CSSStyleDeclaration.PrefixWhitespace = "\n";
index 11e6f97..7341d3c 100644 (file)
@@ -396,51 +396,6 @@ WI.DOMNodeStyles = class DOMNodeStyles extends WI.Object
         this._markAsNeedsRefresh();
     }
 
-    changeRule(rule, selector, text)
-    {
-        if (!rule)
-            return;
-
-        selector = selector || "";
-
-        function changeCompleted()
-        {
-            DOMAgent.markUndoableState();
-            this.refresh();
-        }
-
-        function styleChanged(error, stylePayload)
-        {
-            if (error)
-                return;
-
-            changeCompleted.call(this);
-        }
-
-        function changeText(styleId)
-        {
-            if (!text || !text.length) {
-                changeCompleted.call(this);
-                return;
-            }
-
-            CSSAgent.setStyleText(styleId, text, styleChanged.bind(this));
-        }
-
-        function ruleSelectorChanged(error, rulePayload)
-        {
-            if (error)
-                return;
-
-            changeText.call(this, rulePayload.style.styleId);
-        }
-
-        this._needsRefresh = true;
-        this._ignoreNextContentDidChangeForStyleSheet = rule.ownerStyleSheet;
-
-        CSSAgent.setRuleSelector(rule.id, selector, ruleSelectorChanged.bind(this));
-    }
-
     changeRuleSelector(rule, selector)
     {
         selector = selector || "";
index 831ca73..3da3a4d 100644 (file)
@@ -55,7 +55,6 @@
     <script src="Base/EventListenerSet.js"></script>
     <script src="Base/ImageUtilities.js"></script>
     <script src="Base/MIMETypeUtilities.js"></script>
-    <script src="Base/TextUtilities.js"></script>
     <script src="Base/URLUtilities.js"></script>
     <script src="Base/Utilities.js"></script>
     <script src="Base/Setting.js"></script>
diff --git a/Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationSection.css b/Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationSection.css
deleted file mode 100644 (file)
index fb18cd2..0000000
+++ /dev/null
@@ -1,185 +0,0 @@
-/*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-.style-declaration-section {
-    display: flex;
-    flex-direction: column;
-
-    padding: 3px;
-}
-
-.style-declaration-section.locked {
-    background-color: hsl(0, 0%, 97%);
-}
-
-.style-declaration-section:not(.locked) {
-    background-color: white;
-    border-top-color: hsla(0, 0%, 0%, 0.2);
-}
-
-.style-declaration-section.last-in-group {
-    margin-bottom: 10px;
-
-    border-bottom: 1px solid hsla(0, 0%, 0%, 0.3);
-}
-
-.style-declaration-section + .style-declaration-section {
-    border-top: 1px solid hsla(0, 0%, 0%, 0.15);
-}
-
-.style-declaration-section:last-child {
-    margin-bottom: 0 !important;
-}
-
-.style-declaration-section > .header {
-    position: relative;
-    font-size: 11px;
-    line-height: 12px;
-
-    --style-declaration-section-header-padding-start: 25px;
-    --style-declaration-section-header-padding-end: 5px;
-}
-
-.style-declaration-section > .header {
-    padding: 4px var(--style-declaration-section-header-padding-end) 3px var(--style-declaration-section-header-padding-start);
-}
-
-.style-declaration-section.locked > .header > .locked-icon {
-    width: 8px;
-    height: 10px;
-    content: url(../Images/Locked.svg);
-}
-
-.style-declaration-section.locked > .header > .locked-icon {
-    float: right;
-    margin-left: 5px;
-}
-
-.style-declaration-section > .header > .icon {
-    position: absolute;
-    top: 2px;
-    left: 4px;
-    width: 16px;
-    height: 16px;
-}
-
-.style-declaration-section > .header > .icon.toggle-able:hover {
-    filter: brightness(0.9);
-}
-
-.style-declaration-section > .header > .icon.toggle-able:active {
-    filter: brightness(0.8);
-}
-
-.style-declaration-section:not(.invalid-selector).rule-disabled > .header > .icon {
-    opacity: 0.5;
-}
-
-.style-declaration-section > .header > textarea {
-    display: block;
-    position: absolute;
-    top: 0;
-    right: 0;
-    bottom: 0;
-    left: 0;
-    padding: 0;
-    font-family: Menlo, monospace;
-    color: black;
-    background: transparent;
-    border: none;
-    outline: none;
-    opacity: 0;
-    resize: none;
-    -webkit-appearance: none;
-
-    --style-declaration-section-header-textarea-margin-start: var(--style-declaration-section-header-padding-start);
-    --style-declaration-section-header-textarea-margin-end: var(--style-declaration-section-header-padding-end);
-}
-
-.style-declaration-section > .header > textarea {
-    margin: 4px var(--style-declaration-section-header-textarea-margin-end) 3px var(--style-declaration-section-header-textarea-margin-start);
-}
-
-.style-declaration-section > .header > textarea:focus {
-    opacity: 1;
-}
-
-.style-declaration-section > .header > textarea:focus + .selector {
-    opacity: 0;
-}
-
-.style-declaration-section > .header > .selector {
-    font-family: Menlo, monospace;
-    color: hsl(0, 0%, 50%);
-    word-wrap: break-word;
-}
-
-.style-declaration-section:matches(.locked, .selector-locked) > .header > .selector {
-    -webkit-user-select: text;
-}
-
-.style-declaration-section > .header > .selector > .matched {
-    color: black;
-}
-
-.style-declaration-section > .header > .origin {
-    position: relative;
-    z-index: 1;
-
-    line-height: 10px;
-
-    color: hsl(0, 0%, 50%);
-
-    word-wrap: break-word;
-    white-space: nowrap;
-}
-
-.style-declaration-section > .header > .origin a {
-    white-space: normal;
-}
-
-.style-declaration-section > .header > .origin > .go-to-link {
-    color: inherit !important;
-}
-
-.style-declaration-section.invalid-selector > .header > .icon {
-    top: 4px;
-    left: 6px;
-    width: 12px;
-    height: 12px;
-    content: url(../Images/Error.svg);
-}
-
-.style-declaration-section.invalid-selector > .header > .selector,
-.style-declaration-section.invalid-selector > .header > .selector > * {
-    color: red;
-}
-
-@media (-webkit-min-device-pixel-ratio: 2) {
-    .style-declaration-section,
-    .sidebar > .panel.details.css-style > .content > .pseudo-classes {
-        border-width: 0.5px !important;
-    }
-}
diff --git a/Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationSection.js b/Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationSection.js
deleted file mode 100644 (file)
index da3fc97..0000000
+++ /dev/null
@@ -1,762 +0,0 @@
-/*
- * Copyright (C) 2013, 2015 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-WI.CSSStyleDeclarationSection = class CSSStyleDeclarationSection extends WI.Object
-{
-    constructor(delegate, style)
-    {
-        console.assert(style instanceof WI.CSSStyleDeclaration, style);
-
-        super();
-
-        this._delegate = delegate || null;
-
-        this._style = style || null;
-        this._selectorElements = [];
-        this._ruleDisabled = false;
-        this._hasInvalidSelector = false;
-
-        this._element = document.createElement("div");
-        this._element.classList.add("style-declaration-section");
-
-        new WI.KeyboardShortcut(WI.KeyboardShortcut.Modifier.CommandOrControl, "S", this._save.bind(this), this._element);
-        new WI.KeyboardShortcut(WI.KeyboardShortcut.Modifier.CommandOrControl | WI.KeyboardShortcut.Modifier.Shift, "S", this._save.bind(this), this._element);
-
-        this._headerElement = document.createElement("div");
-        this._headerElement.classList.add("header");
-
-        if (!style.editable) {
-            let lockedIconElement = this._headerElement.createChild("img", "locked-icon");
-
-            let styleLabel;
-            if (style.ownerRule && style.ownerRule.type === WI.CSSStyleSheet.Type.UserAgent)
-                styleLabel = WI.UIString("User Agent Stylesheet");
-            else
-                styleLabel = WI.UIString("Style rule");
-
-            lockedIconElement.title = WI.UIString("%s cannot be modified").format(styleLabel);
-        }
-
-        this._iconElement = this._headerElement.createChild("img", "icon");
-
-        if (this.selectorEditable) {
-            this._selectorInput = this._headerElement.createChild("textarea");
-            this._selectorInput.spellcheck = false;
-            this._selectorInput.dir = "ltr";
-            this._selectorInput.tabIndex = -1;
-            this._selectorInput.addEventListener("mouseover", this._handleMouseOver.bind(this));
-            this._selectorInput.addEventListener("mousemove", this._handleMouseMove.bind(this));
-            this._selectorInput.addEventListener("mouseout", this._handleMouseOut.bind(this));
-            this._selectorInput.addEventListener("keydown", this._handleKeyDown.bind(this));
-            this._selectorInput.addEventListener("keypress", this._handleKeyPress.bind(this));
-            this._selectorInput.addEventListener("input", this._handleInput.bind(this));
-            this._selectorInput.addEventListener("paste", this._handleSelectorPaste.bind(this));
-            this._selectorInput.addEventListener("blur", this._handleBlur.bind(this));
-        }
-
-        this._selectorElement = this._headerElement.createChild("span", "selector");
-        if (!this.selectorEditable) {
-            this._selectorElement.addEventListener("mouseover", this._handleMouseOver.bind(this));
-            this._selectorElement.addEventListener("mouseout", this._handleMouseOut.bind(this));
-        }
-
-        this._originElement = this._headerElement.createChild("span", "origin");
-
-        this._propertiesElement = document.createElement("div");
-        this._propertiesElement.classList.add("properties");
-
-        this._editorActive = false;
-        this._propertiesTextEditor = new WI.CSSStyleDeclarationTextEditor(this, style);
-        this._propertiesTextEditor.addEventListener(WI.CSSStyleDeclarationTextEditor.Event.ContentChanged, this._editorContentChanged.bind(this));
-        this._propertiesTextEditor.addEventListener(WI.CSSStyleDeclarationTextEditor.Event.Blurred, this._editorBlurred.bind(this));
-        this._propertiesElement.appendChild(this._propertiesTextEditor.element);
-
-        this._element.appendChild(this._headerElement);
-        this._element.appendChild(this._propertiesElement);
-
-        let iconClassName = null;
-        switch (style.type) {
-        case WI.CSSStyleDeclaration.Type.Rule:
-            console.assert(style.ownerRule);
-
-            if (style.inherited)
-                iconClassName = WI.CSSStyleDeclarationSection.InheritedStyleRuleIconStyleClassName;
-            else if (style.ownerRule.type === WI.CSSStyleSheet.Type.Author)
-                iconClassName = WI.CSSStyleDeclarationSection.AuthorStyleRuleIconStyleClassName;
-            else if (style.ownerRule.type === WI.CSSStyleSheet.Type.User)
-                iconClassName = WI.CSSStyleDeclarationSection.UserStyleRuleIconStyleClassName;
-            else if (style.ownerRule.type === WI.CSSStyleSheet.Type.UserAgent)
-                iconClassName = WI.CSSStyleDeclarationSection.UserAgentStyleRuleIconStyleClassName;
-            else if (style.ownerRule.type === WI.CSSStyleSheet.Type.Inspector)
-                iconClassName = WI.CSSStyleDeclarationSection.InspectorStyleRuleIconStyleClassName;
-            break;
-
-        case WI.CSSStyleDeclaration.Type.Inline:
-        case WI.CSSStyleDeclaration.Type.Attribute:
-            if (style.inherited)
-                iconClassName = WI.CSSStyleDeclarationSection.InheritedElementStyleRuleIconStyleClassName;
-            else
-                iconClassName = WI.DOMTreeElementPathComponent.DOMElementIconStyleClassName;
-            break;
-        }
-
-        if (style.editable) {
-            this._iconElement.classList.add("toggle-able");
-            this._iconElement.title = WI.UIString("Comment All Properties");
-            this._iconElement.addEventListener("click", this._handleIconElementClicked.bind(this));
-        }
-
-        console.assert(iconClassName);
-        this._element.classList.add(iconClassName);
-
-        if (!style.editable)
-            this._element.classList.add(WI.CSSStyleDeclarationSection.LockedStyleClassName);
-        else if (style.ownerRule)
-            this._style.ownerRule.addEventListener(WI.CSSRule.Event.SelectorChanged, this._updateSelectorIcon.bind(this));
-        else
-            this._element.classList.add(WI.CSSStyleDeclarationSection.SelectorLockedStyleClassName);
-
-        this.refresh();
-
-        this._headerElement.addEventListener("contextmenu", this._handleContextMenuEvent.bind(this));
-    }
-
-    // Public
-
-    get element()
-    {
-        return this._element;
-    }
-
-    get style()
-    {
-        return this._style;
-    }
-
-    get lastInGroup()
-    {
-        return this._element.classList.contains(WI.CSSStyleDeclarationSection.LastInGroupStyleClassName);
-    }
-
-    set lastInGroup(last)
-    {
-        if (last)
-            this._element.classList.add(WI.CSSStyleDeclarationSection.LastInGroupStyleClassName);
-        else
-            this._element.classList.remove(WI.CSSStyleDeclarationSection.LastInGroupStyleClassName);
-    }
-
-    get focused()
-    {
-        return this._propertiesTextEditor.focused;
-    }
-
-    focus()
-    {
-        this._propertiesTextEditor.focus();
-    }
-
-    refresh()
-    {
-        this._selectorElement.removeChildren();
-        this._originElement.removeChildren();
-        this._selectorElements = [];
-
-        this._originElement.append(` ${emDash} `);
-
-        function appendSelector(selector, matched)
-        {
-            console.assert(selector instanceof WI.CSSSelector);
-
-            let selectorElement = document.createElement("span");
-            selectorElement.textContent = selector.text;
-
-            if (matched)
-                selectorElement.classList.add(WI.CSSStyleDeclarationSection.MatchedSelectorElementStyleClassName);
-
-            let specificity = selector.specificity;
-            if (specificity) {
-                let tooltip = WI.UIString("Specificity: (%d, %d, %d)").format(specificity[0], specificity[1], specificity[2]);
-                if (selector.dynamic) {
-                    tooltip += "\n";
-                    if (this._style.inherited)
-                        tooltip += WI.UIString("Dynamically calculated for the parent element");
-                    else
-                        tooltip += WI.UIString("Dynamically calculated for the selected element");
-                }
-                selectorElement.title = tooltip;
-            } else if (selector.dynamic) {
-                let tooltip = WI.UIString("Specificity: No value for selected element");
-                tooltip += "\n";
-                tooltip += WI.UIString("Dynamically calculated for the selected element and did not match");
-                selectorElement.title = tooltip;
-            }
-
-            this._selectorElement.appendChild(selectorElement);
-            this._selectorElements.push(selectorElement);
-        }
-
-        function appendSelectorTextKnownToMatch(selectorText)
-        {
-            let selectorElement = document.createElement("span");
-            selectorElement.textContent = selectorText;
-            selectorElement.classList.add(WI.CSSStyleDeclarationSection.MatchedSelectorElementStyleClassName);
-            this._selectorElement.appendChild(selectorElement);
-        }
-
-        switch (this._style.type) {
-        case WI.CSSStyleDeclaration.Type.Rule:
-            console.assert(this._style.ownerRule);
-
-            var selectors = this._style.ownerRule.selectors;
-            var matchedSelectorIndices = this._style.ownerRule.matchedSelectorIndices;
-            var alwaysMatch = !matchedSelectorIndices.length;
-            if (selectors.length) {
-                let hasMatchingPseudoElementSelector = false;
-                for (let i = 0; i < selectors.length; ++i) {
-                    appendSelector.call(this, selectors[i], alwaysMatch || matchedSelectorIndices.includes(i));
-                    if (i < selectors.length - 1)
-                        this._selectorElement.append(", ");
-
-                    if (matchedSelectorIndices.includes(i) && selectors[i].isPseudoElementSelector())
-                        hasMatchingPseudoElementSelector = true;
-                }
-                this._element.classList.toggle(WI.CSSStyleDeclarationSection.PseudoElementSelectorStyleClassName, hasMatchingPseudoElementSelector);
-            } else
-                appendSelectorTextKnownToMatch.call(this, this._style.ownerRule.selectorText);
-
-            if (this._style.ownerRule.sourceCodeLocation) {
-                let options = {
-                    dontFloat: true,
-                    ignoreNetworkTab: true,
-                    ignoreSearchTab: true,
-                };
-                if (this._style.ownerStyleSheet.isInspectorStyleSheet()) {
-                    options.nameStyle = WI.SourceCodeLocation.NameStyle.None;
-                    options.prefix = WI.UIString("Inspector Style Sheet") + ":";
-                }
-
-                let sourceCodeLink = WI.createSourceCodeLocationLink(this._style.ownerRule.sourceCodeLocation, options);
-                this._originElement.appendChild(sourceCodeLink);
-            } else {
-                let originString;
-                switch (this._style.ownerRule.type) {
-                case WI.CSSStyleSheet.Type.Author:
-                    originString = WI.UIString("Author Stylesheet");
-                    break;
-
-                case WI.CSSStyleSheet.Type.User:
-                    originString = WI.UIString("User Stylesheet");
-                    break;
-
-                case WI.CSSStyleSheet.Type.UserAgent:
-                    originString = WI.UIString("User Agent Stylesheet");
-                    break;
-
-                case WI.CSSStyleSheet.Type.Inspector:
-                    originString = WI.UIString("Web Inspector");
-                    break;
-                }
-
-                console.assert(originString);
-                if (originString)
-                    this._originElement.append(originString);
-            }
-
-            break;
-
-        case WI.CSSStyleDeclaration.Type.Inline:
-            appendSelectorTextKnownToMatch.call(this, this._style.node.displayName);
-            this._originElement.append(WI.UIString("Style Attribute"));
-            break;
-
-        case WI.CSSStyleDeclaration.Type.Attribute:
-            appendSelectorTextKnownToMatch.call(this, this._style.node.displayName);
-            this._originElement.append(WI.UIString("HTML Attributes"));
-            break;
-        }
-
-        this._updateSelectorIcon();
-        if (this._selectorInput)
-            this._selectorInput.value = this._selectorElement.textContent;
-    }
-
-    refreshEditor()
-    {
-        this._propertiesTextEditor.refresh();
-    }
-
-    highlightProperty(property)
-    {
-        if (this._propertiesTextEditor.highlightProperty(property)) {
-            this._element.scrollIntoView();
-            return true;
-        }
-
-        return false;
-    }
-
-    findMatchingPropertiesAndSelectors(needle)
-    {
-        this._element.classList.remove(WI.GeneralStyleDetailsSidebarPanel.NoFilterMatchInSectionClassName, WI.GeneralStyleDetailsSidebarPanel.FilterMatchingSectionHasLabelClassName);
-
-        var hasMatchingSelector = false;
-
-        for (var selectorElement of this._selectorElements) {
-            selectorElement.classList.remove(WI.GeneralStyleDetailsSidebarPanel.FilterMatchSectionClassName);
-
-            if (needle && selectorElement.textContent.includes(needle)) {
-                selectorElement.classList.add(WI.GeneralStyleDetailsSidebarPanel.FilterMatchSectionClassName);
-                hasMatchingSelector = true;
-            }
-        }
-
-        if (!needle) {
-            this._propertiesTextEditor.resetFilteredProperties();
-            return false;
-        }
-
-        var hasMatchingProperty = this._propertiesTextEditor.findMatchingProperties(needle);
-
-        if (!hasMatchingProperty && !hasMatchingSelector) {
-            this._element.classList.add(WI.GeneralStyleDetailsSidebarPanel.NoFilterMatchInSectionClassName);
-            return false;
-        }
-
-        return true;
-    }
-
-    updateLayout()
-    {
-        this._propertiesTextEditor.updateLayout();
-    }
-
-    clearSelection()
-    {
-        this._propertiesTextEditor.clearSelection();
-    }
-
-    cssStyleDeclarationTextEditorFocused()
-    {
-        if (typeof this._delegate.cssStyleDeclarationSectionEditorFocused === "function")
-            this._delegate.cssStyleDeclarationSectionEditorFocused(this);
-    }
-
-    cssStyleDeclarationTextEditorSwitchRule(reverse)
-    {
-        if (!this._delegate)
-            return;
-
-        if (reverse && typeof this._delegate.cssStyleDeclarationSectionEditorPreviousRule === "function")
-            this._delegate.cssStyleDeclarationSectionEditorPreviousRule(this);
-        else if (!reverse && typeof this._delegate.cssStyleDeclarationSectionEditorNextRule === "function")
-            this._delegate.cssStyleDeclarationSectionEditorNextRule(this);
-    }
-
-    focusRuleSelector(reverse)
-    {
-        if (!this.selectorEditable && !this.locked) {
-            this.focus();
-            return;
-        }
-
-        if (this.locked) {
-            this.cssStyleDeclarationTextEditorSwitchRule(reverse);
-            return;
-        }
-
-        let selection = window.getSelection();
-        selection.removeAllRanges();
-
-        this._element.scrollIntoViewIfNeeded();
-
-        if (this._selectorInput) {
-            this._selectorInput.focus();
-            this._selectorInput.selectionStart = 0;
-            this._selectorInput.selectionEnd = this._selectorInput.value.length;
-        } else {
-            let range = document.createRange();
-            range.selectNodeContents(this._selectorElement);
-            selection.addRange(range);
-        }
-    }
-
-    selectLastProperty()
-    {
-        this._propertiesTextEditor.selectLastProperty();
-    }
-
-    get selectorEditable()
-    {
-        return !this.locked && this._style.ownerRule;
-    }
-
-    get locked()
-    {
-        return !this._style.editable;
-    }
-
-    get editorActive()
-    {
-        return this._editorActive;
-    }
-
-    // Private
-
-    get _currentSelectorText()
-    {
-        let selectorText = this.selectorEditable ? this._selectorInput.value : this._selectorElement.textContent;
-        if (!selectorText || !selectorText.length) {
-            if (!this._style.ownerRule)
-                return "";
-
-            selectorText = this._style.ownerRule.selectorText;
-        }
-
-        return selectorText.trim();
-    }
-
-    _handleSelectorPaste(event)
-    {
-        if (this._style.type === WI.CSSStyleDeclaration.Type.Inline || !this._style.ownerRule)
-            return;
-
-        if (!event || !event.clipboardData)
-            return;
-
-        let data = event.clipboardData.getData("text/plain");
-        if (!data)
-            return;
-
-        function parseTextForRule(text)
-        {
-            let containsBraces = /[{}]/;
-            if (!containsBraces.test(text))
-                return [];
-
-            let match = text.match(/([^{]+){([\s\S]*)}/);
-            if (!match)
-                return [];
-
-            // If the match "body" contains braces, parse that body as if it were a rule.
-            // This will usually happen if the user includes a media query in the copied text.
-            return containsBraces.test(match[2]) ? parseTextForRule(match[2]) : match;
-        }
-
-        let [selector, value] = parseTextForRule(data);
-        if (!selector || !value)
-            return;
-
-        this._style.nodeStyles.changeRule(this._style.ownerRule, selector.trim(), value);
-        event.preventDefault();
-    }
-
-    _handleContextMenuEvent(event)
-    {
-        if (window.getSelection().toString().length)
-            return;
-
-        let contextMenu = WI.ContextMenu.createFromEvent(event);
-
-        contextMenu.appendItem(WI.UIString("Copy Rule"), () => {
-            InspectorFrontendHost.copyText(this._style.generateCSSRuleString());
-        });
-
-        if (this._style.inherited)
-            return;
-
-        contextMenu.appendItem(WI.UIString("Duplicate Selector"), () => {
-            if (this._delegate && typeof this._delegate.focusEmptySectionWithStyle === "function") {
-                let existingRules = this._style.nodeStyles.rulesForSelector(this._currentSelectorText);
-                for (let rule of existingRules) {
-                    if (this._delegate.focusEmptySectionWithStyle(rule.style))
-                        return;
-                }
-            }
-
-            this._style.nodeStyles.addRule(this._currentSelectorText);
-        });
-
-        // Only used one colon temporarily since single-colon pseudo elements are valid CSS.
-        if (WI.CSSStyleManager.PseudoElementNames.some((className) => this._style.selectorText.includes(":" + className)))
-            return;
-
-        if (WI.CSSStyleManager.ForceablePseudoClasses.every((className) => !this._style.selectorText.includes(":" + className))) {
-            contextMenu.appendSeparator();
-
-            for (let pseudoClass of WI.CSSStyleManager.ForceablePseudoClasses) {
-                if (pseudoClass === "visited" && this._style.node.nodeName() !== "A")
-                    continue;
-
-                let pseudoClassSelector = ":" + pseudoClass;
-
-                contextMenu.appendItem(WI.UIString("Add %s Rule").format(pseudoClassSelector), () => {
-                    this._style.node.setPseudoClassEnabled(pseudoClass, true);
-
-                    let selector;
-                    if (this._style.ownerRule)
-                        selector = this._style.ownerRule.selectors.map((selector) => selector.text + pseudoClassSelector).join(", ");
-                    else
-                        selector = this._currentSelectorText + pseudoClassSelector;
-
-                    this._style.nodeStyles.addRule(selector);
-                });
-            }
-        }
-
-        contextMenu.appendSeparator();
-
-        for (let pseudoElement of WI.CSSStyleManager.PseudoElementNames) {
-            let pseudoElementSelector = "::" + pseudoElement;
-            const styleText = "content: \"\";";
-
-            let existingSection = null;
-            if (this._delegate && typeof this._delegate.sectionForStyle === "function") {
-                let existingRules = this._style.nodeStyles.rulesForSelector(this._currentSelectorText + pseudoElementSelector);
-                if (existingRules.length) {
-                    // There shouldn't really ever be more than one pseudo-element rule
-                    // that is not in a media query. As such, just focus the first rule
-                    // on the assumption that it is the only one necessary.
-                    existingSection = this._delegate.sectionForStyle(existingRules[0].style);
-                }
-            }
-
-            let title = existingSection ? WI.UIString("Focus %s Rule") : WI.UIString("Create %s Rule");
-            contextMenu.appendItem(title.format(pseudoElementSelector), () => {
-                if (existingSection) {
-                    existingSection.focus();
-                    return;
-                }
-
-                let selector;
-                if (this._style.ownerRule)
-                    selector = this._style.ownerRule.selectors.map((selector) => selector.text + pseudoElementSelector).join(", ");
-                else
-                    selector = this._currentSelectorText + pseudoElementSelector;
-
-                this._style.nodeStyles.addRule(selector, styleText);
-            });
-        }
-    }
-
-    _handleIconElementClicked()
-    {
-        if (this._hasInvalidSelector) {
-            // This will revert the selector text to the original valid value.
-            this.refresh();
-            return;
-        }
-
-        this._ruleDisabled = this._ruleDisabled ? !this._propertiesTextEditor.uncommentAllProperties() : this._propertiesTextEditor.commentAllProperties();
-        this._iconElement.title = this._ruleDisabled ? WI.UIString("Uncomment All Properties") : WI.UIString("Comment All Properties");
-        this._element.classList.toggle("rule-disabled", this._ruleDisabled);
-    }
-
-    _highlightNodesWithSelector()
-    {
-        if (!this._style.ownerRule) {
-            WI.domTreeManager.highlightDOMNode(this._style.node.id);
-            return;
-        }
-
-        WI.domTreeManager.highlightSelector(this._currentSelectorText, this._style.node.ownerDocument.frameIdentifier);
-    }
-
-    _hideDOMNodeHighlight()
-    {
-        WI.domTreeManager.hideDOMNodeHighlight();
-    }
-
-    _handleMouseOver(event)
-    {
-        this._highlightNodesWithSelector();
-    }
-
-    _handleMouseMove(event)
-    {
-        if (this._hasInvalidSelector)
-            return;
-
-        // Attempts to find a selector element under the mouse so that the title (which contains the
-        // specificity information) can be applied to _selectorInput, which will then display the
-        // title if the user hovers long enough.
-        for (let element of this._selectorElements) {
-            let {top, right, bottom, left} = element.getBoundingClientRect();
-            if (event.clientX >= left && event.clientX <= right && event.clientY >= top && event.clientY <= bottom) {
-                this._selectorInput.title = element.title;
-                return;
-            }
-        }
-
-        this._selectorInput.title = "";
-    }
-
-    _handleMouseOut(event)
-    {
-        this._hideDOMNodeHighlight();
-    }
-
-    _save(event)
-    {
-        event.preventDefault();
-        event.stopPropagation();
-
-        if (this._style.type !== WI.CSSStyleDeclaration.Type.Rule) {
-            // FIXME: Can't save CSS inside <style></style> <https://webkit.org/b/150357>
-            InspectorFrontendHost.beep();
-            return;
-        }
-
-        console.assert(this._style.ownerRule instanceof WI.CSSRule);
-        console.assert(this._style.ownerRule.sourceCodeLocation instanceof WI.SourceCodeLocation);
-
-        let sourceCode = this._style.ownerRule.sourceCodeLocation.sourceCode;
-        if (sourceCode.type !== WI.Resource.Type.Stylesheet) {
-            // FIXME: Can't save CSS inside style="" <https://webkit.org/b/150357>
-            InspectorFrontendHost.beep();
-            return;
-        }
-
-        var url;
-        if (sourceCode.urlComponents.scheme === "data") {
-            let mainResource = WI.frameResourceManager.mainFrame.mainResource;
-            let pathDirectory = mainResource.url.slice(0, -mainResource.urlComponents.lastPathComponent.length);
-            url = pathDirectory + "base64.css";
-        } else
-            url = sourceCode.url;
-
-        const saveAs = event.shiftKey;
-        WI.saveDataToFile({url: url, content: sourceCode.content}, saveAs);
-    }
-
-    _handleKeyDown(event)
-    {
-        if (event.keyCode === WI.KeyboardShortcut.Key.Enter.keyCode) {
-            event.preventDefault();
-            this.focus();
-            return;
-        }
-
-        if (event.keyCode !== WI.KeyboardShortcut.Key.Tab.keyCode) {
-            this._highlightNodesWithSelector();
-            return;
-        }
-
-        if (event.shiftKey && this._delegate && typeof this._delegate.cssStyleDeclarationSectionEditorPreviousRule === "function") {
-            event.preventDefault();
-            this._delegate.cssStyleDeclarationSectionEditorPreviousRule(this, true);
-            return;
-        }
-
-        if (!event.metaKey) {
-            event.preventDefault();
-            this.focus();
-            this._propertiesTextEditor.selectFirstProperty();
-            return;
-        }
-    }
-
-    _handleKeyPress(event)
-    {
-        if (!event.altGraphKey && !event.altKey && !event.ctrlKey && !event.metaKey) {
-            // Ensures that <textarea> does not scroll with added characters.  Since a
-            // <textarea> does not expand to fit its content, appending the pressed character to the
-            // end of the original (non-editable) selector element will ensure that the <textarea>
-            // will be large enough to fit the selector without scrolling.
-            this._selectorElement.append(String.fromCharCode(event.keyCode));
-        }
-    }
-
-    _handleInput(event)
-    {
-        this._selectorElement.textContent = this._selectorInput.value;
-
-        this._highlightNodesWithSelector();
-    }
-
-    _handleBlur(event)
-    {
-        this._hideDOMNodeHighlight();
-
-        let newSelectorText = this._currentSelectorText.trim();
-        if (!newSelectorText) {
-            // Revert to the current selector (by doing a refresh) since the new selector is empty.
-            this.refresh();
-            return;
-        }
-
-        if (event.relatedTarget && this.element.contains(event.relatedTarget)) {
-            this._editorActive = true;
-            this.focus();
-        }
-
-        this._style.ownerRule.selectorText = newSelectorText;
-    }
-
-    _updateSelectorIcon(event)
-    {
-        if (!this._style.ownerRule || !this._style.editable)
-            return;
-
-        this._hasInvalidSelector = event && event.data && !event.data.valid;
-        this._element.classList.toggle("invalid-selector", !!this._hasInvalidSelector);
-        if (this._hasInvalidSelector) {
-            this._iconElement.title = WI.UIString("The selector “%s” is invalid.\nClick to revert to the previous selector.").format(this._selectorElement.textContent.trim());
-            this._selectorInput.title = WI.UIString("Using previous selector “%s”").format(this._style.ownerRule.selectorText);
-            return;
-        }
-
-        this._iconElement.title = this._ruleDisabled ? WI.UIString("Uncomment All Properties") : WI.UIString("Comment All Properties");
-        this._selectorInput.title = "";
-    }
-
-    _editorContentChanged(event)
-    {
-        this._editorActive = true;
-    }
-
-    _editorBlurred(event)
-    {
-        this._editorActive = false;
-        this.dispatchEventToListeners(WI.CSSStyleDeclarationSection.Event.Blurred);
-    }
-};
-
-WI.CSSStyleDeclarationSection.Event = {
-    Blurred: "css-style-declaration-sections-blurred"
-};
-
-WI.CSSStyleDeclarationSection.LockedStyleClassName = "locked";
-WI.CSSStyleDeclarationSection.SelectorLockedStyleClassName = "selector-locked";
-WI.CSSStyleDeclarationSection.LastInGroupStyleClassName = "last-in-group";
-WI.CSSStyleDeclarationSection.MatchedSelectorElementStyleClassName = "matched";
-WI.CSSStyleDeclarationSection.PseudoElementSelectorStyleClassName = "pseudo-element-selector";
-
-WI.CSSStyleDeclarationSection.AuthorStyleRuleIconStyleClassName = "author-style-rule-icon";
-WI.CSSStyleDeclarationSection.UserStyleRuleIconStyleClassName = "user-style-rule-icon";
-WI.CSSStyleDeclarationSection.UserAgentStyleRuleIconStyleClassName = "user-agent-style-rule-icon";
-WI.CSSStyleDeclarationSection.InspectorStyleRuleIconStyleClassName = "inspector-style-rule-icon";
-WI.CSSStyleDeclarationSection.InheritedStyleRuleIconStyleClassName = "inherited-style-rule-icon";
-WI.CSSStyleDeclarationSection.InheritedElementStyleRuleIconStyleClassName = "inherited-element-style-rule-icon";
diff --git a/Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationTextEditor.css b/Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationTextEditor.css
deleted file mode 100644 (file)
index a38bb80..0000000
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-.css-style-text-editor {
-    background-color: white;
-    padding: 2px 0 1px;
-}
-
-.css-style-text-editor > .CodeMirror {
-    height: auto;
-}
-
-.css-style-text-editor > .CodeMirror-scroll {
-    overflow: hidden;
-}
-
-.css-style-text-editor > .CodeMirror .CodeMirror-placeholder {
-    text-indent: 0;
-}
-
-.css-style-text-editor > .CodeMirror pre {
-    /* Compensate for the checkboxes so properties line up with readonly styles that do not have checkboxes. */
-    padding: 0 5px 0 25px;
-    text-indent: -21px;
-}
-
-.css-style-text-editor > .CodeMirror pre * {
-    text-indent: 0;
-}
-
-.css-style-text-editor.read-only,
-.css-style-text-editor.read-only > .CodeMirror {
-    background-color: transparent;
-}
-
-.css-style-text-editor.read-only > .CodeMirror pre {
-    text-indent: 0;
-}
-
-.css-style-text-editor.read-only > .CodeMirror .CodeMirror-cursor {
-    display: none;
-}
-
-.css-style-text-editor > .CodeMirror .CodeMirror-lines pre > span span:not(.css-style-declaration-property, .CodeMirror-widget, .cm-comment, .cm-tab),
-.css-style-text-editor > .CodeMirror .CodeMirror-lines .css-style-declaration-property:matches(.disabled, .invalid, .other-vendor, .not-inherited, .overridden) {
-    text-decoration: line-through;
-    -webkit-text-stroke-width: 0.000000000000001px; /* A hack to get a different line-through color. */
-    -webkit-text-stroke-color: hsla(0, 0%, 0%, 0.6);
-}
-
-.css-style-text-editor > .CodeMirror .CodeMirror-lines pre > span span:not(.css-style-declaration-property, .CodeMirror-widget, .cm-comment, .cm-tab),
-.css-style-text-editor > .CodeMirror .CodeMirror-lines .css-style-declaration-property.invalid {
-    -webkit-text-stroke-color: hsla(0, 100%, 50%, 0.6);
-}
-
-.css-style-text-editor > .CodeMirror .CodeMirror-lines .invalid-warning-marker {
-    position: relative;
-    top: 1px; 
-    width: 9px;
-    height: 9px;
-    margin: 0 2px 0 0;
-    padding: 0;
-    border: none;
-    background-color: transparent;
-    background-image: url(../Images/Warning.svg);
-}
-
-.css-style-text-editor > .CodeMirror .CodeMirror-lines .invalid-warning-marker.clickable:hover {
-    filter: brightness(0.9);
-}
-
-.computed .css-style-text-editor > .CodeMirror .CodeMirror-lines .css-style-declaration-property.implicit,
-.css-style-text-editor > .CodeMirror .CodeMirror-lines .css-style-declaration-property.not-inherited {
-    opacity: 0.5;
-}
-
-.css-style-text-editor > .CodeMirror .CodeMirror-lines .editing-line .css-style-declaration-property:matches(.disabled, .other-vendor, .not-inherited, .overridden) {
-    -webkit-text-stroke-color: hsla(0, 0%, 0%, 0.3);
-}
-
-.css-style-text-editor > .CodeMirror .CodeMirror-lines .editing-line span:not(.css-style-declaration-property, .CodeMirror-widget, .cm-comment, .cm-tab),
-.css-style-text-editor > .CodeMirror .CodeMirror-lines .editing-line .css-style-declaration-property.invalid {
-    text-decoration: none;
-}
-
-.css-style-text-editor > .CodeMirror .CodeMirror-lines input[type=checkbox] {
-    width: 10px;
-    height: 10px;
-    vertical-align: top;
-    margin: 0 8px 0 3px;
-    visibility: hidden;
-}
-
-.css-style-text-editor > .CodeMirror .CodeMirror-lines .checkbox-placeholder {
-    display: inline-block;
-    width: 21px;
-}
-
-.css-style-text-editor > .CodeMirror .CodeMirror-lines input[type=checkbox]:not(:checked),
-.css-style-text-editor > .CodeMirror.CodeMirror-focused .CodeMirror-lines input[type=checkbox],
-.css-style-text-editor:hover > .CodeMirror .CodeMirror-lines input[type=checkbox] {
-    visibility: visible;
-}
-
-.css-style-text-editor > .CodeMirror .cm-link {
-    /* Style url(...) links as if they are strings. */
-    color: var(--syntax-highlight-string-color);
-    text-decoration: inherit;
-    cursor: inherit;
-}
diff --git a/Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationTextEditor.js b/Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationTextEditor.js
deleted file mode 100644 (file)
index 75b4dd9..0000000
+++ /dev/null
@@ -1,1807 +0,0 @@
-/*
- * Copyright (C) 2013, 2015 Apple Inc. All rights reserved.
- * Copyright (C) 2015 Tobias Reiss <tobi+webkit@basecode.de>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-WI.CSSStyleDeclarationTextEditor = class CSSStyleDeclarationTextEditor extends WI.View
-{
-    constructor(delegate, style)
-    {
-        super();
-
-        this.element.classList.add(WI.CSSStyleDeclarationTextEditor.StyleClassName);
-        this.element.classList.add(WI.SyntaxHighlightedStyleClassName);
-        this.element.addEventListener("mousedown", this._handleMouseDown.bind(this), true);
-        this.element.addEventListener("mouseup", this._handleMouseUp.bind(this));
-
-        this._mouseDownCursorPosition = null;
-
-        this._propertyVisibilityMode = WI.CSSStyleDeclarationTextEditor.PropertyVisibilityMode.ShowAll;
-        this._showsImplicitProperties = true;
-        this._alwaysShowPropertyNames = {};
-        this._filterResultPropertyNames = null;
-        this._sortProperties = false;
-        this._hasActiveInlineSwatchEditor = false;
-
-        this._linePrefixWhitespace = "";
-
-        this._delegate = delegate || null;
-
-        this._codeMirror = WI.CodeMirrorEditor.create(this.element, {
-            readOnly: true,
-            lineWrapping: true,
-            mode: "css-rule",
-            electricChars: false,
-            indentWithTabs: false,
-            indentUnit: 4,
-            smartIndent: false,
-            matchBrackets: true,
-            autoCloseBrackets: true
-        });
-
-        this._codeMirror.addKeyMap({
-            "Enter": this._handleEnterKey.bind(this),
-            "Shift-Enter": this._insertNewlineAfterCurrentLine.bind(this),
-            "Shift-Tab": this._handleShiftTabKey.bind(this),
-            "Tab": this._handleTabKey.bind(this)
-        });
-
-        this._completionController = new WI.CodeMirrorCompletionController(this._codeMirror, this);
-        this._tokenTrackingController = new WI.CodeMirrorTokenTrackingController(this._codeMirror, this);
-
-        this._completionController.noEndingSemicolon = true;
-
-        this._jumpToSymbolTrackingModeEnabled = false;
-        this._tokenTrackingController.classNameForHighlightedRange = WI.CodeMirrorTokenTrackingController.JumpToSymbolHighlightStyleClassName;
-        this._tokenTrackingController.mouseOverDelayDuration = 0;
-        this._tokenTrackingController.mouseOutReleaseDelayDuration = 0;
-        this._tokenTrackingController.mode = WI.CodeMirrorTokenTrackingController.Mode.NonSymbolTokens;
-
-        // Make sure CompletionController adds event listeners first.
-        // Otherwise we end up in race conditions during complete or delete-complete phases.
-        this._codeMirror.on("change", this._contentChanged.bind(this));
-        this._codeMirror.on("blur", this._editorBlured.bind(this));
-        this._codeMirror.on("beforeChange", this._handleBeforeChange.bind(this));
-
-        if (typeof this._delegate.cssStyleDeclarationTextEditorFocused === "function")
-            this._codeMirror.on("focus", this._editorFocused.bind(this));
-
-        this.style = style;
-        this._shownProperties = [];
-    }
-
-    // Public
-
-    get delegate() { return this._delegate; }
-    set delegate(delegate)
-    {
-        this._delegate = delegate || null;
-    }
-
-    get style() { return this._style; }
-    set style(style)
-    {
-        if (this._style === style)
-            return;
-
-        if (this._style) {
-            this._style.removeEventListener(WI.CSSStyleDeclaration.Event.PropertiesChanged, this._propertiesChanged, this);
-            WI.notifications.removeEventListener(WI.Notification.GlobalModifierKeysDidChange, this._updateJumpToSymbolTrackingMode, this);
-        }
-
-        this._style = style || null;
-
-        if (this._style) {
-            this._style.addEventListener(WI.CSSStyleDeclaration.Event.PropertiesChanged, this._propertiesChanged, this);
-            WI.notifications.addEventListener(WI.Notification.GlobalModifierKeysDidChange, this._updateJumpToSymbolTrackingMode, this);
-        }
-
-        this._updateJumpToSymbolTrackingMode();
-
-        this._resetContent();
-    }
-
-    get shownProperties() { return this._shownProperties; }
-
-    get focused()
-    {
-        return this._codeMirror.getWrapperElement().classList.contains("CodeMirror-focused");
-    }
-
-    get alwaysShowPropertyNames() {
-        return Object.keys(this._alwaysShowPropertyNames);
-    }
-
-    set alwaysShowPropertyNames(alwaysShowPropertyNames)
-    {
-        this._alwaysShowPropertyNames = (alwaysShowPropertyNames || []).keySet();
-
-        this._resetContent();
-    }
-
-    get propertyVisibilityMode() { return this._propertyVisibilityMode; }
-    set propertyVisibilityMode(propertyVisibilityMode)
-    {
-        if (this._propertyVisibilityMode === propertyVisibilityMode)
-            return;
-
-        this._propertyVisibilityMode = propertyVisibilityMode;
-
-        this._resetContent();
-    }
-
-    get showsImplicitProperties() { return this._showsImplicitProperties; }
-    set showsImplicitProperties(showsImplicitProperties)
-    {
-        if (this._showsImplicitProperties === showsImplicitProperties)
-            return;
-
-        this._showsImplicitProperties = showsImplicitProperties;
-
-        this._resetContent();
-    }
-
-    get sortProperties() { return this._sortProperties; }
-    set sortProperties(sortProperties)
-    {
-        if (this._sortProperties === sortProperties)
-            return;
-
-        this._sortProperties = sortProperties;
-
-        this._resetContent();
-    }
-
-    focus()
-    {
-        this._codeMirror.focus();
-    }
-
-    refresh()
-    {
-        this._resetContent();
-    }
-
-    highlightProperty(property)
-    {
-        function propertiesMatch(cssProperty)
-        {
-            if (cssProperty.attached && !cssProperty.overridden) {
-                if (cssProperty.canonicalName === property.canonicalName || hasMatchingLonghandProperty(cssProperty))
-                    return true;
-            }
-
-            return false;
-        }
-
-        function hasMatchingLonghandProperty(cssProperty)
-        {
-            var cssProperties = cssProperty.relatedLonghandProperties;
-
-            if (!cssProperties.length)
-                return false;
-
-            for (var property of cssProperties) {
-                if (propertiesMatch(property))
-                    return true;
-            }
-
-            return false;
-        }
-
-        for (var cssProperty of this.style.properties) {
-            if (propertiesMatch(cssProperty)) {
-                var selection = cssProperty.__propertyTextMarker.find();
-                this._codeMirror.setSelection(selection.from, selection.to);
-                this.focus();
-
-                return true;
-            }
-        }
-
-        return false;
-    }
-
-    clearSelection()
-    {
-        this._codeMirror.setCursor({line: 0, ch: 0});
-    }
-
-    findMatchingProperties(needle)
-    {
-        if (!needle) {
-            this.resetFilteredProperties();
-            return false;
-        }
-
-        var propertiesList = this._style.visibleProperties.length ? this._style.visibleProperties : this._style.properties;
-        var matchingProperties = [];
-
-        for (var property of propertiesList)
-            matchingProperties.push(property.text.includes(needle));
-
-        if (!matchingProperties.includes(true)) {
-            this.resetFilteredProperties();
-            return false;
-        }
-
-        for (var i = 0; i < matchingProperties.length; ++i) {
-            var property = propertiesList[i];
-
-            if (matchingProperties[i])
-                property.__filterResultClassName = WI.GeneralStyleDetailsSidebarPanel.FilterMatchSectionClassName;
-            else
-                property.__filterResultClassName = WI.GeneralStyleDetailsSidebarPanel.NoFilterMatchInPropertyClassName;
-
-            this._updateTextMarkerForPropertyIfNeeded(property);
-        }
-
-        return true;
-    }
-
-    resetFilteredProperties()
-    {
-        var propertiesList = this._style.visibleProperties.length ? this._style.visibleProperties : this._style.properties;
-
-        for (var property of propertiesList) {
-            if (property.__filterResultClassName) {
-                property.__filterResultClassName = null;
-                this._updateTextMarkerForPropertyIfNeeded(property);
-            }
-        }
-    }
-
-    removeNonMatchingProperties(needle)
-    {
-        this._filterResultPropertyNames = null;
-
-        if (!needle) {
-            this._resetContent();
-            return false;
-        }
-
-        var matchingPropertyNames = [];
-
-        for (var property of this._style.properties) {
-            var indexesOfNeedle = property.text.getMatchingIndexes(needle);
-
-            if (indexesOfNeedle.length) {
-                matchingPropertyNames.push(property.name);
-                property.__filterResultClassName = WI.GeneralStyleDetailsSidebarPanel.FilterMatchSectionClassName;
-                property.__filterResultNeedlePosition = {start: indexesOfNeedle, length: needle.length};
-            }
-        }
-
-        this._filterResultPropertyNames = matchingPropertyNames.length ? matchingPropertyNames.keySet() : {};
-
-        this._resetContent();
-
-        return matchingPropertyNames.length > 0;
-    }
-
-    uncommentAllProperties()
-    {
-        function uncommentProperties(properties)
-        {
-            if (!properties.length)
-                return false;
-
-            for (var property of properties) {
-                if (property._commentRange) {
-                    this._uncommentRange(property._commentRange);
-                    property._commentRange = null;
-                }
-            }
-
-            return true;
-        }
-
-        return uncommentProperties.call(this, this._style.pendingProperties) || uncommentProperties.call(this, this._style.properties);
-    }
-
-    commentAllProperties()
-    {
-        if (!this._style.hasProperties())
-            return false;
-
-        for (var property of this._style.properties) {
-            if (property.__propertyTextMarker)
-                this._commentProperty(property);
-        }
-
-        return true;
-    }
-
-    selectFirstProperty()
-    {
-        var line = this._codeMirror.getLine(0);
-        var trimmedLine = line.trimRight();
-
-        if (!line || !trimmedLine.trimLeft().length)
-            this.clearSelection();
-
-        var index = line.indexOf(":");
-        var cursor = {line: 0, ch: 0};
-
-        this._codeMirror.setSelection(cursor, {line: 0, ch: index < 0 || this._textAtCursorIsComment(this._codeMirror, cursor) ? trimmedLine.length : index});
-    }
-
-    selectLastProperty()
-    {
-        var line = this._codeMirror.lineCount() - 1;
-        var lineText = this._codeMirror.getLine(line);
-        var trimmedLine = lineText.trimRight();
-
-        var lastAnchor;
-        var lastHead;
-
-        if (this._textAtCursorIsComment(this._codeMirror, {line, ch: line.length})) {
-            lastAnchor = 0;
-            lastHead = line.length;
-        } else {
-            var colon = /(?::\s*)/.exec(lineText);
-            lastAnchor = colon ? colon.index + colon[0].length : 0;
-            lastHead = trimmedLine.length - trimmedLine.endsWith(";");
-        }
-
-        this._codeMirror.setSelection({line, ch: lastAnchor}, {line, ch: lastHead});
-    }
-
-    // Protected
-
-    completionControllerCompletionsHidden(completionController)
-    {
-        var styleText = this._style.text;
-        var currentText = this._formattedContent();
-
-        // If the style text and the current editor text differ then we need to commit.
-        // Otherwise we can just update the properties that got skipped because a completion
-        // was pending the last time _propertiesChanged was called.
-        if (styleText !== currentText)
-            this._commitChanges();
-        else
-            this._propertiesChanged();
-    }
-
-    completionControllerCompletionsNeeded(completionController, prefix, defaultCompletions, base, suffix, forced)
-    {
-        let properties = this._style.nodeStyles.computedStyle.properties;
-        let variables = properties.filter((property) => property.variable && property.name.startsWith(prefix));
-        let variableNames = variables.map((property) => property.name);
-        completionController.updateCompletions(defaultCompletions.concat(variableNames));
-    }
-
-    completionControllerCSSFunctionValuesNeeded(completionController, functionName, defaultCompletions)
-    {
-        if (functionName === "attr") {
-            let attributes = this._style.node.attributes().map((attribute) => attribute.name);
-            return defaultCompletions.concat(attributes);
-        }
-
-        return defaultCompletions;
-    }
-
-    layout()
-    {
-        this._codeMirror.refresh();
-    }
-
-    // Private
-
-    _textAtCursorIsComment(codeMirror, cursor)
-    {
-        var token = codeMirror.getTokenTypeAt(cursor);
-        return token && token.includes("comment");
-    }
-
-    _highlightNextNameOrValue(codeMirror, cursor, text)
-    {
-        let range = this._rangeForNextNameOrValue(codeMirror, cursor, text);
-        codeMirror.setSelection(range.from, range.to);
-    }
-
-    _rangeForNextNameOrValue(codeMirror, cursor, text)
-    {
-        let nextAnchor = 0;
-        let nextHead = 0;
-
-        if (this._textAtCursorIsComment(codeMirror, cursor))
-            nextHead = text.length;
-        else {
-            let range = WI.rangeForNextCSSNameOrValue(text, cursor.ch);
-            nextAnchor = range.from;
-            nextHead = range.to;
-        }
-
-        return {
-            from: {line: cursor.line, ch: nextAnchor},
-            to: {line: cursor.line, ch: nextHead},
-        };
-    }
-
-    _handleMouseDown(event)
-    {
-        if (this._codeMirror.options.readOnly)
-            return;
-
-        let cursor = this._codeMirror.coordsChar({left: event.x, top: event.y});
-        let line = this._codeMirror.getLine(cursor.line);
-        if (!line.trim().length)
-            return;
-
-        this._mouseDownCursorPosition = cursor;
-        this._mouseDownCursorPosition.previousRange = {from: this._codeMirror.getCursor("from"), to: this._codeMirror.getCursor("to")};
-    }
-
-    _handleMouseUp(event)
-    {
-        if (this._codeMirror.options.readOnly || !this._mouseDownCursorPosition)
-            return;
-
-        let cursor = this._codeMirror.coordsChar({left: event.x, top: event.y});
-
-        let clickedBookmark = false;
-        for (let marker of this._codeMirror.findMarksAt(cursor)) {
-            if (marker.type !== "bookmark" || marker.replacedWith !== event.target)
-                continue;
-
-            let pos = marker.find();
-            if (pos.line === cursor.line && Math.abs(pos.ch - cursor.ch) <= 1) {
-                clickedBookmark = true;
-                break;
-            }
-        }
-
-        if (!clickedBookmark && this._mouseDownCursorPosition.line === cursor.line && this._mouseDownCursorPosition.ch === cursor.ch) {
-            let line = this._codeMirror.getLine(cursor.line);
-            if (cursor.ch === line.trimRight().length) {
-                let nextLine = this._codeMirror.getLine(cursor.line + 1);
-                if (cursor.line < this._codeMirror.lineCount() - 1 && (!nextLine || !nextLine.trim().length)) {
-                    this._codeMirror.setCursor({line: cursor.line + 1, ch: 0});
-                } else {
-                    let line = this._codeMirror.getLine(cursor.line);
-                    let replacement = "\n";
-                    if (!line.trimRight().endsWith(";") && !this._textAtCursorIsComment(this._codeMirror, cursor))
-                        replacement = ";" + replacement;
-
-                    this._codeMirror.replaceRange(replacement, cursor);
-                }
-            } else if (this._mouseDownCursorPosition.previousRange) {
-                let range = this._rangeForNextNameOrValue(this._codeMirror, cursor, line);
-
-                let clickedDifferentLine = this._mouseDownCursorPosition.previousRange.from.line !== cursor.line || this._mouseDownCursorPosition.previousRange.to.line !== cursor.line;
-                let cursorInPreviousRange = cursor.ch >= this._mouseDownCursorPosition.previousRange.from.ch && cursor.ch <= this._mouseDownCursorPosition.previousRange.to.ch;
-                let previousInNewRange = this._mouseDownCursorPosition.previousRange.from.ch >= range.from.ch && this._mouseDownCursorPosition.previousRange.to.ch <= range.to.ch;
-
-                // Only select the new range if the editor is not focused, a new line is being clicked,
-                // or the new cursor position is outside of the previous range and the previous range is
-                // outside of the new range (meaning you're not clicking in the same area twice).
-                if (!this._codeMirror.hasFocus() || clickedDifferentLine || (!cursorInPreviousRange && !previousInNewRange))
-                    this._codeMirror.setSelection(range.from, range.to);
-            }
-        }
-
-        this._mouseDownCursorPosition = null;
-    }
-
-    _handleBeforeChange(codeMirror, change)
-    {
-        if (change.origin !== "+delete" || this._completionController.isShowingCompletions())
-            return CodeMirror.Pass;
-
-        if (!change.to.line && !change.to.ch) {
-            if (codeMirror.lineCount() === 1)
-                return CodeMirror.Pass;
-
-            var line = codeMirror.getLine(change.to.line);
-            if (line && line.trim().length)
-                return CodeMirror.Pass;
-
-            codeMirror.execCommand("deleteLine");
-            return;
-        }
-
-        var marks = codeMirror.findMarksAt(change.to);
-        if (!marks.length)
-            return CodeMirror.Pass;
-
-        for (var mark of marks)
-            mark.clear();
-    }
-
-    _handleEnterKey(codeMirror)
-    {
-        var cursor = codeMirror.getCursor();
-        var line = codeMirror.getLine(cursor.line);
-        var trimmedLine = line.trimRight();
-        var hasEndingSemicolon = trimmedLine.endsWith(";");
-
-        if (!trimmedLine.trimLeft().length)
-            return CodeMirror.Pass;
-
-        if (hasEndingSemicolon && cursor.ch === trimmedLine.length - 1)
-            ++cursor.ch;
-
-        if (cursor.ch === trimmedLine.length) {
-            var replacement = "\n";
-
-            if (!hasEndingSemicolon && !this._textAtCursorIsComment(this._codeMirror, cursor))
-                replacement = ";" + replacement;
-
-            this._codeMirror.replaceRange(replacement, cursor);
-            return;
-        }
-
-        return CodeMirror.Pass;
-    }
-
-    _insertNewlineAfterCurrentLine(codeMirror)
-    {
-        var cursor = codeMirror.getCursor();
-        var line = codeMirror.getLine(cursor.line);
-        var trimmedLine = line.trimRight();
-
-        cursor.ch = trimmedLine.length;
-
-        if (cursor.ch) {
-            var replacement = "\n";
-
-            if (!trimmedLine.endsWith(";") && !this._textAtCursorIsComment(this._codeMirror, cursor))
-                replacement = ";" + replacement;
-
-            this._codeMirror.replaceRange(replacement, cursor);
-            return;
-        }
-
-        return CodeMirror.Pass;
-    }
-
-    _handleShiftTabKey(codeMirror)
-    {
-        function switchRule()
-        {
-            if (this._delegate && typeof this._delegate.cssStyleDeclarationTextEditorStartEditingAdjacentRule === "function") {
-                const backward = true;
-                this._delegate.cssStyleDeclarationTextEditorStartEditingAdjacentRule(this, backward);
-                return;
-            }
-
-            return CodeMirror.Pass;
-        }
-
-        let cursor = codeMirror.getCursor();
-        let line = codeMirror.getLine(cursor.line);
-        let previousLine = codeMirror.getLine(cursor.line - 1);
-
-        if (!line && !previousLine && !cursor.line)
-            return switchRule.call(this);
-
-        let trimmedPreviousLine = previousLine ? previousLine.trimRight() : "";
-        let previousAnchor = 0;
-        let previousHead = line.length;
-        let isComment = this._textAtCursorIsComment(codeMirror, cursor);
-
-        if (cursor.ch === line.indexOf(":") || line.indexOf(":") < 0 || isComment) {
-            if (previousLine) {
-                --cursor.line;
-                previousHead = trimmedPreviousLine.length;
-
-                if (!this._textAtCursorIsComment(codeMirror, cursor)) {
-                    let colon = /(?::\s*)/.exec(previousLine);
-                    previousAnchor = colon ? colon.index + colon[0].length : 0;
-                    if (trimmedPreviousLine.includes(";"))
-                        previousHead = trimmedPreviousLine.lastIndexOf(";");
-                }
-
-                codeMirror.setSelection({line: cursor.line, ch: previousAnchor}, {line: cursor.line, ch: previousHead});
-                return;
-            }
-
-            if (cursor.line) {
-                codeMirror.setCursor(cursor.line - 1, 0);
-                return;
-            }
-
-            return switchRule.call(this);
-        }
-
-        if (!isComment) {
-            let match = /(?:[^:;\s]\s*)+/.exec(line);
-            previousAnchor = match.index;
-            previousHead = previousAnchor + match[0].length;
-        }
-
-        codeMirror.setSelection({line: cursor.line, ch: previousAnchor}, {line: cursor.line, ch: previousHead});
-    }
-
-    _handleTabKey(codeMirror)
-    {
-        function switchRule() {
-            if (this._delegate && typeof this._delegate.cssStyleDeclarationTextEditorStartEditingAdjacentRule === "function") {
-                this._delegate.cssStyleDeclarationTextEditorStartEditingAdjacentRule(this);
-                return;
-            }
-
-            return CodeMirror.Pass;
-        }
-
-        let cursor = codeMirror.getCursor();
-        let line = codeMirror.getLine(cursor.line);
-        let trimmedLine = line.trimRight();
-        let lastLine = cursor.line === codeMirror.lineCount() - 1;
-        let nextLine = codeMirror.getLine(cursor.line + 1);
-        let trimmedNextLine = nextLine ? nextLine.trimRight() : "";
-
-        if (!trimmedLine.trimLeft().length) {
-            if (lastLine)
-                return switchRule.call(this);
-
-            if (!trimmedNextLine.trimLeft().length) {
-                codeMirror.setCursor(cursor.line + 1, 0);
-                return;
-            }
-
-            ++cursor.line;
-            this._highlightNextNameOrValue(codeMirror, cursor, nextLine);
-            return;
-        }
-
-        if (trimmedLine.endsWith(":")) {
-            codeMirror.setCursor(cursor.line, line.length);
-            this._completionController._completeAtCurrentPosition(true);
-            return;
-        }
-
-        let hasEndingSemicolon = trimmedLine.endsWith(";");
-        let pastLastSemicolon = line.includes(";") && cursor.ch >= line.lastIndexOf(";");
-
-        if (cursor.ch >= line.trimRight().length - hasEndingSemicolon || pastLastSemicolon) {
-            this._completionController.completeAtCurrentPositionIfNeeded().then(function(result) {
-                if (result !== WI.CodeMirrorCompletionController.UpdatePromise.NoCompletionsFound)
-                    return;
-
-                let replacement = "";
-
-                if (!hasEndingSemicolon && !pastLastSemicolon && !this._textAtCursorIsComment(codeMirror, cursor))
-                    replacement += ";";
-
-                if (lastLine)
-                    replacement += "\n";
-
-                if (replacement.length)
-                    codeMirror.replaceRange(replacement, {line: cursor.line, ch: trimmedLine.length});
-
-                if (!nextLine) {
-                    codeMirror.setCursor(cursor.line + 1, 0);
-                    return;
-                }
-
-                this._highlightNextNameOrValue(codeMirror, {line: cursor.line + 1, ch: 0}, nextLine);
-            }.bind(this));
-
-            return;
-        }
-
-        this._highlightNextNameOrValue(codeMirror, cursor, line);
-    }
-
-    _clearRemoveEditingLineClassesTimeout()
-    {
-        if (!this._removeEditingLineClassesTimeout)
-            return;
-
-        clearTimeout(this._removeEditingLineClassesTimeout);
-        delete this._removeEditingLineClassesTimeout;
-    }
-
-    _removeEditingLineClasses()
-    {
-        this._clearRemoveEditingLineClassesTimeout();
-
-        function removeEditingLineClasses()
-        {
-            var lineCount = this._codeMirror.lineCount();
-            for (var i = 0; i < lineCount; ++i)
-                this._codeMirror.removeLineClass(i, "wrap", WI.CSSStyleDeclarationTextEditor.EditingLineStyleClassName);
-        }
-
-        this._codeMirror.operation(removeEditingLineClasses.bind(this));
-    }
-
-    _removeEditingLineClassesSoon()
-    {
-        if (this._removeEditingLineClassesTimeout)
-            return;
-        this._removeEditingLineClassesTimeout = setTimeout(this._removeEditingLineClasses.bind(this), WI.CSSStyleDeclarationTextEditor.RemoveEditingLineClassesDelay);
-    }
-
-    _formattedContent()
-    {
-        // Start with the prefix whitespace we stripped.
-        var content = WI.CSSStyleDeclaration.PrefixWhitespace;
-
-        // Get each line and add the line prefix whitespace and newlines.
-        var lineCount = this._codeMirror.lineCount();
-        for (var i = 0; i < lineCount; ++i) {
-            var lineContent = this._codeMirror.getLine(i);
-            content += this._linePrefixWhitespace + lineContent;
-            if (i !== lineCount - 1)
-                content += "\n";
-        }
-
-        // Add the suffix whitespace we stripped.
-        content += WI.CSSStyleDeclarationTextEditor.SuffixWhitespace;
-
-        // This regular expression replacement removes extra newlines
-        // in between properties while preserving leading whitespace
-        return content.replace(/\s*\n\s*\n(\s*)/g, "\n$1");
-    }
-
-    _commitChanges()
-    {
-        if (this._commitChangesTimeout) {
-            clearTimeout(this._commitChangesTimeout);
-            delete this._commitChangesTimeout;
-        }
-
-        this._style.text = this._formattedContent();
-    }
-
-    _editorBlured(codeMirror)
-    {
-        // Clicking a suggestion causes the editor to blur. We don't want to reset content in this case.
-        if (this._completionController.isHandlingClickEvent())
-            return;
-
-        // Reset the content on blur since we stop accepting external changes while the the editor is focused.
-        // This causes us to pick up any change that was suppressed while the editor was focused.
-        this._resetContent();
-        this.dispatchEventToListeners(WI.CSSStyleDeclarationTextEditor.Event.Blurred);
-    }
-
-    _editorFocused(codeMirror)
-    {
-        if (typeof this._delegate.cssStyleDeclarationTextEditorFocused === "function")
-            this._delegate.cssStyleDeclarationTextEditorFocused();
-    }
-
-    _contentChanged(codeMirror, change)
-    {
-        // Return early if the style isn't editable. This still can be called when readOnly is set because
-        // clicking on a color swatch modifies the text.
-        if (!this._style || !this._style.editable || this._ignoreCodeMirrorContentDidChangeEvent)
-            return;
-
-        this._markLinesWithCheckboxPlaceholder();
-
-        this._clearRemoveEditingLineClassesTimeout();
-        this._codeMirror.addLineClass(change.from.line, "wrap", WI.CSSStyleDeclarationTextEditor.EditingLineStyleClassName);
-
-        // When the change is a completion change, create color swatches now since the changes
-        // will not go through _propertiesChanged until completionControllerCompletionsHidden happens.
-        // This way any auto completed colors get swatches right away.
-        if (this._completionController.isCompletionChange(change))
-            this._createInlineSwatches(false, change.from.line);
-
-        // Use a short delay for user input to coalesce more changes before committing. Other actions like
-        // undo, redo and paste are atomic and work better with a zero delay. CodeMirror identifies changes that
-        // get coalesced in the undo stack with a "+" prefix on the origin. Use that to set the delay for our coalescing.
-        var delay = change.origin && change.origin.charAt(0) === "+" ? WI.CSSStyleDeclarationTextEditor.CommitCoalesceDelay : 0;
-
-        // Reset the timeout so rapid changes coalesce after a short delay.
-        if (this._commitChangesTimeout)
-            clearTimeout(this._commitChangesTimeout);
-        this._commitChangesTimeout = setTimeout(this._commitChanges.bind(this), delay);
-
-        this.dispatchEventToListeners(WI.CSSStyleDeclarationTextEditor.Event.ContentChanged);
-    }
-
-    _updateTextMarkers(nonatomic)
-    {
-        console.assert(!this._hasActiveInlineSwatchEditor, "We should never be recreating markers when we an active inline swatch editor.");
-
-        function update()
-        {
-            this._clearTextMarkers(true);
-
-            this._iterateOverProperties(true, function(property) {
-                var styleTextRange = property.styleDeclarationTextRange;
-                console.assert(styleTextRange);
-                if (!styleTextRange)
-                    return;
-
-                var from = {line: styleTextRange.startLine, ch: styleTextRange.startColumn};
-                var to = {line: styleTextRange.endLine, ch: styleTextRange.endColumn};
-
-                // Adjust the line position for the missing prefix line.
-                from.line--;
-                to.line--;
-
-                // Adjust the column for the stripped line prefix whitespace.
-                from.ch -= this._linePrefixWhitespace.length;
-                to.ch -= this._linePrefixWhitespace.length;
-
-                this._createTextMarkerForPropertyIfNeeded(from, to, property);
-            });
-
-            if (!this._codeMirror.getOption("readOnly")) {
-                // Look for comments that look like properties and add checkboxes in front of them.
-                this._codeMirror.eachLine((lineHandler) => {
-                    this._createCommentedCheckboxMarker(lineHandler);
-                });
-            }
-
-            // Look for swatchable values and make inline swatches.
-            this._createInlineSwatches(true);
-
-            this._markLinesWithCheckboxPlaceholder();
-        }
-
-        if (nonatomic)
-            update.call(this);
-        else
-            this._codeMirror.operation(update.bind(this));
-    }
-
-    _createCommentedCheckboxMarker(lineHandle)
-    {
-        var lineNumber = lineHandle.lineNo();
-
-        // Since lineNumber can be 0, it is also necessary to check if it is a number before returning.
-        if (!lineNumber && isNaN(lineNumber))
-            return;
-
-        // Matches a comment like: /* -webkit-foo: bar; */
-        let commentedPropertyRegex = /\/\*\s*[-\w]+\s*\:\s*(?:(?:\".*\"|url\(.+\)|[^;])\s*)+;?\s*\*\//g;
-
-        var match = commentedPropertyRegex.exec(lineHandle.text);
-        if (!match)
-            return;
-
-        while (match) {
-            var checkboxElement = document.createElement("input");
-            checkboxElement.type = "checkbox";
-            checkboxElement.checked = false;
-            checkboxElement.addEventListener("change", this._propertyCommentCheckboxChanged.bind(this));
-
-            var from = {line: lineNumber, ch: match.index};
-            var to = {line: lineNumber, ch: match.index + match[0].length};
-
-            var checkboxMarker = this._codeMirror.setUniqueBookmark(from, checkboxElement);
-            checkboxMarker.__propertyCheckbox = true;
-
-            var commentTextMarker = this._codeMirror.markText(from, to);
-
-            checkboxElement.__commentTextMarker = commentTextMarker;
-
-            match = commentedPropertyRegex.exec(lineHandle.text);
-        }
-    }
-
-    _createInlineSwatches(nonatomic, lineNumber)
-    {
-        function createSwatch(swatch, marker, valueObject, valueString)
-        {
-            swatch.addEventListener(WI.InlineSwatch.Event.ValueChanged, this._inlineSwatchValueChanged, this);
-            swatch.addEventListener(WI.InlineSwatch.Event.Activated, this._inlineSwatchActivated, this);
-            swatch.addEventListener(WI.InlineSwatch.Event.Deactivated, this._inlineSwatchDeactivated, this);
-
-            let codeMirrorTextMarker = marker.codeMirrorTextMarker;
-            let codeMirrorTextMarkerRange = codeMirrorTextMarker.find();
-            this._codeMirror.setUniqueBookmark(codeMirrorTextMarkerRange.from, swatch.element);
-
-            swatch.__textMarker = codeMirrorTextMarker;
-            swatch.__textMarkerRange = codeMirrorTextMarkerRange;
-        }
-
-        function update()
-        {
-            let range = typeof lineNumber === "number" ? new WI.TextRange(lineNumber, 0, lineNumber + 1, 0) : null;
-
-            // Look for color strings and add swatches in front of them.
-            createCodeMirrorColorTextMarkers(this._codeMirror, range, (marker, color, colorString) => {
-                let swatch = new WI.InlineSwatch(WI.InlineSwatch.Type.Color, color, this._codeMirror.getOption("readOnly"));
-                createSwatch.call(this, swatch, marker, color, colorString);
-            });
-
-            // Look for gradient strings and add swatches in front of them.
-            createCodeMirrorGradientTextMarkers(this._codeMirror, range, (marker, gradient, gradientString) => {
-                let swatch = new WI.InlineSwatch(WI.InlineSwatch.Type.Gradient, gradient, this._codeMirror.getOption("readOnly"));
-                createSwatch.call(this, swatch, marker, gradient, gradientString);
-            });
-
-            // Look for cubic-bezier strings and add swatches in front of them.
-            createCodeMirrorCubicBezierTextMarkers(this._codeMirror, range, (marker, bezier, bezierString) => {
-                let swatch = new WI.InlineSwatch(WI.InlineSwatch.Type.Bezier, bezier, this._codeMirror.getOption("readOnly"));
-                createSwatch.call(this, swatch, marker, bezier, bezierString);
-            });
-
-            // Look for spring strings and add swatches in front of them.
-            createCodeMirrorSpringTextMarkers(this._codeMirror, range, (marker, spring, springString) => {
-                let swatch = new WI.InlineSwatch(WI.InlineSwatch.Type.Spring, spring, this._codeMirror.getOption("readOnly"));
-                createSwatch.call(this, swatch, marker, spring, springString);
-            });
-
-            // Look for CSS variables and add swatches in front of them.
-            createCodeMirrorVariableTextMarkers(this._codeMirror, range, (marker, variable, variableString) => {
-                const dontCreateIfMissing = true;
-                let variableProperty = this._style.nodeStyles.computedStyle.propertyForName(variableString, dontCreateIfMissing);
-                if (!variableProperty) {
-                    let from = {line: marker.range.startLine, ch: marker.range.startColumn};
-                    let to = {line: marker.range.endLine, ch: marker.range.endColumn};
-                    this._codeMirror.markText(from, to, {className: "invalid"});
-
-                    let invalidMarker = document.createElement("button");
-                    invalidMarker.classList.add("invalid-warning-marker", "clickable");
-                    invalidMarker.title = WI.UIString("The variable “%s” does not exist.\nClick to delete and open autocomplete.").format(variableString);
-                    invalidMarker.addEventListener("click", (event) => {
-                        this._codeMirror.replaceRange("", from, to);
-                        this._codeMirror.setCursor(from);
-                        this._completionController.completeAtCurrentPositionIfNeeded(true);
-                    });
-                    this._codeMirror.setBookmark(from, invalidMarker);
-                    return;
-                }
-
-                let trimmedValue = variableProperty.value.trim();
-                let swatch = new WI.InlineSwatch(WI.InlineSwatch.Type.Variable, trimmedValue, this._codeMirror.getOption("readOnly"));
-                createSwatch.call(this, swatch, marker, variableProperty, trimmedValue);
-            });
-        }
-
-        if (nonatomic)
-            update.call(this);
-        else
-            this._codeMirror.operation(update.bind(this));
-    }
-
-    _updateTextMarkerForPropertyIfNeeded(property)
-    {
-        var textMarker = property.__propertyTextMarker;
-        console.assert(textMarker);
-        if (!textMarker)
-            return;
-
-        var range = textMarker.find();
-        console.assert(range);
-        if (!range)
-            return;
-
-        this._createTextMarkerForPropertyIfNeeded(range.from, range.to, property);
-    }
-
-    _createTextMarkerForPropertyIfNeeded(from, to, property)
-    {
-        if (!this._codeMirror.getOption("readOnly")) {
-            // Create a new checkbox element and marker.
-
-            console.assert(property.attached);
-
-            var checkboxElement = document.createElement("input");
-            checkboxElement.type = "checkbox";
-            checkboxElement.checked = true;
-            checkboxElement.addEventListener("change", this._propertyCheckboxChanged.bind(this));
-            checkboxElement.__cssProperty = property;
-
-            var checkboxMarker = this._codeMirror.setUniqueBookmark(from, checkboxElement);
-            checkboxMarker.__propertyCheckbox = true;
-        } else if (this._delegate.cssStyleDeclarationTextEditorShouldAddPropertyGoToArrows
-                && !property.implicit && typeof this._delegate.cssStyleDeclarationTextEditorShowProperty === "function") {
-
-            let arrowElement = WI.createGoToArrowButton();
-            arrowElement.title = WI.UIString("Option-click to show source");
-
-            let delegate = this._delegate;
-            arrowElement.addEventListener("click", function(event) {
-                delegate.cssStyleDeclarationTextEditorShowProperty(property, event.altKey);
-            });
-
-            this._codeMirror.setUniqueBookmark(to, arrowElement);
-        }
-
-        function duplicatePropertyExistsBelow(cssProperty)
-        {
-            var propertyFound = false;
-
-            for (var property of this._style.properties) {
-                if (property === cssProperty)
-                    propertyFound = true;
-                else if (property.name === cssProperty.name && propertyFound)
-                    return true;
-            }
-
-            return false;
-        }
-
-        var propertyNameIsValid = false;
-        if (WI.CSSCompletions.cssNameCompletions)
-            propertyNameIsValid = WI.CSSCompletions.cssNameCompletions.isValidPropertyName(property.name);
-
-        var classNames = ["css-style-declaration-property"];
-
-        if (property.overridden)
-            classNames.push("overridden");
-
-        if (property.implicit)
-            classNames.push("implicit");
-
-        if (this._style.inherited && !property.inherited)
-            classNames.push("not-inherited");
-
-        if (!property.valid && property.hasOtherVendorNameOrKeyword())
-            classNames.push("other-vendor");
-        else if (!property.valid && (!propertyNameIsValid || duplicatePropertyExistsBelow.call(this, property)))
-            classNames.push("invalid");
-
-        if (!property.attached)
-            classNames.push("disabled");
-
-        if (property.__filterResultClassName && !property.__filterResultNeedlePosition)
-            classNames.push(property.__filterResultClassName);
-
-        var classNamesString = classNames.join(" ");
-
-        // If there is already a text marker and it's in the same document, then try to avoid recreating it.
-        // FIXME: If there are multiple CSSStyleDeclarationTextEditors for the same style then this will cause
-        // both editors to fight and always recreate their text markers. This isn't really common.
-        if (property.__propertyTextMarker && property.__propertyTextMarker.doc.cm === this._codeMirror && property.__propertyTextMarker.find()) {
-            // If the class name is the same then we don't need to make a new marker.
-            if (property.__propertyTextMarker.className === classNamesString)
-                return;
-
-            property.__propertyTextMarker.clear();
-        }
-
-        var propertyTextMarker = this._codeMirror.markText(from, to, {className: classNamesString});
-
-        propertyTextMarker.__cssProperty = property;
-        property.__propertyTextMarker = propertyTextMarker;
-
-        property.addEventListener(WI.CSSProperty.Event.OverriddenStatusChanged, this._propertyOverriddenStatusChanged, this);
-
-        this._removeCheckboxPlaceholder(from.line);
-
-        if (property.__filterResultClassName && property.__filterResultNeedlePosition) {
-            for (var needlePosition of property.__filterResultNeedlePosition.start) {
-                var start = {line: from.line, ch: needlePosition};
-                var end = {line: to.line, ch: start.ch + property.__filterResultNeedlePosition.length};
-
-                this._codeMirror.markText(start, end, {className: property.__filterResultClassName});
-            }
-        }
-
-        if (this._codeMirror.getOption("readOnly") || property.hasOtherVendorNameOrKeyword() || property.text.trim().endsWith(":"))
-            return;
-
-        var propertyHasUnnecessaryPrefix = property.name.startsWith("-webkit-") && WI.CSSCompletions.cssNameCompletions.isValidPropertyName(property.canonicalName);
-
-        function generateInvalidMarker(options)
-        {
-            var invalidMarker = document.createElement("button");
-            invalidMarker.className = "invalid-warning-marker";
-            invalidMarker.title = options.title;
-
-            if (typeof options.correction === "string") {
-                // Allow for blank strings
-                invalidMarker.classList.add("clickable");
-                invalidMarker.addEventListener("click", function() {
-                    this._codeMirror.replaceRange(options.correction, from, to);
-
-                    if (options.autocomplete) {
-                        this._codeMirror.setCursor(to);
-                        this.focus();
-                        this._completionController._completeAtCurrentPosition(true);
-                    }
-                }.bind(this));
-            }
-
-            this._codeMirror.setBookmark(options.position, invalidMarker);
-        }
-
-        function instancesOfProperty(propertyName)
-        {
-            var count = 0;
-
-            for (var property of this._style.properties) {
-                if (property.name === propertyName)
-                    ++count;
-            }
-
-            return count;
-        }
-
-        // Number of times this property name is listed in the rule.
-        var instances = instancesOfProperty.call(this, property.name);
-        var invalidMarkerInfo;
-
-        if (propertyHasUnnecessaryPrefix && !instancesOfProperty.call(this, property.canonicalName)) {
-            // This property has a prefix and is valid without the prefix and the rule containing this property does not have the unprefixed version of the property.
-            generateInvalidMarker.call(this, {
-                position: from,
-                title: WI.UIString("The “webkit” prefix is not necessary.\nClick to insert a duplicate without the prefix."),
-                correction: property.text + "\n" + property.text.replace("-webkit-", ""),
-                autocomplete: false
-            });
-        } else if (instances > 1) {
-            invalidMarkerInfo = {
-                position: from,
-                title: WI.UIString("Duplicate property “%s”.\nClick to delete this property.").format(property.name),
-                correction: "",
-                autocomplete: false
-            };
-        }
-
-        if (property.valid) {
-            if (invalidMarkerInfo)
-                generateInvalidMarker.call(this, invalidMarkerInfo);
-
-            return;
-        }
-
-        if (propertyNameIsValid) {
-            let start = {line: from.line, ch: from.ch + property.name.length + 2};
-            let end = {line: to.line, ch: start.ch + property.value.length};
-
-            this._codeMirror.markText(start, end, {className: "invalid"});
-
-            if (/^(?:\d+)$/.test(property.value)) {
-                invalidMarkerInfo = {
-                    position: from,
-                    title: WI.UIString("The value “%s” needs units.\nClick to add “px” to the value.").format(property.value),
-                    correction: property.name + ": " + property.value + "px;",
-                    autocomplete: false
-                };
-            } else {
-                var valueReplacement = property.value.length ? WI.UIString("The value “%s” is not supported for this property.\nClick to delete and open autocomplete.").format(property.value) : WI.UIString("This property needs a value.\nClick to open autocomplete.");
-
-                invalidMarkerInfo = {
-                    position: from,
-                    title: valueReplacement,
-                    correction: property.name + ": ",
-                    autocomplete: true
-                };
-            }
-        } else if (!instancesOfProperty.call(this, "-webkit-" + property.name) && WI.CSSCompletions.cssNameCompletions.propertyRequiresWebkitPrefix(property.name)) {
-            // The property is valid and exists in the rule while its prefixed version does not.
-            invalidMarkerInfo = {
-                position: from,
-                title: WI.UIString("The “webkit” prefix is needed for this property.\nClick to insert a duplicate with the prefix."),
-                correction: "-webkit-" + property.text + "\n" + property.text,
-                autocomplete: false
-            };
-        } else if (!propertyHasUnnecessaryPrefix && !WI.CSSCompletions.cssNameCompletions.isValidPropertyName("-webkit-" + property.name)) {
-            // The property either has no prefix and is invalid with a prefix or is invalid without a prefix.
-            var closestPropertyName = WI.CSSCompletions.cssNameCompletions.getClosestPropertyName(property.name);
-
-            if (closestPropertyName) {
-                // The property name has less than 3 other properties that have the same Levenshtein distance.
-                invalidMarkerInfo = {
-                    position: from,
-                    title: WI.UIString("Did you mean “%s”?\nClick to replace.").format(closestPropertyName),
-                    correction: property.text.replace(property.name, closestPropertyName),
-                    autocomplete: true
-                };
-            } else if (property.name.startsWith("-webkit-") && (closestPropertyName = WI.CSSCompletions.cssNameCompletions.getClosestPropertyName(property.canonicalName))) {
-                // The unprefixed property name has less than 3 other properties that have the same Levenshtein distance.
-                invalidMarkerInfo = {
-                    position: from,
-                    title: WI.UIString("Did you mean “%s”?\nClick to replace.").format("-webkit-" + closestPropertyName),
-                    correction: property.text.replace(property.canonicalName, closestPropertyName),
-                    autocomplete: true
-                };
-            } else {
-                // The property name is so vague or nonsensical that there are more than 3 other properties that have the same Levenshtein value.
-                invalidMarkerInfo = {
-                    position: from,
-                    title: WI.UIString("Unsupported property “%s”").format(property.name),
-                    correction: false,
-                    autocomplete: false
-                };
-            }
-        }
-
-        if (!invalidMarkerInfo)
-            return;
-
-        generateInvalidMarker.call(this, invalidMarkerInfo);
-    }
-
-    _clearTextMarkers(nonatomic, all)
-    {
-        function clear()
-        {
-            var markers = this._codeMirror.getAllMarks();
-            for (var i = 0; i < markers.length; ++i) {
-                var textMarker = markers[i];
-
-                if (!all && textMarker.__checkboxPlaceholder) {
-                    var position = textMarker.find();
-
-                    // Only keep checkbox placeholders if they are in the first column.
-                    if (position && !position.ch)
-                        continue;
-                }
-
-                if (textMarker.__cssProperty) {
-                    textMarker.__cssProperty.removeEventListener(null, null, this);
-
-                    delete textMarker.__cssProperty.__propertyTextMarker;
-                    delete textMarker.__cssProperty;
-                }
-
-                textMarker.clear();
-            }
-        }
-
-        if (nonatomic)
-            clear.call(this);
-        else
-            this._codeMirror.operation(clear.bind(this));
-    }
-
-    _iterateOverProperties(onlyVisibleProperties, callback)
-    {
-        let properties = onlyVisibleProperties ? this._style.visibleProperties : this._style.properties;
-
-        let filterFunction = (property) => property; // Identity function.
-        if (this._filterResultPropertyNames) {
-            filterFunction = (property) => {
-                if (!property.variable && this._propertyVisibilityMode === WI.CSSStyleDeclarationTextEditor.PropertyVisibilityMode.HideNonVariables)
-                    return false;
-
-                if (property.variable && this._propertyVisibilityMode === WI.CSSStyleDeclarationTextEditor.PropertyVisibilityMode.HideVariables)
-                    return false;
-
-                if (property.implicit && !this._showsImplicitProperties)
-                    return false;
-
-                if (!(property.name in this._filterResultPropertyNames))
-                    return false;
-
-                return true;
-            };
-        } else if (!onlyVisibleProperties) {
-            // Filter based on options only when all properties are used.
-            filterFunction = (property) => {
-                switch (this._propertyVisibilityMode) {
-                case WI.CSSStyleDeclarationTextEditor.PropertyVisibilityMode.HideNonVariables:
-                    if (!property.variable)
-                        return false;
-
-                    break;
-                case WI.CSSStyleDeclarationTextEditor.PropertyVisibilityMode.HideVariables:
-                    if (property.variable)
-                        return false;
-
-                    break;
-
-                case WI.CSSStyleDeclarationTextEditor.PropertyVisibilityMode.ShowAll:
-                    break;
-
-                default:
-                    console.error("Invalid property visibility mode");
-                    break;
-                }
-
-                return !property.implicit || this._showsImplicitProperties || property.canonicalName in this._alwaysShowPropertyNames;
-            };
-        }
-
-        properties = properties.filter(filterFunction);
-        if (this._sortProperties)
-            properties.sort((a, b) => a.name.extendedLocaleCompare(b.name));
-
-        this._shownProperties = properties;
-
-        for (var i = 0; i < properties.length; ++i) {
-            if (callback.call(this, properties[i], i === properties.length - 1))
-                break;
-        }
-    }
-
-    _propertyCheckboxChanged(event)
-    {
-        var property = event.target.__cssProperty;
-        console.assert(property);
-        if (!property)
-            return;
-
-        this._commentProperty(property);
-    }
-
-    _commentProperty(property)
-    {
-        var textMarker = property.__propertyTextMarker;
-        console.assert(textMarker);
-        if (!textMarker)
-            return;
-
-        // Check if the property has been removed already, like from double-clicking
-        // the checkbox and calling this event listener multiple times.
-        var range = textMarker.find();
-        if (!range)
-            return;
-
-        property._commentRange = range;
-        property._commentRange.to.ch += 6; // Number of characters added by comments.
-
-        var text = this._codeMirror.getRange(range.from, range.to);
-
-        function update()
-        {
-            // Replace the text with a commented version.
-            this._codeMirror.replaceRange("/* " + text + " */", range.from, range.to);
-
-            // Update the line for any inline swatches that got removed.
-            this._createInlineSwatches(true, range.from.line);
-        }
-
-        this._codeMirror.operation(update.bind(this));
-    }
-
-    _propertyCommentCheckboxChanged(event)
-    {
-        var commentTextMarker = event.target.__commentTextMarker;
-        console.assert(commentTextMarker);
-        if (!commentTextMarker)
-            return;
-
-        // Check if the comment has been removed already, like from double-clicking
-        // the checkbox and calling event listener multiple times.
-        var range = commentTextMarker.find();
-        if (!range)
-            return;
-
-        this._uncommentRange(range);
-    }
-
-    _uncommentRange(range)
-    {
-        var text = this._codeMirror.getRange(range.from, range.to);
-
-        // Remove the comment prefix and suffix.
-        text = text.replace(/^\/\*\s*/, "").replace(/\s*\*\/$/, "");
-
-        // Add a semicolon if there isn't one already.
-        if (text.length && text.charAt(text.length - 1) !== ";")
-            text += ";";
-
-        function update()
-        {
-            this._codeMirror.addLineClass(range.from.line, "wrap", WI.CSSStyleDeclarationTextEditor.EditingLineStyleClassName);
-            this._codeMirror.replaceRange(text, range.from, range.to);
-
-            // Update the line for any inline swatches that got removed.
-            this._createInlineSwatches(true, range.from.line);
-        }
-
-        this._codeMirror.operation(update.bind(this));
-    }
-
-    _inlineSwatchValueChanged(event)
-    {
-        let swatch = event && event.target;
-        console.assert(swatch);
-        if (!swatch)
-            return;
-
-        let value = event.data && event.data.value && event.data.value.toString();
-        console.assert(value);
-        if (!value)
-            return;
-
-        let textMarker = swatch.__textMarker;
-        let range = swatch.__textMarkerRange;
-        console.assert(range);
-        if (!range)
-            return;
-
-        function update()
-        {
-            // Sometimes we still might find a stale text marker with findMarksAt.
-            range = textMarker.find();
-            if (!range)
-                return;
-
-            textMarker.clear();
-
-            this._codeMirror.replaceRange(value, range.from, range.to);
-
-            // The value's text could have changed, so we need to update the "range"
-            // variable to anticipate a different "range.to" property.
-            range.to.ch = range.from.ch + value.length;
-
-            textMarker = this._codeMirror.markText(range.from, range.to);
-
-            swatch.__textMarker = textMarker;
-        }
-
-        this._codeMirror.operation(update.bind(this));
-    }
-
-    _inlineSwatchActivated()
-    {
-        this._hasActiveInlineSwatchEditor = true;
-    }
-
-    _inlineSwatchDeactivated()
-    {
-        this._hasActiveInlineSwatchEditor = false;
-    }
-
-    _propertyOverriddenStatusChanged(event)
-    {
-        this._updateTextMarkerForPropertyIfNeeded(event.target);
-    }
-
-    _propertiesChanged(event)
-    {
-        // Don't try to update the document while completions are showing. Doing so will clear
-        // the completion hint and prevent further interaction with the completion.
-        if (this._completionController.isShowingCompletions())
-            return;
-
-        if (this._hasActiveInlineSwatchEditor)
-            return;
-
-        // Don't try to update the document after just modifying a swatch.
-        if (this._ignoreNextPropertiesChanged) {
-            this._ignoreNextPropertiesChanged = false;
-            return;
-        }
-
-        // Reset the content if the text is different and we are not focused.
-        if (!this.focused && (!this._style.text || this._style.text !== this._formattedContent())) {
-            this._resetContent();
-            return;
-        }
-
-        this._removeEditingLineClassesSoon();
-
-        this._updateTextMarkers();
-    }
-
-    _markLinesWithCheckboxPlaceholder()
-    {
-        if (this._codeMirror.getOption("readOnly"))
-            return;
-
-        var linesWithPropertyCheckboxes = {};
-        var linesWithCheckboxPlaceholders = {};
-
-        var markers = this._codeMirror.getAllMarks();
-        for (var i = 0; i < markers.length; ++i) {
-            var textMarker = markers[i];
-            if (textMarker.__propertyCheckbox) {
-                var position = textMarker.find();
-                if (position)
-                    linesWithPropertyCheckboxes[position.line] = true;
-            } else if (textMarker.__checkboxPlaceholder) {
-                var position = textMarker.find();
-                if (position)
-                    linesWithCheckboxPlaceholders[position.line] = true;
-            }
-        }
-
-        var lineCount = this._codeMirror.lineCount();
-
-        for (var i = 0; i < lineCount; ++i) {
-            if (i in linesWithPropertyCheckboxes || i in linesWithCheckboxPlaceholders)
-                continue;
-
-            var position = {line: i, ch: 0};
-
-            var placeholderElement = document.createElement("div");
-            placeholderElement.className = WI.CSSStyleDeclarationTextEditor.CheckboxPlaceholderElementStyleClassName;
-
-            var placeholderMark = this._codeMirror.setUniqueBookmark(position, placeholderElement);
-            placeholderMark.__checkboxPlaceholder = true;
-        }
-    }
-
-    _removeCheckboxPlaceholder(lineNumber)
-    {
-        var marks = this._codeMirror.findMarksAt({line: lineNumber, ch: 0});
-        for (var i = 0; i < marks.length; ++i) {
-            var mark = marks[i];
-            if (!mark.__checkboxPlaceholder)
-                continue;
-
-            mark.clear();
-            return;
-        }
-    }
-
-    _formattedContentFromEditor()
-    {
-        let indentString = WI.indentString();
-        let builder = new FormatterContentBuilder(indentString);
-        let formatter = new WI.Formatter(this._codeMirror, builder);
-        let start = {line: 0, ch: 0};
-        let end = {line: this._codeMirror.lineCount() - 1};
-        formatter.format(start, end);
-
-        return builder.formattedContent.trim();
-    }
-
-    _resetContent()
-    {
-        if (this._commitChangesTimeout) {
-            clearTimeout(this._commitChangesTimeout);
-            this._commitChangesTimeout = null;
-        }
-
-        this._removeEditingLineClasses();
-
-        // Only allow editing if we have a style, it is editable and we have text range in the stylesheet.
-        const readOnly = !this._style || !this._style.editable || !this._style.styleSheetTextRange;
-        this._codeMirror.setOption("readOnly", readOnly);
-
-        if (readOnly) {
-            this.element.classList.add(WI.CSSStyleDeclarationTextEditor.ReadOnlyStyleClassName);
-            this._codeMirror.setOption("placeholder", WI.UIString("No Properties"));
-        } else {
-            this.element.classList.remove(WI.CSSStyleDeclarationTextEditor.ReadOnlyStyleClassName);
-            this._codeMirror.setOption("placeholder", WI.UIString("No Properties \u2014 Click to Edit"));
-        }
-
-        if (!this._style) {
-            this._ignoreCodeMirrorContentDidChangeEvent = true;
-
-            this._clearTextMarkers(false, true);
-            this._codeMirror.setValue("");
-            this._codeMirror.clearHistory();
-            this._codeMirror.markClean();
-
-            this._ignoreCodeMirrorContentDidChangeEvent = false;
-            return;
-        }
-
-        function update()
-        {
-            // Remember the cursor position/selection.
-            let isEditorReadOnly = this._codeMirror.getOption("readOnly");
-            let styleText = this._style.text;
-            let trimmedStyleText = styleText.trim();
-
-            // We only need to format non-empty styles, but prepare checkbox placeholders
-            // in any case because that will indent the cursor when the User starts typing.
-            if (!trimmedStyleText && !isEditorReadOnly) {
-                this._markLinesWithCheckboxPlaceholder();
-                return;
-            }
-
-            // Generate formatted content for readonly editors by iterating properties.
-            if (isEditorReadOnly) {
-                this._codeMirror.setValue("");
-                let lineNumber = 0;
-                this._iterateOverProperties(false, function(property) {
-                    let from = {line: lineNumber, ch: 0};
-                    let to = {line: lineNumber};
-                    // Readonly properties are pretty printed by `synthesizedText` and not the Formatter.
-                    this._codeMirror.replaceRange((lineNumber ? "\n" : "") + property.synthesizedText, from);
-                    this._createTextMarkerForPropertyIfNeeded(from, to, property);
-                    lineNumber++;
-                });
-                return;
-            }
-
-            let selectionAnchor = this._codeMirror.getCursor("anchor");
-            let selectionHead = this._codeMirror.getCursor("head");
-            let whitespaceRegex = /\s+/g;
-
-            this._linePrefixWhitespace = WI.indentString();
-
-            let styleTextPrefixWhitespace = styleText.match(/^\s*/);
-
-            // If there is a match and the style text contains a newline, attempt to pull out the prefix whitespace
-            // in front of the first line of CSS to use for every line.  If  there is no newline, we want to avoid
-            // adding multiple spaces to a single line CSS rule and instead format it on multiple lines.
-            if (styleTextPrefixWhitespace && trimmedStyleText.includes("\n")) {
-                let linePrefixWhitespaceMatch = styleTextPrefixWhitespace[0].match(/[^\S\n]+$/);
-                if (linePrefixWhitespaceMatch)
-                    this._linePrefixWhitespace = linePrefixWhitespaceMatch[0];
-            }
-
-            // Set non-optimized, valid and invalid styles in preparation for the Formatter.
-            this._codeMirror.setValue(trimmedStyleText);
-
-            // Now the Formatter pretty prints the styles.
-            this._codeMirror.setValue(this._formattedContentFromEditor());
-
-            // We need to workaround the fact that...
-            // 1) `this._style.properties` only holds valid CSSProperty instances but not
-            // comments and invalid properties like `color;`.
-            // 2) `_createTextMarkerForPropertyIfNeeded` relies on CSSProperty instances.
-            let cssPropertiesMap = new Map();
-            this._iterateOverProperties(false, function(cssProperty) {
-                cssProperty.__refreshedAfterBlur = false;
-
-                let propertyTextSansWhitespace = cssProperty.text.replace(whitespaceRegex, "");
-                let existingProperties = cssPropertiesMap.get(propertyTextSansWhitespace) || [];
-                existingProperties.push(cssProperty);
-
-                cssPropertiesMap.set(propertyTextSansWhitespace, existingProperties);
-            });
-
-            // Go through the Editor line by line and create TextMarker when a
-            // CSSProperty instance for that property exists. If not, then don't create a TextMarker.
-            this._codeMirror.eachLine(function(lineHandler) {
-                let lineNumber = lineHandler.lineNo();
-                let lineContentSansWhitespace = lineHandler.text.replace(whitespaceRegex, "");
-                let properties = cssPropertiesMap.get(lineContentSansWhitespace);
-                if (!properties) {
-                    this._createCommentedCheckboxMarker(lineHandler);
-                    return;
-                }
-
-                for (let property of properties) {
-                    if (property.__refreshedAfterBlur)
-                        continue;
-
-                    let from = {line: lineNumber, ch: 0};
-                    let to = {line: lineNumber};
-                    this._createTextMarkerForPropertyIfNeeded(from, to, property);
-                    property.__refreshedAfterBlur = true;
-                    break;
-                }
-            }.bind(this));
-
-            // Look for swatchable values and make inline swatches.
-            this._createInlineSwatches(true);
-
-            // Restore the cursor position/selection.
-            this._codeMirror.setSelection(selectionAnchor, selectionHead);
-
-            // Reset undo history since undo past the reset is wrong when the content was empty before
-            // or the content was representing a previous style object.
-            this._codeMirror.clearHistory();
-
-            // Mark the editor as clean (unedited state).
-            this._codeMirror.markClean();
-
-            this._markLinesWithCheckboxPlaceholder();
-        }
-
-        // This needs to be done first and as a separate operation to avoid an exception in CodeMirror.
-        this._clearTextMarkers(false, true);
-
-        this._ignoreCodeMirrorContentDidChangeEvent = true;
-        this._codeMirror.operation(update.bind(this));
-        this._ignoreCodeMirrorContentDidChangeEvent = false;
-    }
-
-    _updateJumpToSymbolTrackingMode()
-    {
-        var oldJumpToSymbolTrackingModeEnabled = this._jumpToSymbolTrackingModeEnabled;
-
-        if (!this._style)
-            this._jumpToSymbolTrackingModeEnabled = false;
-        else
-            this._jumpToSymbolTrackingModeEnabled = WI.modifierKeys.altKey && !WI.modifierKeys.metaKey && !WI.modifierKeys.shiftKey;
-
-        if (oldJumpToSymbolTrackingModeEnabled !== this._jumpToSymbolTrackingModeEnabled) {
-            if (this._jumpToSymbolTrackingModeEnabled) {
-                this._tokenTrackingController.highlightLastHoveredRange();
-                this._tokenTrackingController.enabled = true;
-            } else {
-                this._tokenTrackingController.removeHighlightedRange();
-                this._tokenTrackingController.enabled = false;
-            }
-        }
-    }
-
-    tokenTrackingControllerHighlightedRangeWasClicked(tokenTrackingController)
-    {
-        let candidate = tokenTrackingController.candidate;
-        console.assert(candidate);
-        if (!candidate)
-            return;
-
-        let sourceCodeLocation = null;
-        if (this._style.ownerRule)
-            sourceCodeLocation = this._style.ownerRule.sourceCodeLocation;
-
-        let token = candidate.hoveredToken;
-
-        const options = {
-            ignoreNetworkTab: true,
-            ignoreSearchTab: true,
-        };
-
-        // Special case option-clicking url(...) links.
-        if (token && /\blink\b/.test(token.type)) {
-            let url = token.string;
-            let baseURL = sourceCodeLocation ? sourceCodeLocation.sourceCode.url : this._style.node.ownerDocument.documentURL;
-
-            const frame = null;
-            WI.openURL(absoluteURL(url, baseURL), frame, options);
-            return;
-        }
-
-        // Only allow other text to be clicked if there is a source code location.
-        if (!this._style.ownerRule || !this._style.ownerRule.sourceCodeLocation)
-            return;
-
-        console.assert(sourceCodeLocation);
-        if (!sourceCodeLocation)
-            return;
-
-        function showRangeInSourceCode(sourceCode, range)
-        {
-            if (!sourceCode || !range)
-                return false;
-
-            WI.showSourceCodeLocation(sourceCode.createSourceCodeLocation(range.startLine, range.startColumn), options);
-            return true;
-        }
-
-        // Special case option clicking CSS variables.
-        if (token && /\bvariable-2\b/.test(token.type)) {
-            let property = this._style.nodeStyles.effectivePropertyForName(token.string);
-            if (property && showRangeInSourceCode(property.ownerStyle.ownerRule.sourceCodeLocation.sourceCode, property.styleSheetTextRange))
-                return;
-        }
-
-        // Jump to the rule if we can't find a property.
-        // Find a better source code location from the property that was clicked.
-        let marks = this._codeMirror.findMarksAt(candidate.hoveredTokenRange.start);
-        for (let mark of marks) {
-            let property = mark.__cssProperty;
-            if (property && showRangeInSourceCode(sourceCodeLocation.sourceCode, property.styleSheetTextRange))
-                return;
-        }
-    }
-
-    tokenTrackingControllerNewHighlightCandidate(tokenTrackingController, candidate)
-    {
-        // Do not highlight if the style has no source code location.
-        if (!this._style.ownerRule || !this._style.ownerRule.sourceCodeLocation) {
-            // Special case option-clicking url(...) links.
-            if (!candidate.hoveredToken || !/\blink\b/.test(candidate.hoveredToken.type))
-                return;
-        }
-
-        this._tokenTrackingController.highlightRange(candidate.hoveredTokenRange);
-    }
-};
-
-WI.CSSStyleDeclarationTextEditor.Event = {
-    ContentChanged: "css-style-declaration-text-editor-content-changed",
-    Blurred: "css-style-declaration-text-editor-blurred"
-};
-
-WI.CSSStyleDeclarationTextEditor.PropertyVisibilityMode = {
-    ShowAll: Symbol("variable-visibility-show-all"),
-    HideVariables: Symbol("variable-visibility-hide-variables"),
-    HideNonVariables: Symbol("variable-visibility-hide-non-variables"),
-};
-
-WI.CSSStyleDeclarationTextEditor.SuffixWhitespace = "\n";
-WI.CSSStyleDeclarationTextEditor.StyleClassName = "css-style-text-editor";
-WI.CSSStyleDeclarationTextEditor.ReadOnlyStyleClassName = "read-only";
-WI.CSSStyleDeclarationTextEditor.CheckboxPlaceholderElementStyleClassName = "checkbox-placeholder";
-WI.CSSStyleDeclarationTextEditor.EditingLineStyleClassName = "editing-line";
-WI.CSSStyleDeclarationTextEditor.CommitCoalesceDelay = 250;
-WI.CSSStyleDeclarationTextEditor.RemoveEditingLineClassesDelay = 2000;
index 720f4f5..274e73b 100644 (file)
         return style && (style + " m-" + (this.alternateName || this.name));
     }
 
-    function extendedCSSRuleStartState(base)
-    {
-        // CodeMirror moves the original token function to _startState when we extended it.
-        // So call it to get the original start state that we will modify.
-        var state = this._startState(base);
-
-        // Start off the state stack like it has already parsed a rule. This causes everything
-        // after to be parsed as properties in a rule.
-        state.state = "block";
-        state.context.type = "block";
-
-        return state;
-    }
-
     function scrollCursorIntoView(codeMirror, event)
     {
         // We don't want to use the default implementation since it can cause massive jumping
     CodeMirror.extendMode("xml", {token: extendedXMLToken});
     CodeMirror.extendMode("javascript", {token: extendedToken});
 
-    CodeMirror.defineMode("css-rule", CodeMirror.modes.css);
-    CodeMirror.extendMode("css-rule", {token: extendedCSSToken, startState: extendedCSSRuleStartState, alternateName: "css"});
-
     CodeMirror.defineInitHook(function(codeMirror) {
         codeMirror.on("scrollCursorIntoView", scrollCursorIntoView);
     });
index 6be3d74..ddbbcc4 100644 (file)
@@ -447,97 +447,3 @@ CodeMirror.extendMode("css", {
             state._cssPrettyPrint.lineLength = 0;
     }
 });
-
-CodeMirror.extendMode("css-rule", {
-    shouldHaveSpaceBeforeToken: function(lastToken, lastContent, token, state, content, isComment)
-    {
-        // Add whitespace before ":_value"
-        if (lastContent === ":" && !lastToken)
-            return true;
-
-        // Add whitespace between "1px_solid_green"
-        var tokenRegExp = /\b(?:keyword|atom|number)\b/;
-        if (tokenRegExp.test(lastToken) && tokenRegExp.test(token))
-            return true;
-
-        return false;
-    },
-
-    shouldHaveSpaceAfterLastToken: function(lastToken, lastContent, token, state, content, isComment)
-    {
-        return lastContent === "," && !lastToken;
-    },
-
-    newlinesAfterToken: function(lastToken, lastContent, token, state, content, isComment)
-    {
-        return 0;
-    },
-
-    removeLastWhitespace: function(lastToken, lastContent, token, state, content, isComment)
-    {
-        // Remove whitespace before a comment which moves the comment to the beginning of the line.
-        if (isComment)
-            return true;
-
-        // A semicolon indicates the end of line. So remove whitespace before next line.
-        if (!lastToken)
-            return lastContent === ";";
-
-        // Remove whitespace before semicolon. Like `prop: value ;`.
-        // Remove whitespace before colon. Like `prop : value;`.
-        if (!token)
-            return content === ";" || content === ":";
-
-        // A comment is supposed to be in its own line. So remove whitespace before next line.
-        if (/\bcomment\b/.test(lastToken))
-            return true;
-
-        return false;
-    },
-
-    removeLastNewline: function(lastToken, lastContent, token, state, content, isComment, firstTokenOnLine)
-    {
-        // Each property should be formatted to one line each with no extra newlines.
-        return true;
-    },
-
-    indentAfterToken: function(lastToken, lastContent, token, state, content, isComment)
-    {
-        return false;
-    },
-
-    newlineBeforeToken: function(lastToken, lastContent, token, state, content, isComment)
-    {
-        // Add new line before comments.
-        if (isComment)
-            return true;
-
-        // Add new line before a prefixed property like `-webkit-animation`.
-        if (state.state === "block")
-            return /\bmeta\b/.test(token);
-
-        // Add new line after comment
-        if (/\bcomment\b/.test(lastToken))
-            return true;
-
-        // Add new line before a regular property like `display`.
-        if (/\bproperty\b/.test(token))
-            return !/\bmeta\b/.test(lastToken);
-
-        // Add new line before a CSS variable like `--foo`.
-        if (state.state === "maybeprop" && /\bvariable-2\b/.test(token))
-            return true;
-
-        return false;
-    },
-
-    indentBeforeToken: function(lastToken, lastContent, token, state, content, isComment)
-    {
-        return false;
-    },
-
-    dedentsBeforeToken: function(lastToken, lastContent, token, state, content, isComment)
-    {
-        return 0;
-    }
-});
index 4fa0592..f8754c4 100644 (file)
@@ -201,9 +201,3 @@ function createCodeMirrorSpringTextMarkers(codeMirror, range, callback)
     const springRegex = /(spring\([^)]+\))/g;
     return createCodeMirrorTextMarkers("Spring", springRegex, null, codeMirror, range, callback);
 }
-
-function createCodeMirrorVariableTextMarkers(codeMirror, range, callback)
-{
-    const variableRegex = /var\((--[\w-]+)\)/g;
-    return createCodeMirrorTextMarkers("Variable", variableRegex, null, codeMirror, range, callback);
-}
index 38b8cd8..67d3034 100644 (file)
@@ -88,27 +88,6 @@ WI.ComputedStyleDetailsPanel = class ComputedStyleDetailsPanel extends WI.StyleD
         this._variablesTextEditor.focus();
     }
 
-    // CSSStyleDeclarationTextEditor delegate
-
-    cssStyleDeclarationTextEditorStartEditingAdjacentRule(cssStyleDeclarationTextEditor, backward)
-    {
-        if (cssStyleDeclarationTextEditor === this._propertiesTextEditor) {
-            if (backward && this._delegate && this._delegate.styleDetailsPanelFocusLastPseudoClassCheckbox) {
-                this._delegate.styleDetailsPanelFocusLastPseudoClassCheckbox(this);
-                return;
-            }
-
-            this._variablesTextEditor.focus();
-        } else if (cssStyleDeclarationTextEditor === this._variablesTextEditor) {
-            if (!backward && this._delegate && this._delegate.styleDetailsPanelFocusFilterBar) {
-                this._delegate.styleDetailsPanelFocusFilterBar(this);
-                return;
-            }
-
-            this._propertiesTextEditor.focus();
-        }
-    }
-
     // Protected
 
     initialLayout()
diff --git a/Source/WebInspectorUI/UserInterface/Views/RulesStyleDetailsPanel.css b/Source/WebInspectorUI/UserInterface/Views/RulesStyleDetailsPanel.css
deleted file mode 100644 (file)
index 1983008..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-.sidebar > .panel.details.css-style .rules {
-    text-align: left;
-}
-
-.sidebar > .panel.details.css-style .rules .label {
-    color: hsl(0, 0%, 60%);
-    padding: 0 8px;
-}
-
-.sidebar > .panel.details.css-style .rules .label:first-child {
-    padding-top: 10px;
-}
-
-.sidebar > .panel.details.css-style .rules .label .go-to-link {
-    color: inherit !important;
-}
-
-.sidebar > .panel.details.css-style .rules .label + .style-declaration-section {
-    margin-top: 5px;
-    border-top: 1px solid hsla(0, 0%, 0%, 0.3);
-}
-
-.sidebar > .panel.details.css-style > .content.filter-in-progress > .rules .label {
-    padding-top: 15px;
-}
-
-.sidebar > .panel.details.css-style > .content.filter-in-progress > .rules .label:not(.filter-section-non-matching) ~ .label {
-    padding-top: 0;
-}
-
-.sidebar > .panel.details.css-style > .content.filter-in-progress > .rules .label.filter-matching-label {
-    padding-bottom: 5px;
-    border-bottom: 1px solid hsla(0, 0%, 0%, 0.3);
-}
-
-.sidebar > .panel.details.css-style > .content.filter-in-progress > .rules .label:not(.filter-section-non-matching) + .label.filter-matching-label:not(.filter-section-non-matching) {
-    padding-top: 0;
-}
-
-.sidebar > .panel.details.css-style > .content.filter-in-progress > .rules .style-declaration-section:not(.filter-section-non-matching) ~ .label:not(.filter-section-non-matching) {
-    padding-top: 15px;
-}
-
-.sidebar > .panel.details.css-style > .content > .rules > .message-text-view {
-    top: var(--navigation-bar-height);
-}
-
-.sidebar > .panel.details.css-style > .content > .rules:not(.filter-non-matching) > .message-text-view {
-    display: none;
-}
diff --git a/Source/WebInspectorUI/UserInterface/Views/RulesStyleDetailsPanel.js b/Source/WebInspectorUI/UserInterface/Views/RulesStyleDetailsPanel.js
deleted file mode 100644 (file)
index 82b3e40..0000000
+++ /dev/null
@@ -1,511 +0,0 @@
-/*
- * Copyright (C) 2013, 2015 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-WI.RulesStyleDetailsPanel = class RulesStyleDetailsPanel extends WI.StyleDetailsPanel
-{
-    constructor(delegate)
-    {
-        super(delegate, "rules", "rules", WI.UIString("Styles \u2014 Rules"));
-
-        this._sections = [];
-        this._inspectorSection = null;
-        this._isInspectorSectionPendingFocus = false;
-        this._ruleMediaAndInherticanceList = [];
-        this._propertyToSelectAndHighlight = null;
-
-        this._emptyFilterResultsElement = WI.createMessageTextView(WI.UIString("No Results Found"));
-
-        this._boundRemoveSectionWithActiveEditor = this._removeSectionWithActiveEditor.bind(this);
-    }
-
-    // Public
-
-    refresh(significantChange)
-    {
-        // We only need to do a rebuild on significant changes. Other changes are handled
-        // by the sections and text editors themselves.
-        if (!significantChange) {
-            super.refresh();
-            return;
-        }
-
-        if (!this._forceSignificantChange) {
-            this._sectionWithActiveEditor = null;
-            for (var section of this._sections) {
-                if (!section.editorActive)
-                    continue;
-
-                this._sectionWithActiveEditor = section;
-                break;
-            }
-
-            if (this._sectionWithActiveEditor) {
-                this._sectionWithActiveEditor.addEventListener(WI.CSSStyleDeclarationSection.Event.Blurred, this._boundRemoveSectionWithActiveEditor);
-                return;
-            }
-        }
-
-        var newSections = [];
-        var newDOMFragment = document.createDocumentFragment();
-
-        var previousMediaList = [];
-        var previousSection = null;
-
-        var pseudoElements = this.nodeStyles.pseudoElements;
-        var pseudoElementsStyle = [];
-        for (var pseudoIdentifier in pseudoElements)
-            pseudoElementsStyle = pseudoElementsStyle.concat(pseudoElements[pseudoIdentifier].orderedStyles);
-
-        var orderedPseudoStyles = uniqueOrderedStyles(pseudoElementsStyle);
-        // Reverse the array to allow ensure that splicing the array will not mess with the order.
-        if (orderedPseudoStyles.length)
-            orderedPseudoStyles.reverse();
-
-        function mediaListsEqual(a, b)
-        {
-            a = a || [];
-            b = b || [];
-
-            if (a.length !== b.length)
-                return false;
-
-            for (var i = 0; i < a.length; ++i) {
-                var aMedia = a[i];
-                var bMedia = b[i];
-
-                if (aMedia.type !== bMedia.type)
-                    return false;
-
-                if (aMedia.text !== bMedia.text)
-                    return false;
-
-                if (!aMedia.sourceCodeLocation && bMedia.sourceCodeLocation)
-                    return false;
-
-                if (aMedia.sourceCodeLocation && !aMedia.sourceCodeLocation.isEqual(bMedia.sourceCodeLocation))
-                    return false;
-            }
-
-            return true;
-        }
-
-        function uniqueOrderedStyles(orderedStyles)
-        {
-            var uniqueStyles = [];
-
-            for (var style of orderedStyles) {
-                var rule = style.ownerRule;
-                if (!rule) {
-                    uniqueStyles.push(style);
-                    continue;
-                }
-
-                var found = false;
-                for (var existingStyle of uniqueStyles) {
-                    if (rule.isEqualTo(existingStyle.ownerRule)) {
-                        found = true;
-                        break;
-                    }
-                }
-                if (!found)
-                    uniqueStyles.push(style);
-            }
-
-            return uniqueStyles;
-        }
-
-        function appendStyleSection(style)
-        {
-            var section = style.__rulesSection;
-
-            if (!section) {
-                section = new WI.CSSStyleDeclarationSection(this, style);
-                style.__rulesSection = section;
-            } else
-                section.refresh();
-
-            if (this._isInspectorSectionPendingFocus && style.isInspectorRule())
-                this._inspectorSection = section;
-
-            // Reset lastInGroup in case the order/grouping changed.
-            section.lastInGroup = false;
-
-            newDOMFragment.appendChild(section.element);
-            newSections.push(section);
-
-            previousSection = section;
-        }
-
-        function insertMediaOrInheritanceLabel(style)
-        {
-            if (previousSection && previousSection.style.type === WI.CSSStyleDeclaration.Type.Inline)
-                previousSection.lastInGroup = true;
-
-            var hasMediaOrInherited = [];
-
-            if (previousSection && previousSection.style.node !== style.node) {
-                previousSection.lastInGroup = true;
-
-                var prefixElement = document.createElement("strong");
-                prefixElement.textContent = WI.UIString("Inherited From: ");
-
-                let inheritedLabel = newDOMFragment.appendChild(document.createElement("div"));
-                inheritedLabel.className = "label";
-
-                inheritedLabel.appendChild(prefixElement);
-
-                inheritedLabel.appendChild(WI.linkifyNodeReference(style.node, {
-                    maxLength: 100,
-                    excludeRevealElement: true,
-                }));
-
-                hasMediaOrInherited.push(inheritedLabel);
-            }
-
-            // Only include the media list if it is different from the previous media list shown.
-            var currentMediaList = (style.ownerRule && style.ownerRule.mediaList) || [];
-            if (!mediaListsEqual(previousMediaList, currentMediaList)) {
-                previousMediaList = currentMediaList;
-
-                // Break the section group even if the media list is empty. That way the user knows
-                // the previous displayed media list does not apply to the next section.
-                if (previousSection)
-                    previousSection.lastInGroup = true;
-
-                for (var media of currentMediaList) {
-                    var prefixElement = document.createElement("strong");
-                    prefixElement.textContent = WI.UIString("Media: ");
-
-                    var mediaLabel = document.createElement("div");
-                    mediaLabel.className = "label";
-                    mediaLabel.append(prefixElement, media.text);
-
-                    if (media.sourceCodeLocation) {
-                        const options = {
-                            dontFloat: true,
-                            ignoreNetworkTab: true,
-                            ignoreSearchTab: true,
-                        };
-                        mediaLabel.append(" \u2014 ", WI.createSourceCodeLocationLink(media.sourceCodeLocation, options));
-                    }
-
-                    newDOMFragment.appendChild(mediaLabel);
-
-                    hasMediaOrInherited.push(mediaLabel);
-                }
-            }
-
-            if (!hasMediaOrInherited.length && style.type !== WI.CSSStyleDeclaration.Type.Inline) {
-                if (previousSection && !previousSection.lastInGroup)
-                    hasMediaOrInherited = this._ruleMediaAndInherticanceList.lastValue;
-                else {
-                    var prefixElement = document.createElement("strong");
-                    prefixElement.textContent = WI.UIString("Media: ");
-
-                    var mediaLabel = document.createElement("div");
-                    mediaLabel.className = "label";
-                    mediaLabel.append(prefixElement, "all");
-
-                    newDOMFragment.appendChild(mediaLabel);
-                    hasMediaOrInherited.push(mediaLabel);
-                }
-            }
-
-            this._ruleMediaAndInherticanceList.push(hasMediaOrInherited);
-        }
-
-        function insertAllMatchingPseudoStyles(force)
-        {
-            if (!orderedPseudoStyles.length)
-                return;
-
-            if (force) {
-                for (var j = orderedPseudoStyles.length - 1; j >= 0; --j) {
-                    var pseudoStyle = orderedPseudoStyles[j];
-                    insertMediaOrInheritanceLabel.call(this, pseudoStyle);
-                    appendStyleSection.call(this, pseudoStyle);
-                }
-                orderedPseudoStyles = [];
-            }
-
-            if (!previousSection)
-                return;
-
-            var ownerRule = previousSection.style.ownerRule;
-            if (!ownerRule)
-                return;
-
-            for (var j = orderedPseudoStyles.length - 1; j >= 0; --j) {
-                var pseudoStyle = orderedPseudoStyles[j];
-                if (!pseudoStyle.ownerRule.selectorIsGreater(ownerRule.mostSpecificSelector))
-                    continue;
-
-                insertMediaOrInheritanceLabel.call(this, pseudoStyle);
-                appendStyleSection.call(this, pseudoStyle);
-                ownerRule = pseudoStyle.ownerRule;
-                orderedPseudoStyles.splice(j, 1);
-            }
-        }
-
-        this._ruleMediaAndInherticanceList = [];
-        var orderedStyles = uniqueOrderedStyles(this.nodeStyles.orderedStyles);
-        for (var style of orderedStyles) {
-            var isUserAgentStyle = style.ownerRule && style.ownerRule.type === WI.CSSStyleSheet.Type.UserAgent;
-            insertAllMatchingPseudoStyles.call(this, isUserAgentStyle || style.inherited);
-
-            insertMediaOrInheritanceLabel.call(this, style);
-            appendStyleSection.call(this, style);
-        }
-
-        // Just in case there are any pseudo-selectors left that haven't been added.
-        insertAllMatchingPseudoStyles.call(this, true);
-
-        if (previousSection)
-            previousSection.lastInGroup = true;
-
-        this.element.removeChildren();
-        this.element.appendChild(newDOMFragment);
-        this.element.appendChild(this._emptyFilterResultsElement);
-
-        this._sections = newSections;
-
-        for (var i = 0; i < this._sections.length; ++i)
-            this._sections[i].updateLayout();
-
-        super.refresh();
-    }
-
-    scrollToSectionAndHighlightProperty(property)
-    {
-        if (!this._visible) {
-            this._propertyToSelectAndHighlight = property;
-            return false;
-        }
-
-        for (var section of this._sections) {
-            if (section.highlightProperty(property))
-                return true;
-        }
-
-        return false;
-    }
-
-    cssStyleDeclarationSectionEditorFocused(focusedSection)
-    {
-        for (let section of this._sections) {
-            if (section !== focusedSection)
-                section.clearSelection();
-        }
-
-        this._sectionWithActiveEditor = focusedSection;
-    }
-
-    cssStyleDeclarationSectionEditorNextRule(currentSection)
-    {
-        currentSection.clearSelection();
-
-        var index = this._sections.indexOf(currentSection);
-        this._sections[index < this._sections.length - 1 ? index + 1 : 0].focusRuleSelector();
-    }
-
-    cssStyleDeclarationSectionEditorPreviousRule(currentSection, selectLastProperty) {
-        currentSection.clearSelection();
-
-        if (selectLastProperty || !currentSection.selectorEditable) {
-            var index = this._sections.indexOf(currentSection);
-            index = index > 0 ? index - 1 : this._sections.length - 1;
-
-            var section = this._sections[index];
-            while (section.locked) {
-                index = index > 0 ? index - 1 : this._sections.length - 1;
-                section = this._sections[index];
-            }
-
-            section.focus();
-            section.selectLastProperty();
-            return;
-        }
-
-        currentSection.focusRuleSelector(true);
-    }
-
-    filterDidChange(filterBar)
-    {
-        for (var labels of this._ruleMediaAndInherticanceList) {
-            for (var i = 0; i < labels.length; ++i) {
-                labels[i].classList.toggle(WI.GeneralStyleDetailsSidebarPanel.NoFilterMatchInSectionClassName, filterBar.hasActiveFilters());
-
-                if (i === labels.length - 1)
-                    labels[i].classList.toggle("filter-matching-label", filterBar.hasActiveFilters());
-            }
-        }
-
-        var matchFound = !filterBar.hasActiveFilters();
-        for (var i = 0; i < this._sections.length; ++i) {
-            var section = this._sections[i];
-
-            if (section.findMatchingPropertiesAndSelectors(filterBar.filters.text) && filterBar.hasActiveFilters()) {
-                if (this._ruleMediaAndInherticanceList[i].length) {
-                    for (var label of this._ruleMediaAndInherticanceList[i])
-                        label.classList.remove(WI.GeneralStyleDetailsSidebarPanel.NoFilterMatchInSectionClassName);
-                } else
-                    section.element.classList.add(WI.GeneralStyleDetailsSidebarPanel.FilterMatchingSectionHasLabelClassName);
-
-                matchFound = true;
-            }
-        }
-
-        this.element.classList.toggle("filter-non-matching", !matchFound);
-    }
-
-    newRuleButtonClicked()
-    {
-        if (this.nodeStyles.node.isInUserAgentShadowTree())
-            return;
-
-        for (let existingRule of this.nodeStyles.rulesForSelector()) {
-            if (this.focusEmptySectionWithStyle(existingRule.style))
-                return;
-        }
-
-        this._isInspectorSectionPendingFocus = true;
-        let newInspectorRuleSelector = this.nodeStyles.node.appropriateSelectorFor(true);
-        this.nodeStyles.addRule(newInspectorRuleSelector);
-    }
-
-    newRuleButtonContextMenu(event)
-    {
-        if (this.nodeStyles.node.isInUserAgentShadowTree())
-            return;
-
-        let styleSheets = WI.cssStyleManager.styleSheets.filter(styleSheet => styleSheet.hasInfo() && !styleSheet.isInlineStyleTag() && !styleSheet.isInlineStyleAttributeStyleSheet());
-        if (!styleSheets.length)
-            return;
-
-        const justSelector = true;
-        let selector = this.nodeStyles.node.appropriateSelectorFor(justSelector);
-
-        let contextMenu = WI.ContextMenu.createFromEvent(event);
-
-        const handler = null;
-        const disabled = true;
-        contextMenu.appendItem(WI.UIString("Available Style Sheets"), handler, disabled);
-
-        for (let styleSheet of styleSheets) {
-            contextMenu.appendItem(styleSheet.displayName, () => {
-                const text = "";
-                this.nodeStyles.addRule(selector, text, styleSheet.id);
-            });
-        }
-    }
-
-    sectionForStyle(style)
-    {
-        if (style.__rulesSection)
-            return style.__rulesSection;
-
-        for (let section of this._sections) {
-            if (section.style === style)
-                return section;
-        }
-        return null;
-    }
-
-    focusEmptySectionWithStyle(style)
-    {
-        if (style.hasProperties())
-            return false;
-
-        let section = this.sectionForStyle(style);
-        if (!section)
-            return false;
-
-        section.focus();
-        return true;
-    }
-
-    // Protected
-
-    shown()
-    {
-        super.shown();
-
-        // Associate the style and section objects so they can be reused.
-        // Also update the layout in case we changed widths while hidden.
-        for (var i = 0; i < this._sections.length; ++i) {
-            var section = this._sections[i];
-            section.style.__rulesSection = section;
-            section.updateLayout();
-        }
-
-        // If there was an active section and the panel was hidden, refresh the section in case
-        // changes were made to the underlying resource.
-        if (this._sectionWithActiveEditor)
-            this._sectionWithActiveEditor.refreshEditor();
-    }
-
-    hidden()
-    {
-        super.hidden();
-
-        // Disconnect the style and section objects so they have a chance
-        // to release their objects when this panel is not visible.
-        for (var i = 0; i < this._sections.length; ++i)
-            delete this._sections[i].style.__rulesSection;
-    }
-
-    sizeDidChange()
-    {
-        for (var i = 0; i < this._sections.length; ++i)
-            this._sections[i].updateLayout();
-    }
-
-    nodeStylesRefreshed(event)
-    {
-        super.nodeStylesRefreshed(event);
-
-        if (this._propertyToSelectAndHighlight) {
-            this.scrollToSectionAndHighlightProperty(this._propertyToSelectAndHighlight);
-            this._propertyToSelectAndHighlight = null;
-        }
-
-        if (this._isInspectorSectionPendingFocus) {
-            this._isInspectorSectionPendingFocus = false;
-
-            if (this._inspectorSection) {
-                this._inspectorSection.focus();
-                this._inspectorSection = null;
-            }
-        }
-    }
-
-    // Private
-
-    _removeSectionWithActiveEditor(event)
-    {
-        this._sectionWithActiveEditor.removeEventListener(WI.CSSStyleDeclarationSection.Event.Blurred, this._boundRemoveSectionWithActiveEditor);
-        this.refresh(true);
-    }
-};
index 11b0671..3ddf36f 100644 (file)
@@ -27,13 +27,6 @@ WI.RulesStyleDetailsSidebarPanel = class RulesStyleDetailsSidebarPanel extends W
 {
     constructor()
     {
-        let rulesStyleDetailsPanelConstructor;
-
-        if (WI.settings.experimentalLegacyStyleEditor.value)
-            rulesStyleDetailsPanelConstructor = WI.RulesStyleDetailsPanel;
-        else
-            rulesStyleDetailsPanelConstructor = WI.SpreadsheetRulesStyleDetailsPanel;
-
-        super("style-rules", WI.UIString("Styles"), rulesStyleDetailsPanelConstructor);
+        super("style-rules", WI.UIString("Styles"), WI.SpreadsheetRulesStyleDetailsPanel);
     }
 };
index c4df64e..35dd313 100644 (file)
@@ -234,16 +234,11 @@ WI.SettingsTabContentView = class SettingsTabContentView extends WI.TabContentVi
 
     _createExperimentalSettingsView()
     {
-        if (!(window.CanvasAgent || window.CSSAgent || window.NetworkAgent || window.LayerTreeAgent))
+        if (!(window.CanvasAgent || window.NetworkAgent || window.LayerTreeAgent))
             return;
 
         let experimentalSettingsView = new WI.SettingsView("experimental", WI.UIString("Experimental"));
 
-        if (window.CSSAgent) {
-            let stylesGroup = experimentalSettingsView.addGroup(WI.UIString("Styles Sidebar:"));
-            stylesGroup.addSetting(WI.settings.experimentalLegacyStyleEditor, WI.UIString("Legacy Style Editor"));
-        }
-
         if (window.LayerTreeAgent) {
             experimentalSettingsView.addSetting(WI.UIString("Layers:"), WI.settings.experimentalEnableLayersTab, WI.UIString("Enable Layers Tab"));
             experimentalSettingsView.addSeparator();
@@ -275,7 +270,6 @@ WI.SettingsTabContentView = class SettingsTabContentView extends WI.TabContentVi
             });
         }
 
-        listenForChange(WI.settings.experimentalLegacyStyleEditor);
         listenForChange(WI.settings.experimentalEnableLayersTab);
         listenForChange(WI.settings.experimentalEnableSourcesTab);
         listenForChange(WI.settings.experimentalEnableNewTabBar);
index e8227dc..5844c9c 100644 (file)
@@ -341,7 +341,7 @@ WI.SpreadsheetCSSStyleDeclarationEditor = class SpreadsheetCSSStyleDeclarationEd
         console.assert(movedFromIndex !== -1, "Property doesn't exist, focusing on a selector as a fallback.");
         if (movedFromIndex === -1) {
             if (this._style.selectorEditable)
-                this._delegate.cssStyleDeclarationTextEditorStartEditingRuleSelector();
+                this._delegate.spreadsheetCSSStyleDeclarationEditorStartEditingRuleSelector();
 
             return;
         }
@@ -368,7 +368,7 @@ WI.SpreadsheetCSSStyleDeclarationEditor = class SpreadsheetCSSStyleDeclarationEd
             } else {
                 // Move from the first property's name to the rule's selector.
                 if (this._style.selectorEditable)
-                    this._delegate.cssStyleDeclarationTextEditorStartEditingRuleSelector();
+                    this._delegate.spreadsheetCSSStyleDeclarationEditorStartEditingRuleSelector();
                 else {
                     const delta = -1;
                     this._delegate.spreadsheetCSSStyleDeclarationEditorStartEditingAdjacentRule(this, delta);
index 7e9be5a..e11c0a4 100644 (file)
@@ -154,11 +154,6 @@ WI.SpreadsheetCSSStyleDeclarationSection = class SpreadsheetCSSStyleDeclarationS
         return false;
     }
 
-    cssStyleDeclarationTextEditorStartEditingRuleSelector()
-    {
-        this.startEditingRuleSelector();
-    }
-
     // SpreadsheetSelectorField delegate
 
     spreadsheetSelectorFieldDidChange(direction)
@@ -195,6 +190,11 @@ WI.SpreadsheetCSSStyleDeclarationSection = class SpreadsheetCSSStyleDeclarationS
 
     // SpreadsheetCSSStyleDeclarationEditor delegate
 
+    spreadsheetCSSStyleDeclarationEditorStartEditingRuleSelector()
+    {
+        this.startEditingRuleSelector();
+    }
+
     spreadsheetCSSStyleDeclarationEditorStartEditingAdjacentRule(propertiesEditor, delta)
     {
         if (!this._delegate)
index f686db4..871ea8e 100644 (file)
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-.spreadsheet-style-panel .section-header {
+ .sidebar > .panel.details.css-style .rules {
+     text-align: left;
+ }
+
+ .sidebar > .panel.details.css-style > .content > .rules .section-header {
     margin: 0;
     padding: 4px 6px;
     font-size: inherit;
     border-bottom: 0.5px solid hsla(0, 0%, 0%, 0.2);
 }
 
-.spreadsheet-style-panel .section-header .node-link {
+.sidebar > .panel.details.css-style > .content > .rules .section-header .node-link {
     color: inherit;
 }
 
-.spreadsheet-style-panel .section-header .node-link:hover {
+.sidebar > .panel.details.css-style > .content > .rules .section-header .node-link:hover {
     color: black;
 }
 
+.sidebar > .panel.details.css-style > .content > .rules > .message-text-view {
+    top: var(--navigation-bar-height);
+}
+
+.sidebar > .panel.details.css-style > .content > .rules:not(.filter-non-matching) > .message-text-view {
+    display: none;
+}
+
 @media (prefers-dark-interface) {
-    .spreadsheet-style-panel .section-header {
+    .sidebar > .panel.details.css-style > .content > .rules .section-header {
         color: var(--text-color-secondary);
         border-bottom: 0.5px solid hsla(0, 0%, var(--background-color), 0.2);
     }
 
-    .spreadsheet-style-panel .section-header .node-link:hover {
+    .sidebar > .panel.details.css-style > .content > .rules .section-header .node-link:hover {
         color: var(--text-color);
     }
 }
index 6683613..3ab0918 100644 (file)
@@ -32,8 +32,6 @@ WI.SpreadsheetRulesStyleDetailsPanel = class SpreadsheetRulesStyleDetailsPanel e
         const label = WI.UIString("Styles \u2014 Rules");
         super(delegate, className, identifier, label);
 
-        this.element.classList.add("spreadsheet-style-panel");
-
         // Make the styles sidebar always left-to-right since CSS is strictly an LTR language.
         this.element.dir = "ltr";
 
index 38dfbb0..9e8ede8 100644 (file)
     <None Include="..\UserInterface\CSSProperty.js" />
     <None Include="..\UserInterface\CSSRule.js" />
     <None Include="..\UserInterface\CSSStyleDeclaration.js" />
-    <None Include="..\UserInterface\CSSStyleDeclarationSection.css" />
-    <None Include="..\UserInterface\CSSStyleDeclarationSection.js" />
-    <None Include="..\UserInterface\CSSStyleDeclarationTextEditor.css" />
-    <None Include="..\UserInterface\CSSStyleDeclarationTextEditor.js" />
-    <None Include="..\UserInterface\CSSStyleDetailsSidebarPanel.css" />
-    <None Include="..\UserInterface\CSSStyleDetailsSidebarPanel.js" />
     <None Include="..\UserInterface\CSSStyleManager.js" />
     <None Include="..\UserInterface\CSSStyleSheet.js" />
     <None Include="..\UserInterface\DashboardManager.js" />
     <None Include="..\UserInterface\ResourceTreeElement.css" />
     <None Include="..\UserInterface\ResourceTreeElement.js" />
     <None Include="..\UserInterface\Revision.js" />
-    <None Include="..\UserInterface\RulesStyleDetailsPanel.css" />
-    <None Include="..\UserInterface\RulesStyleDetailsPanel.js" />
     <None Include="..\UserInterface\RuntimeObserver.js" />
     <None Include="..\UserInterface\ScopeBar.css" />
     <None Include="..\UserInterface\ScopeBar.js" />
index c66a990..011e522 100644 (file)
     <None Include="..\UserInterface\CSSStyleDeclaration.js">
       <Filter>UserInterface</Filter>
     </None>
-    <None Include="..\UserInterface\CSSStyleDeclarationSection.css">
-      <Filter>UserInterface</Filter>
-    </None>
-    <None Include="..\UserInterface\CSSStyleDeclarationSection.js">
-      <Filter>UserInterface</Filter>
-    </None>
-    <None Include="..\UserInterface\CSSStyleDeclarationTextEditor.css">
-      <Filter>UserInterface</Filter>
-    </None>
-    <None Include="..\UserInterface\CSSStyleDeclarationTextEditor.js">
-      <Filter>UserInterface</Filter>
-    </None>
-    <None Include="..\UserInterface\CSSStyleDetailsSidebarPanel.css">
-      <Filter>UserInterface</Filter>
-    </None>
-    <None Include="..\UserInterface\CSSStyleDetailsSidebarPanel.js">
-      <Filter>UserInterface</Filter>
-    </None>
     <None Include="..\UserInterface\CSSStyleManager.js">
       <Filter>UserInterface</Filter>
     </None>
     <None Include="..\UserInterface\Revision.js">
       <Filter>UserInterface</Filter>
     </None>
-    <None Include="..\UserInterface\RulesStyleDetailsPanel.css">
-      <Filter>UserInterface</Filter>
-    </None>
-    <None Include="..\UserInterface\RulesStyleDetailsPanel.js">
-      <Filter>UserInterface</Filter>
-    </None>
     <None Include="..\UserInterface\RuntimeObserver.js">
       <Filter>UserInterface</Filter>
     </None>