[webkit-changes] [WebKit/WebKit] 552a34: Web Inspector: support OffscreenCanvas for Canvas ...

Kimmo Kinnunen noreply at github.com
Thu Mar 30 23:46:15 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 552a34376f9678e24c422e71dfdb3539bc9b096e
      https://github.com/WebKit/WebKit/commit/552a34376f9678e24c422e71dfdb3539bc9b096e
  Author: Kimmo Kinnunen <kkinnunen at apple.com>
  Date:   2023-03-30 (Thu, 30 Mar 2023)

  Changed paths:
    A LayoutTests/inspector/canvas/console-record-offscreen-canvas-2d-expected.txt
    A LayoutTests/inspector/canvas/console-record-offscreen-canvas-2d.html
    M LayoutTests/inspector/canvas/context-attributes-expected.txt
    M LayoutTests/inspector/canvas/context-attributes.html
    M LayoutTests/inspector/canvas/create-context-2d-expected.txt
    M LayoutTests/inspector/canvas/create-context-2d.html
    M LayoutTests/inspector/canvas/create-context-bitmaprenderer-expected.txt
    M LayoutTests/inspector/canvas/create-context-webgl-expected.txt
    M LayoutTests/inspector/canvas/create-context-webgl2-expected.txt
    A LayoutTests/inspector/canvas/recording-offscreen-canvas-2d-frameCount-expected.txt
    A LayoutTests/inspector/canvas/recording-offscreen-canvas-2d-frameCount.html
    A LayoutTests/inspector/canvas/recording-offscreen-canvas-2d-full-expected.txt
    A LayoutTests/inspector/canvas/recording-offscreen-canvas-2d-full.html
    A LayoutTests/inspector/canvas/recording-offscreen-canvas-2d-memoryLimit-expected.txt
    A LayoutTests/inspector/canvas/recording-offscreen-canvas-2d-memoryLimit.html
    A LayoutTests/inspector/canvas/recording-offscreen-canvas-2d-saves-expected.txt
    A LayoutTests/inspector/canvas/recording-offscreen-canvas-2d-saves.html
    M LayoutTests/inspector/canvas/requestClientNodes-expected.txt
    M LayoutTests/inspector/canvas/requestClientNodes.html
    M LayoutTests/inspector/canvas/requestContent-2d-expected.txt
    M LayoutTests/inspector/canvas/requestContent-2d.html
    M LayoutTests/inspector/canvas/resolveContext-2d-expected.txt
    M LayoutTests/inspector/canvas/resolveContext-2d.html
    M LayoutTests/inspector/canvas/resources/create-context-utilities.js
    M LayoutTests/inspector/canvas/resources/recording-2d.js
    M LayoutTests/platform/gtk/TestExpectations
    A LayoutTests/platform/gtk/inspector/canvas/context-attributes-expected.txt
    A LayoutTests/platform/gtk/inspector/canvas/requestClientNodes-expected.txt
    A LayoutTests/platform/gtk/inspector/canvas/requestContent-2d-expected.txt
    A LayoutTests/platform/gtk/inspector/canvas/resolveContext-2d-expected.txt
    M Source/JavaScriptCore/inspector/protocol/Canvas.json
    M Source/JavaScriptCore/inspector/protocol/Recording.json
    M Source/WebCore/html/OffscreenCanvas.cpp
    M Source/WebCore/html/OffscreenCanvas.idl
    M Source/WebCore/html/canvas/CanvasRenderingContext.h
    M Source/WebCore/html/canvas/CanvasRenderingContext2DBase.h
    M Source/WebCore/html/canvas/OffscreenCanvasRenderingContext2D.cpp
    M Source/WebCore/html/canvas/OffscreenCanvasRenderingContext2D.h
    M Source/WebCore/html/canvas/OffscreenCanvasRenderingContext2D.idl
    M Source/WebCore/inspector/InspectorCanvas.cpp
    M Source/WebCore/inspector/InspectorCanvas.h
    M Source/WebCore/inspector/InspectorCanvasCallTracer.cpp
    M Source/WebCore/inspector/InspectorCanvasCallTracer.h
    M Source/WebCore/inspector/agents/InspectorCanvasAgent.cpp
    M Source/WebCore/page/PageConsoleClient.cpp
    M Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js
    M Source/WebInspectorUI/UserInterface/Models/Canvas.js
    M Source/WebInspectorUI/UserInterface/Models/Recording.js
    M Source/WebInspectorUI/UserInterface/Models/RecordingAction.js
    M Source/WebInspectorUI/UserInterface/Models/RecordingState.js
    M Source/WebInspectorUI/UserInterface/Views/CanvasContentView.js
    M Source/WebInspectorUI/UserInterface/Views/CanvasSidebarPanel.js
    M Source/WebInspectorUI/UserInterface/Views/RecordingContentView.js
    M Source/WebInspectorUI/UserInterface/Views/RecordingStateDetailsSidebarPanel.js

  Log Message:
  -----------
  Web Inspector: support OffscreenCanvas for Canvas related operations
https://bugs.webkit.org/show_bug.cgi?id=180833
rdar://36059660

Reviewed by Devin Rousso.

Implement Inspector support for OffscreenCanvas
OffscreenCanvasRenderingContext2D for main page (not workers).
Later commits may add support for workers.

Fixes assertion failures when bringing up Inspector for pages
that use OffscreenCanvas.

* LayoutTests/inspector/canvas/console-record-offscreen-canvas-2d-expected.txt: Added.
* LayoutTests/inspector/canvas/console-record-offscreen-canvas-2d.html: Added.
* LayoutTests/inspector/canvas/context-attributes-expected.txt:
* LayoutTests/inspector/canvas/context-attributes.html:
* LayoutTests/inspector/canvas/create-context-2d-expected.txt:
* LayoutTests/inspector/canvas/create-context-2d.html:
* LayoutTests/inspector/canvas/recording-offscreen-canvas-2d-frameCount-expected.txt: Added.
* LayoutTests/inspector/canvas/recording-offscreen-canvas-2d-frameCount.html: Added.
* LayoutTests/inspector/canvas/recording-offscreen-canvas-2d-full-expected.txt: Added.
* LayoutTests/inspector/canvas/recording-offscreen-canvas-2d-full.html: Added.
* LayoutTests/inspector/canvas/recording-offscreen-canvas-2d-memoryLimit-expected.txt: Added.
* LayoutTests/inspector/canvas/recording-offscreen-canvas-2d-memoryLimit.html: Added.
* LayoutTests/inspector/canvas/recording-offscreen-canvas-2d-saves-expected.txt: Added.
* LayoutTests/inspector/canvas/recording-offscreen-canvas-2d-saves.html: Added.
* LayoutTests/inspector/canvas/requestClientNodes-expected.txt:
* LayoutTests/inspector/canvas/requestClientNodes.html:
* LayoutTests/inspector/canvas/requestContent-2d-expected.txt:
* LayoutTests/inspector/canvas/requestContent-2d.html:
* LayoutTests/inspector/canvas/resolveContext-2d-expected.txt:
* LayoutTests/inspector/canvas/resolveContext-2d.html:
* LayoutTests/inspector/canvas/resources/create-context-utilities.js:

Add new tests for test runner .html files for tests that use recording-2d.js.
The current test driver logic is a bit too convoluted to run these tests in
the same .html runner as non-offscreen variants. Later commits can refactor
the tests if needed.

For other tests, add the tests in the respective -2d.html file.

(createDetachedCanvas):
(createCSSCanvas):
(createOffscreenCanvas):
(destroyCanvases):
* LayoutTests/inspector/canvas/resources/recording-2d.js:
(async load):
(ignoreException): Deleted.
(cancelActions): Deleted.
(performActions.executeFrameFunction): Deleted.
(performActions): Deleted.
(performConsoleActions): Deleted.
(performSavePreActions.saveAndSet): Deleted.
(performSavePreActions): Deleted.
(performSavePostActions): Deleted.
* Source/JavaScriptCore/inspector/protocol/Canvas.json:
* Source/JavaScriptCore/inspector/protocol/Recording.json:
* Source/WebCore/html/OffscreenCanvas.cpp:
(WebCore::OffscreenCanvas::getContext):
* Source/WebCore/html/OffscreenCanvas.idl:
* Source/WebCore/html/canvas/CanvasRenderingContext.h:
(WebCore::CanvasRenderingContext::is2dBase const):
* Source/WebCore/html/canvas/CanvasRenderingContext2DBase.h:
* Source/WebCore/html/canvas/OffscreenCanvasRenderingContext2D.cpp:
(WebCore::OffscreenCanvasRenderingContext2D::create):
* Source/WebCore/html/canvas/OffscreenCanvasRenderingContext2D.h:
* Source/WebCore/html/canvas/OffscreenCanvasRenderingContext2D.idl:
* Source/WebCore/inspector/InspectorCanvas.cpp:
(WebCore::InspectorCanvas::resolveContext const):
(WebCore::InspectorCanvas::canvasChanged):
(WebCore::buildObjectForCanvasContextAttributes):
(WebCore::InspectorCanvas::buildObjectForCanvas):
(WebCore::InspectorCanvas::releaseObjectForRecording):
(WebCore::InspectorCanvas::getContentAsDataURL):
(WebCore::InspectorCanvas::appendActionSnapshotIfNeeded):
(WebCore::InspectorCanvas::buildInitialState):
(WebCore::InspectorCanvas::getCanvasContentAsDataURL): Deleted.
* Source/WebCore/inspector/InspectorCanvas.h:
* Source/WebCore/inspector/InspectorCanvasCallTracer.cpp:
(WebCore::InspectorCanvasCallTracer::processArgument):
(WebCore::InspectorCanvasCallTracer::recordAction):
* Source/WebCore/inspector/InspectorCanvasCallTracer.h:
(WebCore::InspectorCanvasCallTracer::recordAction):
* Source/WebCore/inspector/agents/InspectorCanvasAgent.cpp:
(WebCore::InspectorCanvasAgent::enable):
(WebCore::InspectorCanvasAgent::requestContent):
(WebCore::InspectorCanvasAgent::didChangeCanvasMemory):
(WebCore::InspectorCanvasAgent::startRecording):
* Source/WebCore/page/PageConsoleClient.cpp:
(WebCore::canvasRenderingContext):
(WebCore::PageConsoleClient::screenshot):
(WebCore::snapshotCanvas): Deleted.
* Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js:
* Source/WebInspectorUI/UserInterface/Models/Canvas.js:
(WI.Canvas.fromPayload):
(WI.Canvas.displayNameForContextType):
* Source/WebInspectorUI/UserInterface/Models/Recording.js:
(WI.Recording.fromPayload):
(WI.Recording.displayNameForRecordingType):
(WI.Recording.prototype.createContext):
(WI.Recording.prototype.async _process):
(WI.Recording):
* Source/WebInspectorUI/UserInterface/Models/RecordingAction.js:
(WI.RecordingAction._prototypeForType):
(WI.RecordingAction.prototype.process):
(WI.RecordingAction.prototype.async swizzle):
* Source/WebInspectorUI/UserInterface/Models/RecordingState.js:
(WI.RecordingState.prototype.fromContext):
(WI.RecordingState.async swizzleInitialState):
* Source/WebInspectorUI/UserInterface/Views/CanvasContentView.js:
(WI.CanvasContentView.prototype.initialLayout):
* Source/WebInspectorUI/UserInterface/Views/CanvasSidebarPanel.js:
(WI.CanvasSidebarPanel.prototype._canvasChanged):
(WI.CanvasSidebarPanel.prototype._updateRecordNavigationItem):
* Source/WebInspectorUI/UserInterface/Views/RecordingContentView.js:
(WI.RecordingContentView):
(WI.RecordingContentView.prototype.get navigationItems):
(WI.RecordingContentView.prototype.attached):
(WI.RecordingContentView.prototype._export):
(WI.RecordingContentView.prototype._updateExportButton):
(WI.RecordingContentView.prototype._handleExportNavigationItemClicked):
* Source/WebInspectorUI/UserInterface/Views/RecordingStateDetailsSidebarPanel.js:
(WI.RecordingStateDetailsSidebarPanel.prototype.inspect):
(WI.RecordingStateDetailsSidebarPanel.prototype.set action):

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




More information about the webkit-changes mailing list