New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 696005 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Apr 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Launch-OWP
Launch-Accessibility: ----
Launch-Exp-Leadership: ----
Launch-Leadership: ----
Launch-Legal: ----
Launch-M-Approved: ----
Launch-M-Target: ----
Launch-Privacy: ----
Launch-Security: ----
Launch-Test: ----
Launch-UI: ----
Rollout-Type: ----

Blocking:
issue 674593


Show other hotlists

Hotlists containing this issue:
Non-Standard-IDL


Sign in to add a comment

Remove or standardize CanvasRenderingContext2D#getContextAttributes

Project Member Reported by lunalu@chromium.org, Feb 24 2017

Issue description

It is not in Gecko or WebKit yet. Should we standardize it or just remove it?
 

Comment 1 by junov@chromium.org, Feb 24 2017

Components: -Internals>GPU>Canvas2D Blink>Canvas
Owner: zakerinasab@chromium.org
Status: Assigned (was: Untriaged)
Not sure how come this is not hidden behind an experimental flag.  That is a mistake. That should be fixed immediately.

This will have to be standardized in the near future since it is required for feature detection, as part of the Canvas ColorSpace proposal.

Comment 2 by lunalu@chromium.org, Feb 24 2017

Thanks!
yeah please make sure to include a spec link in the idl file once it is standardized. 
Project Member

Comment 4 by bugdroid1@chromium.org, Mar 7 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/b1d2e017aef891e5d9bbd4d58b22fe9b08c46db3

commit b1d2e017aef891e5d9bbd4d58b22fe9b08c46db3
Author: zakerinasab <zakerinasab@chromium.org>
Date: Tue Mar 07 18:56:56 2017

Measure CanvasRenderingContext2D.getContextAttributes() usage

To make sure that we can put the unintentionally exposed
CanvasRenderingContext2D.getContextAttributes() behind a flag
without breaking websites out there, we need to measure its usage.

BUG= 696005 

Review-Url: https://codereview.chromium.org/2718783002
Cr-Commit-Position: refs/heads/master@{#455163}

[modify] https://crrev.com/b1d2e017aef891e5d9bbd4d58b22fe9b08c46db3/third_party/WebKit/Source/core/frame/UseCounter.h
[modify] https://crrev.com/b1d2e017aef891e5d9bbd4d58b22fe9b08c46db3/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.idl
[modify] https://crrev.com/b1d2e017aef891e5d9bbd4d58b22fe9b08c46db3/tools/metrics/histograms/histograms.xml

Cc: foolip@chromium.org
Labels: -Type-Bug Type-Feature
Looking at the usage results, the usage results for all releases and all operating systems is zero, except for Canary on Android (https://uma.googleplex.com/p/chrome/usage/?sid=95ada9f8592140de4dd891de850752d1) which gives 0.003309% on M59 only at March 18, 2017. I'm not sure how this has happened, as the usage metric seems to be zero on all the other days.
Cc: junov@chromium.org
On a related note, here is what is written in MDN page for CanvasRenderingContext2D (https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D):

Blink only

CanvasRenderingContext2D.getContextAttributes()
Inspired by the same WebGLRenderingContext method it returns an Canvas2DContextAttributes object that contains the attributes "storage" to indicate which storage is used ("persistent" by default) and the attribute "alpha" (true by default) to indicate that transparency is used in the canvas.

May be this is where the unintentional exposure has got public.
Yeah... we need to standardize this before going any further with it.  This API will be essential for feature detection with canvas color space support. In need to be spec'ed in a very specific way that states that the returned object contains only settings that are in effect and not settings that we ignored by the User Agent.
Could you edit the MDN page to remove references to this method? (FWIW, anyone with a GitHub account can edit MDN)
I removed the reference from MDN page. A CL is uploaded to put CanvasRenderingContext2D#getContextAttributes behind the experimental canvas features flag.
Labels: -Type-Feature OWP-Type-Deprecation Type-Launch-OWP
Project Member

Comment 15 by bugdroid1@chromium.org, Apr 21 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/47093fe643aa8f6a14a8800f73a4939e4be5a69f

commit 47093fe643aa8f6a14a8800f73a4939e4be5a69f
Author: zakerinasab <zakerinasab@chromium.org>
Date: Fri Apr 21 18:04:30 2017

Put CanvasRenderingContext2D#getContextAttributes behind flag

CanvasRenderingContext2D#getContextAttributes was unintentionally exposed in Chrome
back in 2013, while it should have been behind ExperimentalCanvasFeatures flag. This
CL puts the method behind a flag. This is safe as according to GetCanvas2DContextAttributes
usage histogram no one is using it at this time.

BUG= 696005 

Review-Url: https://codereview.chromium.org/2801733003
Cr-Commit-Position: refs/heads/master@{#466387}

[modify] https://crrev.com/47093fe643aa8f6a14a8800f73a4939e4be5a69f/third_party/WebKit/LayoutTests/platform/mac/virtual/stable/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/47093fe643aa8f6a14a8800f73a4939e4be5a69f/third_party/WebKit/LayoutTests/platform/win/virtual/stable/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/47093fe643aa8f6a14a8800f73a4939e4be5a69f/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.idl

Status: Fixed (was: Assigned)

Sign in to add a comment