Web Inspector: Graphics: should use the `id` (name) of the animation if it exists
authordrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 2 Jun 2020 01:12:01 +0000 (01:12 +0000)
committerdrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 2 Jun 2020 01:12:01 +0000 (01:12 +0000)
commit87db8d9903a81d7470533bc0f047c6755041aee1
tree9d58f0e13de78f8ca690f91491e0b79c13a7241c
parent61b4443141ebeede13f2220e0eb086c4b818cbce
Web Inspector: Graphics: should use the `id` (name) of the animation if it exists
https://bugs.webkit.org/show_bug.cgi?id=212618

Reviewed by Timothy Hatcher.

Source/JavaScriptCore:

* inspector/protocol/Animation.json:
 - added an optional `name` property to the `Animation.Animation` type
 - created a new `Animation.nameChanged` event

Source/WebCore:

Test: inspector/animation/lifecycle-css-animation.html:
      inspector/animation/lifecycle-css-transition.html:
      inspector/animation/lifecycle-web-animation.html:
      inspector/animation/nameChanged.html

* animation/WebAnimation.h:
(WebCore::WebAnimation::setId): Deleted.
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::setId): Added.

* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::didChangeWebAnimationName): Added.
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::didChangeWebAnimationNameImpl): Added.

* inspector/agents/InspectorAnimationAgent.h:
* inspector/agents/InspectorAnimationAgent.cpp:
(WebCore::InspectorAnimationAgent::didChangeWebAnimationName): Added.
(WebCore::InspectorAnimationAgent::bindAnimation):

Source/WebInspectorUI:

* UserInterface/Protocol/AnimationObserver.js:
(WI.AnimationObserver.prototype.nameChanged): Added.
* UserInterface/Controllers/AnimationManager.js:
(WI.AnimationManager.prototype.nameChanged): Added.

* UserInterface/Models/Animation.js:
(WI.Animation):
(WI.Animation.fromPayload):
(WI.Animation.prototype.get name): Added.
(WI.Animation.prototype.get cssAnimationName): Added.
(WI.Animation.prototype.get cssTransitionProperty): Added.
(WI.Animation.prototype.get displayName):
(WI.Animation.prototype.nameChanged): Added.

* UserInterface/Views/AnimationContentView.js:
(WI.AnimationContentView.prototype.initialLayout):
(WI.AnimationContentView.prototype.layout):
(WI.AnimationContentView.prototype.attached):
(WI.AnimationContentView.prototype.detached):
(WI.AnimationContentView.prototype._refreshTitle): Added.
(WI.AnimationContentView.prototype._handleNameChanged): Added.
* UserInterface/Views/AnimationContentView.css:
(.content-view.animation):
(.content-view.animation > header > .titles):
(.content-view.animation > header > .titles > .title > code): Added.
Show the `animation-name`/`transition-property`/count in parenthesis after the `id` (only if
it has been specified).
Drive-by: ensure that the `<header>` doesn't overflow.
* UserInterface/Views/AnimationDetailsSidebarPanel.js:
(WI.AnimationDetailsSidebarPanel.prototype.set animation):
(WI.AnimationDetailsSidebarPanel.prototype.initialLayout):
(WI.AnimationDetailsSidebarPanel.prototype._refreshIdentitySection):
(WI.AnimationDetailsSidebarPanel.prototype._handleAnimationNameChanged): Added.
Only show the "Identifier" row if an `id` is actually set. If there is a CSS
`animation-name`/`transition-property`, show it in a separate row.

* Localizations/en.lproj/localizedStrings.js:

LayoutTests:

* inspector/animation/nameChanged.html: Added.
* inspector/animation/nameChanged-expected.txt: Added.

* inspector/animation/resources/lifecycle-utilities.js:
* inspector/animation/lifecycle-css-animation-expected.txt:
* inspector/animation/lifecycle-css-transition-expected.txt:
* inspector/animation/lifecycle-web-animation.html:
* inspector/animation/lifecycle-web-animation-expected.txt:
Print out the name of the animation after it's created.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262404 268f45cc-cd09-0410-ab3c-d52691b4dbfc
25 files changed:
LayoutTests/ChangeLog
LayoutTests/inspector/animation/lifecycle-css-animation-expected.txt
LayoutTests/inspector/animation/lifecycle-css-transition-expected.txt
LayoutTests/inspector/animation/lifecycle-web-animation-expected.txt
LayoutTests/inspector/animation/lifecycle-web-animation.html
LayoutTests/inspector/animation/nameChanged-expected.txt [new file with mode: 0644]
LayoutTests/inspector/animation/nameChanged.html [new file with mode: 0644]
LayoutTests/inspector/animation/resources/lifecycle-utilities.js
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/inspector/protocol/Animation.json
Source/WebCore/ChangeLog
Source/WebCore/animation/WebAnimation.cpp
Source/WebCore/animation/WebAnimation.h
Source/WebCore/inspector/InspectorInstrumentation.cpp
Source/WebCore/inspector/InspectorInstrumentation.h
Source/WebCore/inspector/agents/InspectorAnimationAgent.cpp
Source/WebCore/inspector/agents/InspectorAnimationAgent.h
Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js
Source/WebInspectorUI/UserInterface/Controllers/AnimationManager.js
Source/WebInspectorUI/UserInterface/Models/Animation.js
Source/WebInspectorUI/UserInterface/Protocol/AnimationObserver.js
Source/WebInspectorUI/UserInterface/Views/AnimationContentView.css
Source/WebInspectorUI/UserInterface/Views/AnimationContentView.js
Source/WebInspectorUI/UserInterface/Views/AnimationDetailsSidebarPanel.js