New issue
Advanced search Search tips

Issue 736800 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jun 2017
Cc:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Bug



Sign in to add a comment

Change the implementation of registerPaint to match spec

Project Member Reported by xidac...@chromium.org, Jun 26 2017

Issue description

In particular, the spec says:
1. If the name is an empty string, throw a TypeError and abort all these steps.
2. ...
3. If paintDefinitionMap[name] exists throw a "InvalidModificationError" DOMException and abort all these steps.

But in our implementation, we do 3 first and then do 1.

We should change our implementation, because if paintDefinitionMap[name] exists, name cannot be an empty string.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Jun 26 2017

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

commit 9beaa97d0c8c4d1ab60cd288f81bb1af77eb5505
Author: Xida Chen <xidachen@chromium.org>
Date: Mon Jun 26 21:17:56 2017

Fix error throwing logic in registerPaint

Right now in the implementation of registerPaint, we check whether the
paintDefinitionMap[name] exists or not, before checking whether |name|
is an empty string or not. The order should be reversed and this CL does
the correction. After this, our implementation matches the spec.

Bug:  736800 
Change-Id: I7731351520003dc1ba043feedd15d58de2ee1e1b
Reviewed-on: https://chromium-review.googlesource.com/548817
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Commit-Queue: Xida Chen <xidachen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#482403}
[modify] https://crrev.com/9beaa97d0c8c4d1ab60cd288f81bb1af77eb5505/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScope.cpp

Status: Fixed (was: Assigned)

Sign in to add a comment