Skip to content

Web Inspector: give WI.CubicBezier a better name and move it to its own file - #16088

Merged
webkit-commit-queue merged 1 commit into
WebKit:mainfrom
dcrousso:eng/259501
Jul 26, 2023
Merged

webkit-commit-queue merged 1 commit into
WebKit:mainfrom
dcrousso:eng/259501

Conversation

@dcrousso

@dcrousso dcrousso commented Jul 25, 2023 •

Copy link
Copy Markdown
Member

569beda

Web Inspector: give `WI.CubicBezier` a better name and move it to its own file
https://bugs.webkit.org/show_bug.cgi?id=259501

Reviewed by Timothy Hatcher.

`WI.CubicBezier` should really be named `WI.CubicBezierTimingFunction` to convey it's true purpose.

It also shouldn't really be in `Source/WebInspectorUI/UserInterface/Models/Geometry.js` since it has nothing to do with geometry.

* Source/WebInspectorUI/UserInterface/Models/CubicBezierTimingFunction.js: Added.
(WI.CubicBezierTimingFunction):
(WI.CubicBezierTimingFunction.fromCoordinates):
(WI.CubicBezierTimingFunction.fromString):
(WI.CubicBezierTimingFunction.prototype.get inPoint):
(WI.CubicBezierTimingFunction.prototype.get outPoint):
(WI.CubicBezierTimingFunction.prototype.copy):
(WI.CubicBezierTimingFunction.prototype.toString):
(WI.CubicBezierTimingFunction.prototype.solve):
(WI.CubicBezierTimingFunction.prototype._sampleCurveX):
(WI.CubicBezierTimingFunction.prototype._sampleCurveY):
(WI.CubicBezierTimingFunction.prototype._sampleCurveDerivativeX):
(WI.CubicBezierTimingFunction.prototype._solveCurveX):
* Source/WebInspectorUI/UserInterface/Models/Geometry.js:
(WI.CubicBezier): Deleted.
(WI.CubicBezier.fromCoordinates): Deleted.
(WI.CubicBezier.fromString): Deleted.
(WI.CubicBezier.prototype.get inPoint): Deleted.
(WI.CubicBezier.prototype.get outPoint): Deleted.
(WI.CubicBezier.prototype.copy): Deleted.
(WI.CubicBezier.prototype.toString): Deleted.
(WI.CubicBezier.prototype.solve): Deleted.
(WI.CubicBezier.prototype._sampleCurveX): Deleted.
(WI.CubicBezier.prototype._sampleCurveY): Deleted.
(WI.CubicBezier.prototype._sampleCurveDerivativeX): Deleted.
(WI.CubicBezier.prototype._solveCurveX): Deleted.
* Source/WebInspectorUI/UserInterface/Models/Animation.js:
(WI.Animation.prototype._updateEffect):
* Source/WebInspectorUI/UserInterface/Views/AnimationContentView.js:
(WI.AnimationContentView.prototype._refreshPreview):
* Source/WebInspectorUI/UserInterface/Views/AnimationDetailsSidebarPanel.js:
(WI.AnimationDetailsSidebarPanel.prototype._refreshEffectSection):
* Source/WebInspectorUI/UserInterface/Views/Popover.js:
(WI.Popover.prototype._animateFrame):
* Source/WebInspectorUI/UserInterface/Views/SpreadsheetStyleProperty.js:
(WI.SpreadsheetStyleProperty.prototype._addTimingFunctionTokens):

* Source/WebInspectorUI/UserInterface/Views/CubicBezierTimingFunctionEditor.js: Renamed from Source/WebInspectorUI/UserInterface/Views/BezierEditor.js.
(WI.CubicBezierTimingFunctionEditor):
(WI.CubicBezierTimingFunctionEditor.createControl):
(WI.CubicBezierTimingFunctionEditor.createCoordinateInput):
(WI.CubicBezierTimingFunctionEditor.prototype.get element):
(WI.CubicBezierTimingFunctionEditor.prototype.set cubicBezierTimingFunction):
(WI.CubicBezierTimingFunctionEditor.prototype.get cubicBezierTimingFunction):
(WI.CubicBezierTimingFunctionEditor.prototype.removeListeners):
(WI.CubicBezierTimingFunctionEditor.prototype.handleEvent):
(WI.CubicBezierTimingFunctionEditor.prototype.handleKeydownEvent):
(WI.CubicBezierTimingFunctionEditor.prototype._handleMousedown):
(WI.CubicBezierTimingFunctionEditor.prototype._handleMousemove):
(WI.CubicBezierTimingFunctionEditor.prototype._handleMouseup):
(WI.CubicBezierTimingFunctionEditor.prototype._updateControlPointsForMouseEvent):
(WI.CubicBezierTimingFunctionEditor.prototype._updateCubicBezierTimingFunction.round):
(WI.CubicBezierTimingFunctionEditor.prototype._updateCubicBezierTimingFunction):
(WI.CubicBezierTimingFunctionEditor.prototype._updateCoordinateInputs):
(WI.CubicBezierTimingFunctionEditor.prototype._updateControl):
(WI.CubicBezierTimingFunctionEditor.prototype._updatePreview):
(WI.CubicBezierTimingFunctionEditor.prototype._triggerPreviewAnimation):
(WI.CubicBezierTimingFunctionEditor.prototype._resetPreviewAnimation):
(WI.CubicBezierTimingFunctionEditor.prototype._handleNumberInputInput):
(WI.CubicBezierTimingFunctionEditor.prototype._handleNumberInputKeydown):
(WI.CubicBezierTimingFunctionEditor.prototype._changeCoordinateForInput):
* Source/WebInspectorUI/UserInterface/Views/CubicBezierTimingFunctionEditor.css: Renamed from Source/WebInspectorUI/UserInterface/Views/BezierEditor.css.
(.cubic-bezier-timing-function-editor):
(.cubic-bezier-timing-function-editor > .preview):
(.cubic-bezier-timing-function-editor > .preview > div):
(.cubic-bezier-timing-function-editor > .timing):
(.cubic-bezier-timing-function-editor > .preview.animate > div, .cubic-bezier-timing-function-editor > .timing.animate):
(@keyframes CubicBezierTimingFunctionPreview):
(.cubic-bezier-timing-function-editor > .curve):
(.cubic-bezier-timing-function-editor > .curve .linear):
(.cubic-bezier-timing-function-editor > .curve .cubic-bezier):
(.cubic-bezier-timing-function-editor > .curve .control-line):
(.cubic-bezier-timing-function-editor > .curve .control-handle):
(.cubic-bezier-timing-function-editor > .curve .control-handle.selected):
(.cubic-bezier-timing-function-editor > .number-input-container):
(.cubic-bezier-timing-function-editor > .number-input-container > input):
* Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorCubicBezierTimingFunctionEditingController.js: Renamed from Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorBezierEditingController.js.
(WI.CodeMirrorCubicBezierTimingFunctionEditingController.prototype.get initialValue):
(WI.CodeMirrorCubicBezierTimingFunctionEditingController.prototype.get cssClassName):
(WI.CodeMirrorCubicBezierTimingFunctionEditingController.prototype.popoverWillPresent):
(WI.CodeMirrorCubicBezierTimingFunctionEditingController.prototype.popoverDidPresent):
(WI.CodeMirrorCubicBezierTimingFunctionEditingController.prototype.popoverDidDismiss):
(WI.CodeMirrorCubicBezierTimingFunctionEditingController.prototype._handleCubicBezierTimingFunctionEditorCubicBezierTimingFunctionChanged):
Also rename `WI.BezierEditor` to `WI.CubicBezierTimingFunctionEditor`.

