-
Notifications
You must be signed in to change notification settings - Fork 641
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
[cssom-view] Element (or Node) should contain the properties offset... (offsetParent, offsetLeft, ...) #10514
Comments
see: whatwg/html#10445 |
Does |
maybe, I do not find any browser wich implements this API: getBoxQuads |
seems only firefox has an implementation behind a flag: https://caniuse.com/mdn-api_document_getboxquads |
Polyfills for Geometry API: https://github.com/trusktr/geometry-interfaces They do not work with transformed elements. (Cause that is the hard part) (My Designer Code could work with transformed HTMLElements (https://github.com/node-projects/web-component-designer/blob/92baadd12ebc6821e2bbaac6b4728a6baa49ef0b/packages/web-component-designer/src/elements/helper/TransformHelper.ts#L148C21-L148C49) |
"DevTools overlay" does seem like a use case for Right now the specification for GeometryUtils is inadequate, that'd have to be finished before shipping in a browser. @tabatkins you also mentioned previously you had use cases, were they the same has the one reported here? |
@chrishtr Should I create an extra issue, that "getBoxQuads" should be implemented? (I didn't know of that API when I wrote this issue :-) ) These here is about "offset...." - Properties on non HTMLElements, wich is needed if you want to polyfill "getBoxQuads". (Wich I still think should exist on all Elements) |
I've created a polyfill for the getBoxQuads API based on my designer https://github.com/jogibear9988/getBoxQuadsPolyfill |
No need to do that. |
For reference, here's the link to Sebastian |
And FF issues about the implementation and the remove of the flag: (of the getBoxQuads) https://bugzilla.mozilla.org/show_bug.cgi?id=918189 |
The spec is here: |
Problem
I'm writing a Designer Application, where I show overlays for all Elements (like the Dev Tools). For this to work, I need to calculate the the corners of the rect of an Element. This works using getBoundingClientRect, but only if the Element is not transformed. If the Element for example is rotated, this will not return the points of the element, but the outer rect. And also a element could be inside of another transformed element (and so on).
I know calculate the combined transformation of the element, but for this I need the position of the element inside of it's container. This works on HTMLElements (cause they have offsetLeft and offsetTop), but not on SVG or MathML Elements.
As also MathML and SVG Elements could be aligned inside of HTMLElements, they should also contain these Properties. And also, as they also could be positioned absolutely, they should contain the "offsetParent", to get to wich they are positioned to.
Additional, as also a TextNode could be positioned inside of a container, I think it should also get the "offset..." Properties. So maybe it should be added to the "Node" Interface instead of the "Element" interface.
The spec is here:
https://www.w3.org/TR/cssom-view-1/#extensions-to-the-htmlelement-interface
I think it should be changed to "Element" instead of "HTMLElement"
The text was updated successfully, but these errors were encountered: