Changeset 280084 in webkit
- Timestamp:
- Jul 20, 2021, 10:07:58 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 20 added
- 4 deleted
- 8 edited
- 1 moved
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/the-offscreen-canvas/2d-getcontext-options.any-expected.txt (added)
-
LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/the-offscreen-canvas/2d-getcontext-options.any.html (added)
-
LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/the-offscreen-canvas/2d-getcontext-options.any.js (added)
-
LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/the-offscreen-canvas/2d-getcontext-options.any.worker-expected.txt (added)
-
LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/the-offscreen-canvas/2d-getcontext-options.any.worker.html (added)
-
LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.extraargs-expected.txt (deleted)
-
LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.extraargs.cache-expected.txt (added)
-
LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.extraargs.cache.html (added)
-
LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.extraargs.cache.worker-expected.txt (added)
-
LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.extraargs.cache.worker.html (added)
-
LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.extraargs.cache.worker.js (added)
-
LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.extraargs.create-expected.txt (added)
-
LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.extraargs.create.html (added)
-
LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.extraargs.create.worker-expected.txt (added)
-
LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.extraargs.create.worker.html (added)
-
LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.extraargs.create.worker.js (added)
-
LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.extraargs.html (deleted)
-
LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.extraargs.worker-expected.txt (deleted)
-
LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.extraargs.worker.js (deleted)
-
LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/the-offscreen-canvas/w3c-import.log (modified) (2 diffs)
-
LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-canvas-element/2d-getcontext-options-expected.txt (added)
-
LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-canvas-element/2d-getcontext-options.html (added)
-
LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-canvas-element/2d.getcontext.extraargs.cache-expected.txt (added)
-
LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-canvas-element/2d.getcontext.extraargs.cache.html (moved) (moved from trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-canvas-element/2d.getcontext.extraargs.html ) (3 diffs)
-
LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-canvas-element/2d.getcontext.extraargs.create-expected.txt (added)
-
LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-canvas-element/2d.getcontext.extraargs.create.html (added)
-
LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-canvas-element/w3c-import.log (modified) (1 diff)
-
LayoutTests/platform/glib/TestExpectations (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/html/HTMLCanvasElement.cpp (modified) (3 diffs)
-
Source/WebCore/html/OffscreenCanvas.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r280081 r280084 1 2021-07-20 Chris Lord <clord@igalia.com> 2 3 Canvas and OffscreenCanvas getContext should check if argument is an object before trying to convert it to a dictionary 4 https://bugs.webkit.org/show_bug.cgi?id=227792 5 6 Reviewed by Sam Weinig. 7 8 Canvas 2d getContext extraargs tests now pass. 9 10 * platform/glib/TestExpectations: 11 1 12 2021-07-20 Sam Sneddon <gsnedders@apple.com> 2 13 -
trunk/LayoutTests/imported/w3c/ChangeLog
r280081 r280084 1 2021-07-20 Chris Lord <clord@igalia.com> 2 3 Canvas and OffscreenCanvas getContext should check if argument is an object before trying to convert it to a dictionary 4 https://bugs.webkit.org/show_bug.cgi?id=227792 5 6 Reviewed by Sam Weinig. 7 8 Synchronise with upstream WPT 2d canvas getContext tests. 9 10 * web-platform-tests/html/canvas/offscreen/the-offscreen-canvas/2d-getcontext-options.any-expected.txt: Added. 11 * web-platform-tests/html/canvas/offscreen/the-offscreen-canvas/2d-getcontext-options.any.html: Added. 12 * web-platform-tests/html/canvas/offscreen/the-offscreen-canvas/2d-getcontext-options.any.js: Added. 13 (test.const.options.get alpha): 14 (test.const.options.get willReadFrequently): 15 (test.const.options.get desynchronized): 16 (test.const.options.get colorSpace): 17 (test): 18 * web-platform-tests/html/canvas/offscreen/the-offscreen-canvas/2d-getcontext-options.any.worker-expected.txt: Added. 19 * web-platform-tests/html/canvas/offscreen/the-offscreen-canvas/2d-getcontext-options.any.worker.html: Added. 20 * web-platform-tests/html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.extraargs-expected.txt: Removed. 21 * web-platform-tests/html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.extraargs.cache-expected.txt: Added. 22 * web-platform-tests/html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.extraargs.cache.html: Added. 23 * web-platform-tests/html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.extraargs.cache.worker-expected.txt: Added. 24 * web-platform-tests/html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.extraargs.cache.worker.html: Added. 25 * web-platform-tests/html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.extraargs.cache.worker.js: Added. 26 (t_fail.t.step_func): 27 (t.step): 28 * web-platform-tests/html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.extraargs.create-expected.txt: Added. 29 * web-platform-tests/html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.extraargs.create.html: Added. 30 * web-platform-tests/html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.extraargs.create.worker-expected.txt: Added. 31 * web-platform-tests/html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.extraargs.create.worker.html: Added. 32 * web-platform-tests/html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.extraargs.create.worker.js: Added. 33 (t_fail.t.step_func): 34 (t.step): 35 * web-platform-tests/html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.extraargs.html: Removed. 36 * web-platform-tests/html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.extraargs.worker-expected.txt: Removed. 37 * web-platform-tests/html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.extraargs.worker.js: Removed. 38 * web-platform-tests/html/canvas/offscreen/the-offscreen-canvas/w3c-import.log: 39 * web-platform-tests/html/semantics/embedded-content/the-canvas-element/2d-getcontext-options-expected.txt: Added. 40 * web-platform-tests/html/semantics/embedded-content/the-canvas-element/2d-getcontext-options.html: Added. 41 * web-platform-tests/html/semantics/embedded-content/the-canvas-element/2d.getcontext.extraargs.cache-expected.txt: Added. 42 * web-platform-tests/html/semantics/embedded-content/the-canvas-element/2d.getcontext.extraargs.cache.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-canvas-element/2d.getcontext.extraargs.html. 43 * web-platform-tests/html/semantics/embedded-content/the-canvas-element/2d.getcontext.extraargs.create-expected.txt: Added. 44 * web-platform-tests/html/semantics/embedded-content/the-canvas-element/2d.getcontext.extraargs.create.html: Added. 45 * web-platform-tests/html/semantics/embedded-content/the-canvas-element/w3c-import.log: 46 1 47 2021-07-20 Sam Sneddon <gsnedders@apple.com> 2 48 -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/the-offscreen-canvas/w3c-import.log
r264117 r280084 15 15 ------------------------------------------------------------------------ 16 16 List of files: 17 /LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/the-offscreen-canvas/2d-getcontext-options.any.js 17 18 /LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/the-offscreen-canvas/2d.canvas.readonly.html 18 19 /LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/the-offscreen-canvas/2d.canvas.readonly.worker.js … … 21 22 /LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.exists.html 22 23 /LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.exists.worker.js 23 /LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.extraargs.html 24 /LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.extraargs.worker.js 24 /LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.extraargs.cache.html 25 /LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.extraargs.cache.worker.js 26 /LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.extraargs.create.html 27 /LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.extraargs.create.worker.js 25 28 /LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.shared.html 26 29 /LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.shared.worker.js -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-canvas-element/2d.getcontext.extraargs.cache.html
r280083 r280084 1 1 <!DOCTYPE html> 2 2 <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> 3 <title>Canvas test: 2d.getcontext.extraargs </title>3 <title>Canvas test: 2d.getcontext.extraargs.cache</title> 4 4 <script src="/resources/testharness.js"></script> 5 5 <script src="/resources/testharnessreport.js"></script> … … 8 8 <body class="show_output"> 9 9 10 <h1>2d.getcontext.extraargs </h1>11 <p class="desc">The 2D context ignores extra getContext arguments</p>10 <h1>2d.getcontext.extraargs.cache</h1> 11 <p class="desc">The 2D context doesn't throw with extra getContext arguments (cached)</p> 12 12 13 13 … … 17 17 <ul id="d"></ul> 18 18 <script> 19 var t = async_test("The 2D context ignores extra getContext arguments");19 var t = async_test("The 2D context doesn't throw with extra getContext arguments (cached)"); 20 20 _addTest(function(canvas, ctx) { 21 21 -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-canvas-element/w3c-import.log
r269598 r280084 15 15 ------------------------------------------------------------------------ 16 16 List of files: 17 /LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-canvas-element/2d-getcontext-options.html 17 18 /LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-canvas-element/2d.canvas.context.html 18 19 /LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-canvas-element/2d.canvas.readonly.html 19 20 /LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-canvas-element/2d.canvas.reference.html 20 21 /LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-canvas-element/2d.getcontext.exists.html 21 /LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-canvas-element/2d.getcontext.extraargs.html 22 /LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-canvas-element/2d.getcontext.extraargs.cache.html 23 /LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-canvas-element/2d.getcontext.extraargs.create.html 22 24 /LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-canvas-element/2d.getcontext.invalid.args.html 23 25 /LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-canvas-element/2d.getcontext.shared.html -
trunk/LayoutTests/platform/glib/TestExpectations
r279940 r280084 764 764 # Failing since r277543. 765 765 webkit.org/b/225870 imported/w3c/web-platform-tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.conic.worker.html [ Failure ] 766 webkit.org/b/225870 imported/w3c/web-platform-tests/html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.extraargs.html [ Failure ]767 webkit.org/b/225870 imported/w3c/web-platform-tests/html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.extraargs.worker.html [ Failure ]768 766 769 767 #//////////////////////////////////////////////////////////////////////////////////////// -
trunk/Source/WebCore/ChangeLog
r280083 r280084 1 2021-07-20 Chris Lord <clord@igalia.com> 2 3 Canvas and OffscreenCanvas getContext should check if argument is an object before trying to convert it to a dictionary 4 https://bugs.webkit.org/show_bug.cgi?id=227792 5 6 Reviewed by Sam Weinig. 7 8 Check if options argument is an object before converting to a dictionary. 9 10 Tests: imported/w3c/web-platform-tests/html/canvas/offscreen/the-offscreen-canvas/2d-getcontext-options.any.html 11 imported/w3c/web-platform-tests/html/canvas/offscreen/the-offscreen-canvas/2d-getcontext-options.any.worker.html 12 imported/w3c/web-platform-tests/html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.extraargs.cache.html 13 imported/w3c/web-platform-tests/html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.extraargs.cache.worker.html 14 imported/w3c/web-platform-tests/html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.extraargs.create.html 15 imported/w3c/web-platform-tests/html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.extraargs.create.worker.html 16 imported/w3c/web-platform-tests/html/semantics/embedded-content/the-canvas-element/2d-getcontext-options.html 17 imported/w3c/web-platform-tests/html/semantics/embedded-content/the-canvas-element/2d.getcontext.extraargs.cache.html 18 imported/w3c/web-platform-tests/html/semantics/embedded-content/the-canvas-element/2d.getcontext.extraargs.create.html 19 20 * html/HTMLCanvasElement.cpp: 21 (WebCore::HTMLCanvasElement::getContext): 22 * html/OffscreenCanvas.cpp: 23 (WebCore::OffscreenCanvas::getContext): 24 1 25 2021-07-20 Alex Christensen <achristensen@webkit.org> 2 26 -
trunk/Source/WebCore/html/HTMLCanvasElement.cpp
r280020 r280084 285 285 if (is2dType(contextId)) { 286 286 auto scope = DECLARE_THROW_SCOPE(state.vm()); 287 auto settings = convert<IDLDictionary<CanvasRenderingContext2DSettings>>(state, !arguments.isEmpty() ? arguments[0].get() : JSC::jsUndefined());287 auto settings = convert<IDLDictionary<CanvasRenderingContext2DSettings>>(state, arguments.isEmpty() ? JSC::jsUndefined() : (arguments[0].isObject() ? arguments[0].get() : JSC::jsNull())); 288 288 RETURN_IF_EXCEPTION(scope, Exception { ExistingExceptionError }); 289 289 … … 296 296 if (isBitmapRendererType(contextId)) { 297 297 auto scope = DECLARE_THROW_SCOPE(state.vm()); 298 auto settings = convert<IDLDictionary<ImageBitmapRenderingContextSettings>>(state, !arguments.isEmpty() ? arguments[0].get() : JSC::jsUndefined());298 auto settings = convert<IDLDictionary<ImageBitmapRenderingContextSettings>>(state, arguments.isEmpty() ? JSC::jsUndefined() : (arguments[0].isObject() ? arguments[0].get() : JSC::jsNull())); 299 299 RETURN_IF_EXCEPTION(scope, Exception { ExistingExceptionError }); 300 300 … … 308 308 if (isWebGLType(contextId)) { 309 309 auto scope = DECLARE_THROW_SCOPE(state.vm()); 310 auto attributes = convert<IDLDictionary<WebGLContextAttributes>>(state, !arguments.isEmpty() ? arguments[0].get() : JSC::jsUndefined());310 auto attributes = convert<IDLDictionary<WebGLContextAttributes>>(state, arguments.isEmpty() ? JSC::jsUndefined() : (arguments[0].isObject() ? arguments[0].get() : JSC::jsNull())); 311 311 RETURN_IF_EXCEPTION(scope, Exception { ExistingExceptionError }); 312 312 -
trunk/Source/WebCore/html/OffscreenCanvas.cpp
r278253 r280084 227 227 228 228 auto scope = DECLARE_THROW_SCOPE(state.vm()); 229 auto settings = convert<IDLDictionary<CanvasRenderingContext2DSettings>>(state, !arguments.isEmpty() ? arguments[0].get() : JSC::jsUndefined());229 auto settings = convert<IDLDictionary<CanvasRenderingContext2DSettings>>(state, arguments.isEmpty() ? JSC::jsUndefined() : (arguments[0].isObject() ? arguments[0].get() : JSC::jsNull())); 230 230 RETURN_IF_EXCEPTION(scope, Exception { ExistingExceptionError }); 231 231 … … 249 249 250 250 auto scope = DECLARE_THROW_SCOPE(state.vm()); 251 auto attributes = convert<IDLDictionary<WebGLContextAttributes>>(state, !arguments.isEmpty() ? arguments[0].get() : JSC::jsUndefined());251 auto attributes = convert<IDLDictionary<WebGLContextAttributes>>(state, arguments.isEmpty() ? JSC::jsUndefined() : (arguments[0].isObject() ? arguments[0].get() : JSC::jsNull())); 252 252 RETURN_IF_EXCEPTION(scope, Exception { ExistingExceptionError }); 253 253
Note:
See TracChangeset
for help on using the changeset viewer.