Skip to content

[devtools.html] Range.getBoundingClientRect support #8982

Closed as not planned
Closed as not planned

Description

@jryans

In meta-issue #8973 to get devtools.html loading, we noticed getBoundingClientRect is not supported yet.

CodeMirror (which we use as an editor throughout various parts of our tools) relies on this for various metrics and expects it to be available.

Activity

  1. Ms2ger commented on Dec 15, 2015

    @Ms2ger
    Contributor

    getBoundingClientRect is defined on Element. Can you give some more context on how this breaks?

  2. jryans commented on Dec 21, 2015

    @jryans
    ContributorAuthor

    @bgrins, do you have more details about this? When running the latest servo-client branch, I did not see this error directly, but perhaps you have more local changes?

  3. bgrins commented on Dec 21, 2015

    @bgrins
    Contributor

    I did have a workaround for #8981 locally but I've now pushed that in joewalker/devtools.html@b1cb205.

    So if you pull the latest servo-client branch then do:

  4. jdm commented on Dec 22, 2015

    @jdm
    Member

    This is Range.getBoundingClientRect, which isn't implemented yet:

    // http://dev.w3.org/csswg/cssom-view/#extensions-to-the-range-interface
    partial interface Range {
      // DOMRectList? getClientRects();
      // DOMRect getBoundingClientRect();
    };
    
  5. changed the title [-][devtools.html] getBoundingClientRect support[/-] [+][devtools.html] Range.getBoundingClientRect support[/+] on Dec 22, 2015
  6. added
    A-content/dom
    E-more-complex
    and removed
    E-more-complex
    on Dec 22, 2015
  7. jaysonsantos commented on Apr 22, 2016

    @jaysonsantos

    Hey @jdm I would like to try this one.

  8. added
    C-assigned
    on Apr 22, 2016
  9. jdm commented on Apr 22, 2016

    @jdm
    Member

    Please ask questions if anything's unclear. We can start with using the existing support for Element.getClientRects and Element.getBoundingClientRect and then extend it to support the special behaviour described for slices of text nodes.

  10. added
    I-enhancement
    on May 24, 2016
  11. KiChjang commented on Jun 8, 2016

    @KiChjang
    Contributor

    Previous attempt in #10828.

  12. jryans commented on Jun 30, 2016

    @jryans
    ContributorAuthor

    @jdm can you assign this one to me? I'd like to give it a try.

  13. jdm commented on Jun 30, 2016

    @jdm
    Member

    It's already marked as assigned, and we can't set the assignee field to people who aren't part of the servo organization.

  14. jdm commented on Jun 30, 2016

    @jdm
    Member

    So yes, go ahead :)

  15. jryans commented on Oct 27, 2016

    @jryans
    ContributorAuthor

    In case anyone is wondering, I did make some progress toward an implementation here, but then I got stuck when I started writing tests and noticed that every engine seems to give different results for these APIs. I wasn't sure how to resolve that... If anyone has suggestions, maybe I can continue to push forward.

  16. paulrouget commented on Oct 28, 2016

    @paulrouget
    Contributor

    Isn't there some wpt test for getClientRects and getBoudingClientRect?

  17. jaysonsantos commented on Oct 28, 2016

    @jaysonsantos

    @jryans when I was trying to do it i created some sort of tests but every browser will return a different value which makes that a bit hard to do but here [1] is the closed pr.
    [1] https://github.com/servo/servo/pull/10828/files

  18. Ms2ger commented on Oct 28, 2016

    @Ms2ger
    Contributor

    Doesn't look like there's any tests for getBoundingClientRect on Range.

  19. removed
    C-assigned
    on Jan 5, 2017
  20. jryans commented on Apr 20, 2017

    @jryans
    ContributorAuthor
  21. lumiscosity commented on Jul 28, 2025

    @lumiscosity
    Member

    Added in 6be7612.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-content/domI-enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions