Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[html] Element.getClientRects() are not within getBoundingClientRect() #16575

Open
DartBot opened this issue Feb 6, 2014 · 5 comments
Open
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. area-web Use area-web for Dart web related issues, including the DDC and dart2js compilers and JS interop. browser-safari library-html P2 A bug or feature request we're likely to work on status-blocked Blocked from making progress by another (referenced) issue type-code-health Internal changes to our tools and workflows to make them cleaner, simpler, or more maintainable web-libraries Issues impacting dart:html, etc., libraries

Comments

@DartBot
Copy link

DartBot commented Feb 6, 2014

This issue was originally filed by Ilya.V...@gmail.com


Test fail

co19/src/LibTest/html/Element/getClientRects_A01_t02

The test containsRectangle should return true for all rects:

main() {
  var x = new Element.html('<span>foo<br/>bar</span>');
  document.body.append(x);
  var rects = x.getClientRects();

  for (var i=0; i<rects.length; ++i) {
    Expect.isTrue(x.getBoundingClientRect().containsRectangle(rects[i]),
        '${i+1} of ${rects.length}');
  }
}

@lrhn
Copy link
Member

lrhn commented Feb 6, 2014

Added Area-HTML, Triaged labels.

@kevmoo
Copy link
Member

kevmoo commented Apr 7, 2014

Removed Area-HTML label.
Added Area-Library, Library-Html labels.

@alan-knight
Copy link
Contributor

Removed Type-Defect, Priority-Unassigned labels.
Added Type-CodeHealth, Priority-Medium labels.

@whesse
Copy link
Member

whesse commented Mar 12, 2015

This test now passes on Chrome 41, where it was failing on Chrome 40. But it is still failing on other browsers.

@alan-knight
Copy link
Contributor

It appears to me that it fails on Safari, where the result in JS of getBoundingClientRect is not rounded, but the result of getClientRects are rounded. So we end up comparing to see if 24 is within 23.8046875 and failing. It passes on Firefox and Chrome. It isn't suppressed for IE, so I'll assume it passes there.

Looks like https://bugs.webkit.org/show_bug.cgi?id=54018
The likelihood of this getting fixed in WebKit seems low.

We could also just change the test to validate that the rounded dimensions of the bounding rect contains the rounded dimensions of all the child rects.


Added Browser-Safari, Waiting labels.

@DartBot DartBot added type-code-health Internal changes to our tools and workflows to make them cleaner, simpler, or more maintainable Priority-Medium area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. library-html browser-safari labels Mar 18, 2015
@kevmoo kevmoo added status-blocked Blocked from making progress by another (referenced) issue and removed waiting labels Feb 8, 2016
@kevmoo kevmoo added P2 A bug or feature request we're likely to work on and removed Priority-Medium labels Mar 1, 2016
@vsmenon vsmenon added the area-web Use area-web for Dart web related issues, including the DDC and dart2js compilers and JS interop. label Jul 20, 2019
@sigmundch sigmundch added the web-libraries Issues impacting dart:html, etc., libraries label Oct 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. area-web Use area-web for Dart web related issues, including the DDC and dart2js compilers and JS interop. browser-safari library-html P2 A bug or feature request we're likely to work on status-blocked Blocked from making progress by another (referenced) issue type-code-health Internal changes to our tools and workflows to make them cleaner, simpler, or more maintainable web-libraries Issues impacting dart:html, etc., libraries
Projects
None yet
Development

No branches or pull requests

7 participants