New issue
Advanced search Search tips

Issue 803440 link

Starred by 5 users

Issue metadata

Status: Fixed
Owner:
Closed: Sep 24
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Windows , Mac
Pri: 2
Type: Bug



Sign in to add a comment

Element.scrollIntoView (and regular scroll-to-fragment) doesn't work for SVG elements

Project Member Reported by f...@opera.com, Jan 18 2018

Issue description

In the attached TC, the scrollIntoView() call should cause a green rectangle with the word "PASS" next to it appear in view. Instead it scrolls to the root <svg>.
 
svg-scrollintoview.html
420 bytes View Download
Can somebody own this please? 
such a useful method, it's a shame it doesn't work in Chrome for SVG elements. Thanks.

People are interested:
https://stackoverflow.com/q/16472797/104380
Owner: f...@opera.com
Status: Assigned (was: Available)
Project Member

Comment 3 by bugdroid1@chromium.org, Sep 21

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

commit 5d6edb4f084778cf635640c4fafd65418af841f7
Author: Fredrik Söderquist <fs@opera.com>
Date: Fri Sep 21 19:45:00 2018

Fix scrollIntoView(...) for SVG elements

AbsoluteBoundingBoxRectForScrollIntoView and associated helpers did not
compute the correct bounding box for SVG shapes (or anything but the SVG
root.)
Compute the bounding rect using the stroke bounding box.

Bug:  803440 
Change-Id: If25ca98b686f17a0db699e569460cb4c276f06a0
Reviewed-on: https://chromium-review.googlesource.com/1238458
Reviewed-by: David Bokan <bokan@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#593306}
[add] https://crrev.com/5d6edb4f084778cf635640c4fafd65418af841f7/third_party/WebKit/LayoutTests/external/wpt/css/cssom-view/scrollIntoView-svg-shape.html
[modify] https://crrev.com/5d6edb4f084778cf635640c4fafd65418af841f7/third_party/blink/renderer/core/layout/layout_object.cc

Status: Fixed (was: Assigned)

Sign in to add a comment