New issue
Advanced search Search tips

Issue 788519 link

Starred by 1 user

Issue metadata

Status: Duplicate
Merged: issue 370012
Owner: ----
Closed: Nov 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 2
Type: Bug



Sign in to add a comment

SVGSVGElement.checkIntersection() is completely broken, based on bounding rects

Reported by teo8...@gmail.com, Nov 25 2017

Issue description

UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.89 Safari/537.36

Steps to reproduce the problem:
1. visit http://jsbin.com/qepaxirotu/edit?html,console,output
2. check console output

What is the expected behavior?
output should be false.

The output is the result of the test

  svgRoot.checkIntersection(rectelem, refrect)

where svgRoot is an SVG root element, rectelem is a rotated SVG rectangle element inside it, and refrect is a SVGRect object representing a rectangle that does NOT intersect the rotated rectangle element.

Hence, the test should return false

What went wrong?
The output is true.

Based on a few tests I've done by moving around the rectangle in the example, I strongly suspect checkIntersection() actually checks whether the BOUNDING RECTANGLE of the given svg element, the one you would get via getBoundingClientRect(), intersects the given geometry rectangle.

That's stupid and useless. I can write that test with half a dozen lines of codes using getBoundingClientRect(), I don't need checkIntersection for that, and it is completely useless in determining whether an svg element intersects a given rectangle, because it can give a wild range of false positives as the example demostrates.

Did this work before? No 

Chrome version: 62.0.3202.89  Channel: n/a
OS Version: 
Flash Version:
 
Screenshot from 2017-11-26 00-17-03.png
2.0 KB View Download
Components: -Blink Blink>SVG

Comment 2 by ajha@chromium.org, Nov 27 2017

Labels: Needs-Triage-M62

Comment 3 by f...@opera.com, Nov 27 2017

Mergedinto: 370012
Status: Duplicate (was: Unconfirmed)

Sign in to add a comment