CanvasRenderingContext2D scrollPathIntoView() uses center alignment instead of nearest |
|||
Issue descriptionhttps://cs.chromium.org/chromium/src/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp?type=cs&q=scrollpathintoviewinternal&l=337 The center alignment is different from what element.scrollIntoView() does. Per https://github.com/whatwg/html/pull/3131 the inline-base direction alignment should be "nearest". Demo: http://software.hixie.ch/utilities/js/live-dom-viewer/saved/5433 http://software.hixie.ch/utilities/js/live-dom-viewer/saved/5434
,
Oct 20 2017
Sent for review. That said, the second demo that you give is broken. `strokeRect` doesn't create a path. So it needs to be something like: ctx.rect(10,10,100,100); ctx.stroke(); ctx.scrollPathIntoView();
,
Oct 23 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/8eda6c0db7113b5eaf81dfa078e7ea076aeb0aec commit 8eda6c0db7113b5eaf81dfa078e7ea076aeb0aec Author: Fernando Serboncini <fserb@chromium.org> Date: Mon Oct 23 18:09:47 2017 Fix Canvas' scrollPathIntoView to support latest spec Canvas scroll now to nearest. Bug: 775024 Change-Id: Ie3f5e1ea20e0c10795ac7bf60ce1a9fe03e58dcc Reviewed-on: https://chromium-review.googlesource.com/731106 Commit-Queue: Fernando Serboncini <fserb@chromium.org> Reviewed-by: Justin Novosad <junov@chromium.org> Cr-Commit-Position: refs/heads/master@{#510851} [modify] https://crrev.com/8eda6c0db7113b5eaf81dfa078e7ea076aeb0aec/third_party/WebKit/LayoutTests/fast/canvas-api/script-tests/canvas-scroll-path-into-view.js [modify] https://crrev.com/8eda6c0db7113b5eaf81dfa078e7ea076aeb0aec/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp
,
Oct 23 2017
Done. I still think some of those scrolling are weird. But the changes suggested are done. So closing. |
|||
►
Sign in to add a comment |
|||
Comment 1 by junov@chromium.org
, Oct 16 2017Status: Assigned (was: Untriaged)