* Source/WebInspectorUI/UserInterface/Views/InlineSwatch.js:
(WI.InlineSwatch):
(WI.InlineSwatch.prototype.didDismissPopover):
(WI.InlineSwatch.prototype._fallbackValue):
(WI.InlineSwatch.prototype._swatchElementClicked):
(WI.InlineSwatch.prototype._valueEditorValueDidChange):
* Source/WebInspectorUI/UserInterface/Views/InlineSwatch.css:
(.inline-swatch:is(.cubic-bezier-timing-function, .spring, .variable)): Renamed from `.inline-swatch:is(.bezier, .spring, .variable)`.
(.inline-swatch:is(.cubic-bezier-timing-function, .box-shadow, .spring, .variable)): Renamed from `.inline-swatch:is(.bezier, .box-shadow, .spring, .variable)`.
(.inline-swatch:not(.read-only):is(.cubic-bezier-timing-function, .box-shadow, .spring, .variable, .alignment):hover): Renamed from `.inline-swatch:not(.read-only):is(.bezier, .box-shadow, .spring, .variable, .alignment):hover`.
(.inline-swatch:not(.read-only):is(.cubic-bezier-timing-function, .box-shadow, .spring, .variable, .alignment):active): Renamed from `.inline-swatch:not(.read-only):is(.bezier, .box-shadow, .spring, .variable, .alignment):active`.
(.inline-swatch:is(.cubic-bezier-timing-function, .box-shadow, .spring, .variable) > span): Renamed from `.inline-swatch:is(.bezier, .box-shadow, .spring, .variable) > span`.
Also rename `WI.InlineSwatch.Type.Bezier` to `WI.InlineSwatch.Type.CubicBezierTimingFunction`.

* Source/WebInspectorUI/UserInterface/Models/TextMarker.js:
* Source/WebInspectorUI/UserInterface/Views/CodeMirrorTextMarkers.js:
(createCodeMirrorCubicBezierTimingFunctionTextMarkers): Renamed from `createCodeMirrorBezierTextMarkers`.
* Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js:
(WI.SourceCodeTextEditor.prototype._updateEditableMarkers):
* Source/WebInspectorUI/UserInterface/Views/TextEditor.js:
(WI.TextEditor.prototype.createCubicBezierTimingFunctionMarkers): Renamed from `createCubicBezierMarkers`.
(WI.TextEditor.prototype.editingControllerForMarker):
Also rename `WI.TextMarker.Type.Bezier` to `WI.TextMarker.Type.CubicBezierTimingFunction`.

* Source/WebInspectorUI/UserInterface/Main.html:
* Source/WebInspectorUI/UserInterface/Test.html:
* Source/WebInspectorUI/.eslintrc:

* LayoutTests/inspector/animation/resources/lifecycle-utilities.js:
* LayoutTests/inspector/unit-tests/cubic-bezier-timing-function.html: Added.
* LayoutTests/inspector/unit-tests/cubic-bezier-timing-function-expected.txt: Added.
* LayoutTests/inspector/unit-tests/geometry.html:
* LayoutTests/inspector/unit-tests/geometry-expected.txt:

Canonical link: https://commits.webkit.org/266329@main

4f294f4

Misc iOS, tvOS & watchOS macOS Linux Windows
✅ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe   🛠 wincairo
✅ 🛠 ios-sim ✅ 🛠 mac-AS-debug ✅ 🧪 wpe-wk2
✅ 🧪 webkitperl ✅ 🧪 ios-wk2 ✅ 🧪 api-mac ✅ 🛠 gtk
✅ 🧪 ios-wk2-wpt ✅ 🧪 mac-wk1   🧪 gtk-wk2
✅ 🧪 api-ios ✅ 🧪 mac-wk2 ✅ 🧪 api-gtk
✅ 🛠 tv ✅ 🧪 mac-AS-debug-wk2
✅ 🛠 tv-sim ✅ 🧪 mac-wk2-stress
✅ 🛠 🧪 merge ✅ 🛠 watch
✅ 🛠 watch-sim

