New issue
Advanced search Search tips

Issue 671849 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Jan 2018
Cc:
Components:
EstimatedDays: ----
NextAction: 2016-12-21
OS: Linux
Pri: 3
Type: Bug



Sign in to add a comment

CSS Paint API: shadowBlur doesn't scale with page zoom

Project Member Reported by dstockwell@chromium.org, Dec 7 2016

Issue description

eg. http://jsbin.com/hilocahawu/edit?html,js,output

When the page is zoomed the shadow remains the same physical size.
 
Labels: Needs-Feedback
NextAction: 2016-12-21
What needs to be enabled to verify this?

Is this a Paint team bug or a CSS custom paint bug? In particular, does a shadow on a basic declarative page scale properly?
Blocking: 578252
Labels: -Needs-Feedback
> What needs to be enabled to verify this?

"Experimental web platform features", not shipped yet.

> Is this a Paint team bug or a CSS custom paint bug?

I think both.

> In particular, does a shadow on a basic declarative page scale properly?

Yes, I think so. For example a CSS box-shadow will scale.
Status: Available (was: Untriaged)

Comment 4 by nainar@chromium.org, Sep 12 2017

Cc: xidac...@chromium.org
Hi xidachen@, 

ccing you as an FYI
Cc: -xidac...@chromium.org
Owner: xidac...@chromium.org
Status: Assigned (was: Available)
Blocking: -578252
How hard is it to fix this bug?
Project Member

Comment 8 by bugdroid1@chromium.org, Jan 12 2018

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

commit 037f13946d29591fe1c1f6eeae6187645674aad0
Author: Xida Chen <xidachen@chromium.org>
Date: Fri Jan 12 17:07:05 2018

[PaintWorklet] Fix shadow blur size when page zooms

When the page zooms, for example, to 200%, the size of the shadow blur
remains the same as when the page scale is 100%. The problem here is
that whenever we zoom the page, we queue a paint call back. Then the
new paint call back will set the shadow blur with the size that doesn't
account for the page zoom.

The fix is to override the BaseRenderingContext2d::setShadowBlur()
method with the zoom. Note that when we created the PaintRenderingContext2d
object, the |zoom| parameter includes the page zoom and device scale
factor.

This CL also includes a layout test to verify the correctness of the fix.

TBR=junov@chromium.org

Bug:  671849 
Change-Id: I8b00dbf4f79e2430c424c762dbf008ac27706f54
Reviewed-on: https://chromium-review.googlesource.com/862525
Commit-Queue: Xida Chen <xidachen@chromium.org>
Reviewed-by: Tien-Ren Chen <trchen@chromium.org>
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#528974}
[add] https://crrev.com/037f13946d29591fe1c1f6eeae6187645674aad0/third_party/WebKit/LayoutTests/http/tests/csspaint/shadow-blur-scale-with-page-zoom-expected.html
[add] https://crrev.com/037f13946d29591fe1c1f6eeae6187645674aad0/third_party/WebKit/LayoutTests/http/tests/csspaint/shadow-blur-scale-with-page-zoom.html
[modify] https://crrev.com/037f13946d29591fe1c1f6eeae6187645674aad0/third_party/WebKit/Source/modules/canvas/canvas2d/BaseRenderingContext2D.h
[modify] https://crrev.com/037f13946d29591fe1c1f6eeae6187645674aad0/third_party/WebKit/Source/modules/csspaint/PaintRenderingContext2D.cpp
[modify] https://crrev.com/037f13946d29591fe1c1f6eeae6187645674aad0/third_party/WebKit/Source/modules/csspaint/PaintRenderingContext2D.h

Status: Fixed (was: Assigned)

Sign in to add a comment