Web Inspector: Preview Canvas path when viewing a recording
authordrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 7 Aug 2017 23:55:36 +0000 (23:55 +0000)
committerdrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 7 Aug 2017 23:55:36 +0000 (23:55 +0000)
https://bugs.webkit.org/show_bug.cgi?id=174967

Reviewed by Brian Burg.

Source/WebCore:

Tests: fast/canvas/2d.currentPoint.html
       fast/canvas/2d.getPath.modification.html
       fast/canvas/2d.getPath.newobject.html
       fast/canvas/2d.setPath.html

* html/canvas/CanvasPath.idl:
* html/canvas/CanvasPath.h:
* html/canvas/CanvasPath.cpp:
(WebCore::CanvasPath::currentX const):
(WebCore::CanvasPath::currentY const):

* html/canvas/CanvasRenderingContext2D.idl:
* html/canvas/CanvasRenderingContext2D.h:
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::setPath):
(WebCore::CanvasRenderingContext2D::getPath const):

* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setInspectorAdditionsEnabled):
(WebCore::RuntimeEnabledFeatures::inspectorAdditionsEnabled const):
Add runtime flag for added IDL items above so that they are only usable within the inspector
process. The runtime flag is not enabled from anywhere else as of now.

* inspector/InspectorCanvas.cpp:
(WebCore::InspectorCanvas::buildInitialState):
Send current path as part of the InitialState.
Drive-by: deduplicate more string values.
Source/WebInspectorUI:

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Base/Setting.js:

* UserInterface/Views/RecordingContentView.js:
(WI.RecordingContentView):
(WI.RecordingContentView.supportsCanvasPathDebugging):
(WI.RecordingContentView.prototype.get navigationItems):
(WI.RecordingContentView.prototype.shown):
(WI.RecordingContentView.prototype._generateContentCanvas2D):
(WI.RecordingContentView.prototype._actionModifiesPath):
(WI.RecordingContentView.prototype._updateCanvasPath):
(WI.RecordingContentView.prototype._showPathButtonClicked):
Show each segment of the current path as an overlay when the setting is enabled.
Drive-by: fix forgotten function rename.
* UserInterface/Views/RecordingContentView.css:
(.content-view:not(.tab).recording canvas.path):

* UserInterface/Views/RecordingStateDetailsSidebarPanel.js:
(WI.RecordingStateDetailsSidebarPanel.prototype._generateDetailsCanvas2D):
Show the currentX/currentY in the current state.

* UserInterface/Models/RecordingAction.js:
(WI.RecordingAction.isFunctionForType):
(WI.RecordingAction.prototype.swizzle):
Use Sets for better performance.

Source/WebKit:

* Shared/WebPreferencesDefinitions.h:
* UIProcess/API/C/WKPreferencesRefPrivate.h:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetInspectorAdditionsEnabled):
(WKPreferencesGetInspectorAdditionsEnabled):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):
Add plumbing for new InspectorAdditions runtime flag.

* WebProcess/WebPage/WebInspectorUI.cpp:
(WebKit::WebInspectorUI::WebInspectorUI):
Enable InspectorAdditions by default in the WebInspector page.

Source/WebKitLegacy/mac:

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences inspectorAdditionsEnabled]):
(-[WebPreferences setInspectorAdditionsEnabled:]):
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):
Add plumbing for new InspectorAdditions runtime flag.

Tools:

* DumpRenderTree/TestOptions.h:
* DumpRenderTree/TestOptions.mm:
(TestOptions::TestOptions):
* DumpRenderTree/mac/DumpRenderTree.mm:
(setWebPreferencesForTestOptions):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetPreferencesToConsistentValues):
(WTR::updateTestOptionsFromTestHeader):
* WebKitTestRunner/TestOptions.h:
(WTR::TestOptions::hasSameInitializationOptions const):
Add plumbing for new InspectorAdditions runtime flag.

LayoutTests:

* fast/canvas/2d.currentPoint-expected.txt: Added.
* fast/canvas/2d.currentPoint.html: Added.
* fast/canvas/2d.getPath.modification-expected.txt: Added.
* fast/canvas/2d.getPath.modification.html: Added.
* fast/canvas/2d.getPath.newobject-expected.txt: Added.
* fast/canvas/2d.getPath.newobject.html: Added.
* fast/canvas/2d.setPath-expected.txt: Added.
* fast/canvas/2d.setPath.html: Added.

* inspector/canvas/recording-2d-expected.txt:
* inspector/canvas/recording-2d.html:
Updated for additional deduplication in InitialState.

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


No differences found