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

[devtools.html] Range.getBoundingClientRect support #8982

Open
jryans opened this issue Dec 15, 2015 · 15 comments
Open

[devtools.html] Range.getBoundingClientRect support #8982

jryans opened this issue Dec 15, 2015 · 15 comments
Labels
A-content/dom Interacting with the DOM from web content I-enhancement No impact; the issue is a missing or proposed feature.

Comments

@jryans
Copy link
Contributor

jryans commented Dec 15, 2015

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.

@Ms2ger
Copy link
Contributor

Ms2ger commented Dec 15, 2015

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

@jryans
Copy link
Contributor Author

jryans commented Dec 21, 2015

@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?

@bgrins
Copy link
Contributor

bgrins commented Dec 21, 2015

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:

@jdm
Copy link
Member

jdm commented Dec 22, 2015

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();
};

@jdm jdm changed the title [devtools.html] getBoundingClientRect support [devtools.html] Range.getBoundingClientRect support Dec 22, 2015
@jdm jdm added A-content/dom Interacting with the DOM from web content E-more-complex Variable effort required; may require a mentor. Recommended solution is clearly described in the iss and removed E-more-complex Variable effort required; may require a mentor. Recommended solution is clearly described in the iss labels Dec 22, 2015
@jaysonsantos
Copy link

Hey @jdm I would like to try this one.

@jdm jdm added the C-assigned There is someone working on resolving the issue label Apr 22, 2016
@jdm
Copy link
Member

jdm commented Apr 22, 2016

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.

@mbrubeck mbrubeck added the I-enhancement No impact; the issue is a missing or proposed feature. label May 24, 2016
@KiChjang
Copy link
Contributor

KiChjang commented Jun 8, 2016

Previous attempt in #10828.

@jryans
Copy link
Contributor Author

jryans commented Jun 30, 2016

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

@jdm
Copy link
Member

jdm commented Jun 30, 2016

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

@jdm
Copy link
Member

jdm commented Jun 30, 2016

So yes, go ahead :)

@jryans
Copy link
Contributor Author

jryans commented Oct 27, 2016

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.

@paulrouget
Copy link
Contributor

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

@jaysonsantos
Copy link

@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

@Ms2ger
Copy link
Contributor

Ms2ger commented Oct 28, 2016

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

@jdm jdm removed the C-assigned There is someone working on resolving the issue label Jan 5, 2017
@jryans
Copy link
Contributor Author

jryans commented Apr 20, 2017

If someone wants to pick up where I left off with this, here's my branch:

https://github.com/jryans/servo/commits/range-client-rects

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-content/dom Interacting with the DOM from web content I-enhancement No impact; the issue is a missing or proposed feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants