WebKit Bugzilla
Attachment 339276 Details for
Bug 184990
: Web Inspector: Canvas tab: Determine isFunction by looking at the prototype
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-184990-20180501220223.patch (text/plain), 9.81 KB, created by
Devin Rousso
on 2018-05-01 22:02:24 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Devin Rousso
Created:
2018-05-01 22:02:24 PDT
Size:
9.81 KB
patch
obsolete
>diff --git a/Source/WebInspectorUI/ChangeLog b/Source/WebInspectorUI/ChangeLog >index 475f11d135abd9c4ad227e1822121292bfaacfd1..15be3b32765ade2938677ae273e100e0f1070062 100644 >--- a/Source/WebInspectorUI/ChangeLog >+++ b/Source/WebInspectorUI/ChangeLog >@@ -1,3 +1,15 @@ >+2018-05-01 Devin Rousso <webkit@devinrousso.com> >+ >+ Web Inspector: Canvas tab: Determine isFunction by looking at the prototype >+ https://bugs.webkit.org/show_bug.cgi?id=184990 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * UserInterface/Models/RecordingAction.js: >+ (WI.RecordingAction.isFunctionForType): >+ (WI.RecordingAction._prototypeForType): >+ (WI.RecordingAction.prototype.async.swizzle): >+ > 2018-05-01 Devin Rousso <webkit@devinrousso.com> > > Web Inspector: Canvas tab: determine hasVisibleEffect for all actions immediately after recording is added >diff --git a/Source/WebInspectorUI/UserInterface/Models/RecordingAction.js b/Source/WebInspectorUI/UserInterface/Models/RecordingAction.js >index 404c30199ccd4283ff9313caee1b3ede5914f134..129763e8f32d6140ee29faf2a670d9d2b6dcc3bb 100644 >--- a/Source/WebInspectorUI/UserInterface/Models/RecordingAction.js >+++ b/Source/WebInspectorUI/UserInterface/Models/RecordingAction.js >@@ -78,11 +78,19 @@ WI.RecordingAction = class RecordingAction extends WI.Object > > static isFunctionForType(type, name) > { >- let functionNames = WI.RecordingAction._functionNames[type]; >- if (!functionNames) >+ let prototype = WI.RecordingAction._prototypeForType(type); >+ if (!prototype) > return false; >+ return typeof Object.getOwnPropertyDescriptor(prototype, name).value === "function"; >+ } > >- return functionNames.has(name); >+ static _prototypeForType(type) >+ { >+ if (type === WI.Recording.Type.Canvas2D) >+ return CanvasRenderingContext2D.prototype; >+ if (type === WI.Recording.Type.CanvasWebGL) >+ return WebGLRenderingContext.prototype; >+ return null; > } > > // Public >@@ -221,20 +229,11 @@ WI.RecordingAction = class RecordingAction extends WI.Object > this._isVisual = visualNames ? visualNames.has(this._name) : false; > > if (this._valid) { >- let prototype = null; >- if (recording.type === WI.Recording.Type.Canvas2D) >- prototype = CanvasRenderingContext2D.prototype; >- else if (recording.type === WI.Recording.Type.CanvasWebGL) >- prototype = WebGLRenderingContext.prototype; >- >- if (prototype) { >- let validName = name in prototype; >- let validFunction = !this._isFunction || typeof prototype[name] === "function"; >- if (!validName || !validFunction) { >- this.markInvalid(); >- >- WI.Recording.synthesizeError(WI.UIString("â%sâ is invalid.").format(name)); >- } >+ let prototype = WI.RecordingAction._prototypeForType(recording.type); >+ if (prototype && !(name in prototype)) { >+ this.markInvalid(); >+ >+ WI.Recording.synthesizeError(WI.UIString("â%sâ is invalid.").format(name)); > } > } > >@@ -343,209 +342,6 @@ WI.RecordingAction.Event = { > HasVisibleEffectChanged: "recording-action-has-visible-effect-changed", > }; > >-WI.RecordingAction._functionNames = { >- [WI.Recording.Type.Canvas2D]: new Set([ >- "arc", >- "arcTo", >- "beginPath", >- "bezierCurveTo", >- "clearRect", >- "clearShadow", >- "clip", >- "clip", >- "closePath", >- "commit", >- "createImageData", >- "createLinearGradient", >- "createPattern", >- "createRadialGradient", >- "drawFocusIfNeeded", >- "drawImage", >- "drawImageFromRect", >- "ellipse", >- "fill", >- "fill", >- "fillRect", >- "fillText", >- "getImageData", >- "getLineDash", >- "getPath", >- "isPointInPath", >- "isPointInPath", >- "isPointInStroke", >- "isPointInStroke", >- "lineTo", >- "measureText", >- "moveTo", >- "putImageData", >- "quadraticCurveTo", >- "rect", >- "resetTransform", >- "restore", >- "rotate", >- "save", >- "scale", >- "setAlpha", >- "setCompositeOperation", >- "setFillColor", >- "setLineCap", >- "setLineDash", >- "setLineJoin", >- "setLineWidth", >- "setMiterLimit", >- "setPath", >- "setShadow", >- "setStrokeColor", >- "setTransform", >- "stroke", >- "stroke", >- "strokeRect", >- "strokeText", >- "transform", >- "translate", >- ]), >- [WI.Recording.Type.CanvasWebGL]: new Set([ >- "activeTexture", >- "attachShader", >- "bindAttribLocation", >- "bindBuffer", >- "bindFramebuffer", >- "bindRenderbuffer", >- "bindTexture", >- "blendColor", >- "blendEquation", >- "blendEquationSeparate", >- "blendFunc", >- "blendFuncSeparate", >- "bufferData", >- "bufferData", >- "bufferSubData", >- "checkFramebufferStatus", >- "clear", >- "clearColor", >- "clearDepth", >- "clearStencil", >- "colorMask", >- "compileShader", >- "compressedTexImage2D", >- "compressedTexSubImage2D", >- "copyTexImage2D", >- "copyTexSubImage2D", >- "createBuffer", >- "createFramebuffer", >- "createProgram", >- "createRenderbuffer", >- "createShader", >- "createTexture", >- "cullFace", >- "deleteBuffer", >- "deleteFramebuffer", >- "deleteProgram", >- "deleteRenderbuffer", >- "deleteShader", >- "deleteTexture", >- "depthFunc", >- "depthMask", >- "depthRange", >- "detachShader", >- "disable", >- "disableVertexAttribArray", >- "drawArrays", >- "drawElements", >- "enable", >- "enableVertexAttribArray", >- "finish", >- "flush", >- "framebufferRenderbuffer", >- "framebufferTexture2D", >- "frontFace", >- "generateMipmap", >- "getActiveAttrib", >- "getActiveUniform", >- "getAttachedShaders", >- "getAttribLocation", >- "getBufferParameter", >- "getContextAttributes", >- "getError", >- "getExtension", >- "getFramebufferAttachmentParameter", >- "getParameter", >- "getProgramInfoLog", >- "getProgramParameter", >- "getRenderbufferParameter", >- "getShaderInfoLog", >- "getShaderParameter", >- "getShaderPrecisionFormat", >- "getShaderSource", >- "getSupportedExtensions", >- "getTexParameter", >- "getUniform", >- "getUniformLocation", >- "getVertexAttrib", >- "getVertexAttribOffset", >- "hint", >- "isBuffer", >- "isContextLost", >- "isEnabled", >- "isFramebuffer", >- "isProgram", >- "isRenderbuffer", >- "isShader", >- "isTexture", >- "lineWidth", >- "linkProgram", >- "pixelStorei", >- "polygonOffset", >- "readPixels", >- "releaseShaderCompiler", >- "renderbufferStorage", >- "sampleCoverage", >- "scissor", >- "shaderSource", >- "stencilFunc", >- "stencilFuncSeparate", >- "stencilMask", >- "stencilMaskSeparate", >- "stencilOp", >- "stencilOpSeparate", >- "texImage2D", >- "texParameterf", >- "texParameteri", >- "texSubImage2D", >- "uniform1f", >- "uniform1fv", >- "uniform1i", >- "uniform1iv", >- "uniform2f", >- "uniform2fv", >- "uniform2i", >- "uniform2iv", >- "uniform3f", >- "uniform3fv", >- "uniform3i", >- "uniform3iv", >- "uniform4f", >- "uniform4fv", >- "uniform4i", >- "uniform4iv", >- "uniformMatrix2fv", >- "uniformMatrix3fv", >- "uniformMatrix4fv", >- "useProgram", >- "validateProgram", >- "vertexAttrib1f", >- "vertexAttrib1fv", >- "vertexAttrib2f", >- "vertexAttrib2fv", >- "vertexAttrib3f", >- "vertexAttrib3fv", >- "vertexAttrib4f", >- "vertexAttrib4fv", >- "vertexAttribPointer", >- "viewport", >- ]), >-}; >- > WI.RecordingAction._visualNames = { > [WI.Recording.Type.Canvas2D]: new Set([ > "clearRect", >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index dc1691ea593e2d3553dc7de8c8e64d8bbf37af72..0521045a7dbd0a885c37d46c14f8b30a6d9c8560 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,12 @@ >+2018-05-01 Devin Rousso <webkit@devinrousso.com> >+ >+ Web Inspector: Canvas tab: Determine isFunction by looking at the prototype >+ https://bugs.webkit.org/show_bug.cgi?id=184990 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * inspector/canvas/recording-2d-expected.txt: >+ > 2018-05-01 Devin Rousso <webkit@devinrousso.com> > > Web Inspector: Canvas tab: determine hasVisibleEffect for all actions immediately after recording is added >diff --git a/LayoutTests/inspector/canvas/recording-2d-expected.txt b/LayoutTests/inspector/canvas/recording-2d-expected.txt >index bd9afc73c70b720dc66b61bed1afcbac48ad3638..9b77a4434d2bb931b63f36a8f43c1a61481576fc 100644 >--- a/LayoutTests/inspector/canvas/recording-2d-expected.txt >+++ b/LayoutTests/inspector/canvas/recording-2d-expected.txt >@@ -526,7 +526,7 @@ frames: > 1: (anonymous function) - inspector/canvas/recording-2d.html:184:28 (172) > 2: executeFrameFunction - inspector/canvas/recording-2d.html:393:24 (20) > 24: (duration) >- 0: getTransform >+ 0: getTransform() > trace: > 0: getTransform - [native code] (174) > 1: (anonymous function) - inspector/canvas/recording-2d.html:187:29 (175)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 184990
:
338771
|
339248
|
339251
|
339258
| 339276 |
339287