@dcrousso
dcrousso requested a review from patrickangle as a code owner July 25, 2023 23:57
@dcrousso dcrousso self-assigned this Jul 25, 2023
@dcrousso dcrousso added the Web Inspector Bugs related to the WebKit Web Inspector. label Jul 25, 2023
@webkit-early-warning-system

webkit-early-warning-system commented Jul 25, 2023 •

Copy link
Copy Markdown
Collaborator

@nt1m
nt1m requested a review from rcaliman-apple July 26, 2023 14:55

@rcaliman-apple rcaliman-apple left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me aside from the typo fix needed in the getter for cubicBezierTimingFunction. Pinging @patrickangle for review / approval.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this needs to be return this._cubicBezierTimingFunction not return this._.
Probably a search-and-replace spill-over from changing the concatenation in createCoordinateInput().

@dcrousso dcrousso added the merge-queue Applied to send a pull request to merge-queue label Jul 26, 2023
… own file

https://bugs.webkit.org/show_bug.cgi?id=259501

Reviewed by Timothy Hatcher.

`WI.CubicBezier` should really be named `WI.CubicBezierTimingFunction` to convey it's true purpose.

It also shouldn't really be in `Source/WebInspectorUI/UserInterface/Models/Geometry.js` since it has nothing to do with geometry.

* Source/WebInspectorUI/UserInterface/Models/CubicBezierTimingFunction.js: Added.
(WI.CubicBezierTimingFunction):
(WI.CubicBezierTimingFunction.fromCoordinates):
(WI.CubicBezierTimingFunction.fromString):
(WI.CubicBezierTimingFunction.prototype.get inPoint):
(WI.CubicBezierTimingFunction.prototype.get outPoint):
(WI.CubicBezierTimingFunction.prototype.copy):
(WI.CubicBezierTimingFunction.prototype.toString):
(WI.CubicBezierTimingFunction.prototype.solve):
(WI.CubicBezierTimingFunction.prototype._sampleCurveX):
(WI.CubicBezierTimingFunction.prototype._sampleCurveY):
(WI.CubicBezierTimingFunction.prototype._sampleCurveDerivativeX):
(WI.CubicBezierTimingFunction.prototype._solveCurveX):
* Source/WebInspectorUI/UserInterface/Models/Geometry.js:
(WI.CubicBezier): Deleted.
(WI.CubicBezier.fromCoordinates): Deleted.
(WI.CubicBezier.fromString): Deleted.
(WI.CubicBezier.prototype.get inPoint): Deleted.
(WI.CubicBezier.prototype.get outPoint): Deleted.
(WI.CubicBezier.prototype.copy): Deleted.
(WI.CubicBezier.prototype.toString): Deleted.
(WI.CubicBezier.prototype.solve): Deleted.
(WI.CubicBezier.prototype._sampleCurveX): Deleted.
(WI.CubicBezier.prototype._sampleCurveY): Deleted.
(WI.CubicBezier.prototype._sampleCurveDerivativeX): Deleted.
(WI.CubicBezier.prototype._solveCurveX): Deleted.
* Source/WebInspectorUI/UserInterface/Models/Animation.js:
(WI.Animation.prototype._updateEffect):
* Source/WebInspectorUI/UserInterface/Views/AnimationContentView.js:
(WI.AnimationContentView.prototype._refreshPreview):
* Source/WebInspectorUI/UserInterface/Views/AnimationDetailsSidebarPanel.js:
(WI.AnimationDetailsSidebarPanel.prototype._refreshEffectSection):
* Source/WebInspectorUI/UserInterface/Views/Popover.js:
(WI.Popover.prototype._animateFrame):
* Source/WebInspectorUI/UserInterface/Views/SpreadsheetStyleProperty.js:
(WI.SpreadsheetStyleProperty.prototype._addTimingFunctionTokens):

* Source/WebInspectorUI/UserInterface/Views/CubicBezierTimingFunctionEditor.js: Renamed from Source/WebInspectorUI/UserInterface/Views/BezierEditor.js.
(WI.CubicBezierTimingFunctionEditor):
(WI.CubicBezierTimingFunctionEditor.createControl):
(WI.CubicBezierTimingFunctionEditor.createCoordinateInput):
(WI.CubicBezierTimingFunctionEditor.prototype.get element):
(WI.CubicBezierTimingFunctionEditor.prototype.set cubicBezierTimingFunction):
(WI.CubicBezierTimingFunctionEditor.prototype.get cubicBezierTimingFunction):
(WI.CubicBezierTimingFunctionEditor.prototype.removeListeners):
(WI.CubicBezierTimingFunctionEditor.prototype.handleEvent):
(WI.CubicBezierTimingFunctionEditor.prototype.handleKeydownEvent):
(WI.CubicBezierTimingFunctionEditor.prototype._handleMousedown):
(WI.CubicBezierTimingFunctionEditor.prototype._handleMousemove):
(WI.CubicBezierTimingFunctionEditor.prototype._handleMouseup):
(WI.CubicBezierTimingFunctionEditor.prototype._updateControlPointsForMouseEvent):
(WI.CubicBezierTimingFunctionEditor.prototype._updateCubicBezierTimingFunction.round):
(WI.CubicBezierTimingFunctionEditor.prototype._updateCubicBezierTimingFunction):
(WI.CubicBezierTimingFunctionEditor.prototype._updateCoordinateInputs):
(WI.CubicBezierTimingFunctionEditor.prototype._updateControl):
(WI.CubicBezierTimingFunctionEditor.prototype._updatePreview):
(WI.CubicBezierTimingFunctionEditor.prototype._triggerPreviewAnimation):
(WI.CubicBezierTimingFunctionEditor.prototype._resetPreviewAnimation):
(WI.CubicBezierTimingFunctionEditor.prototype._handleNumberInputInput):
(WI.CubicBezierTimingFunctionEditor.prototype._handleNumberInputKeydown):
(WI.CubicBezierTimingFunctionEditor.prototype._changeCoordinateForInput):
* Source/WebInspectorUI/UserInterface/Views/CubicBezierTimingFunctionEditor.css: Renamed from Source/WebInspectorUI/UserInterface/Views/BezierEditor.css.
(.cubic-bezier-timing-function-editor):
(.cubic-bezier-timing-function-editor > .preview):
(.cubic-bezier-timing-function-editor > .preview > div):
(.cubic-bezier-timing-function-editor > .timing):
(.cubic-bezier-timing-function-editor > .preview.animate > div, .cubic-bezier-timing-function-editor > .timing.animate):
(@Keyframes CubicBezierTimingFunctionPreview):
(.cubic-bezier-timing-function-editor > .curve):
(.cubic-bezier-timing-function-editor > .curve .linear):
(.cubic-bezier-timing-function-editor > .curve .cubic-bezier):
(.cubic-bezier-timing-function-editor > .curve .control-line):
(.cubic-bezier-timing-function-editor > .curve .control-handle):
(.cubic-bezier-timing-function-editor > .curve .control-handle.selected):
(.cubic-bezier-timing-function-editor > .number-input-container):
(.cubic-bezier-timing-function-editor > .number-input-container > input):
* Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorCubicBezierTimingFunctionEditingController.js: Renamed from Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorBezierEditingController.js.
(WI.CodeMirrorCubicBezierTimingFunctionEditingController.prototype.get initialValue):
(WI.CodeMirrorCubicBezierTimingFunctionEditingController.prototype.get cssClassName):
(WI.CodeMirrorCubicBezierTimingFunctionEditingController.prototype.popoverWillPresent):
(WI.CodeMirrorCubicBezierTimingFunctionEditingController.prototype.popoverDidPresent):
(WI.CodeMirrorCubicBezierTimingFunctionEditingController.prototype.popoverDidDismiss):
(WI.CodeMirrorCubicBezierTimingFunctionEditingController.prototype._handleCubicBezierTimingFunctionEditorCubicBezierTimingFunctionChanged):
Also rename `WI.BezierEditor` to `WI.CubicBezierTimingFunctionEditor`.

* Source/WebInspectorUI/UserInterface/Views/InlineSwatch.js:
(WI.InlineSwatch):
(WI.InlineSwatch.prototype.didDismissPopover):
(WI.InlineSwatch.prototype._fallbackValue):
(WI.InlineSwatch.prototype._swatchElementClicked):
(WI.InlineSwatch.prototype._valueEditorValueDidChange):
* Source/WebInspectorUI/UserInterface/Views/InlineSwatch.css:
(.inline-swatch:is(.cubic-bezier-timing-function, .spring, .variable)): Renamed from `.inline-swatch:is(.bezier, .spring, .variable)`.
(.inline-swatch:is(.cubic-bezier-timing-function, .box-shadow, .spring, .variable)): Renamed from `.inline-swatch:is(.bezier, .box-shadow, .spring, .variable)`.
(.inline-swatch:not(.read-only):is(.cubic-bezier-timing-function, .box-shadow, .spring, .variable, .alignment):hover): Renamed from `.inline-swatch:not(.read-only):is(.bezier, .box-shadow, .spring, .variable, .alignment):hover`.
(.inline-swatch:not(.read-only):is(.cubic-bezier-timing-function, .box-shadow, .spring, .variable, .alignment):active): Renamed from `.inline-swatch:not(.read-only):is(.bezier, .box-shadow, .spring, .variable, .alignment):active`.
(.inline-swatch:is(.cubic-bezier-timing-function, .box-shadow, .spring, .variable) > span): Renamed from `.inline-swatch:is(.bezier, .box-shadow, .spring, .variable) > span`.
Also rename `WI.InlineSwatch.Type.Bezier` to `WI.InlineSwatch.Type.CubicBezierTimingFunction`.

* Source/WebInspectorUI/UserInterface/Models/TextMarker.js:
* Source/WebInspectorUI/UserInterface/Views/CodeMirrorTextMarkers.js:
(createCodeMirrorCubicBezierTimingFunctionTextMarkers): Renamed from `createCodeMirrorBezierTextMarkers`.
* Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js:
(WI.SourceCodeTextEditor.prototype._updateEditableMarkers):
* Source/WebInspectorUI/UserInterface/Views/TextEditor.js:
(WI.TextEditor.prototype.createCubicBezierTimingFunctionMarkers): Renamed from `createCubicBezierMarkers`.
(WI.TextEditor.prototype.editingControllerForMarker):
Also rename `WI.TextMarker.Type.Bezier` to `WI.TextMarker.Type.CubicBezierTimingFunction`.

* Source/WebInspectorUI/UserInterface/Main.html:
* Source/WebInspectorUI/UserInterface/Test.html:
* Source/WebInspectorUI/.eslintrc:

* LayoutTests/inspector/animation/resources/lifecycle-utilities.js:
* LayoutTests/inspector/unit-tests/cubic-bezier-timing-function.html: Added.
* LayoutTests/inspector/unit-tests/cubic-bezier-timing-function-expected.txt: Added.
* LayoutTests/inspector/unit-tests/geometry.html:
* LayoutTests/inspector/unit-tests/geometry-expected.txt:

Canonical link: https://commits.webkit.org/266329@main
@webkit-commit-queue

Copy link
Copy Markdown
Collaborator

Committed 266329@main (569beda): https://commits.webkit.org/266329@main

Reviewed commits have been landed. Closing PR #16088 and removing active labels.

@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Jul 26, 2023
@webkit-commit-queue
webkit-commit-queue merged commit 569beda into WebKit:main Jul 26, 2023
@dcrousso
dcrousso deleted the eng/259501 branch July 26, 2023 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Web Inspector Bugs related to the WebKit Web Inspector.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants