-
Notifications
You must be signed in to change notification settings - Fork 725
[cssom-view-1] Added definition of getBoxQuads() #10538
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
base: main
Are you sure you want to change the base?
Conversation
One issues atm: |
I think it makes more sense to add another option to I imagine something like Sebastian |
should be fixed in current polyfill |
it's in a extra method, cause it is used from other functions in the spec (like convertPointFromNode). And convertPointFromNode use it multiple times |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this looks like a good start. Please look at how other specs (specially recent ones) use bikeshed in order to get the formatting and references correct. Also this needs to work in terms of nodes and boxes, not elements.
@@ -1781,46 +1781,76 @@ Document includes GeometryUtils; | |||
typedef (Text or Element or CSSPseudoElement or Document) GeometryNode; | |||
</pre> | |||
|
|||
The <dfn method for=GeometryUtils lt="getBoxQuads(options)|getBoxQuads()">getBoxQuads(<var>options</var>)</dfn> method must run the following steps: | |||
|
|||
The helper method getCompleteTransform(anchestor) must run the following steps: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to get the element as a parameter, and use <div algorithm>
for this for example:
<div algorithm="get the complete transform">
In order to <dfn export>get the complete transform</dfn> of an node <var>node</var> relative to a node <var>ancestor</ancestor> ...
</div>
|
||
test block in inline | ||
1. let currentElement be the element getCompleteTransform() called on. | ||
2. let transformationMatrix be the current transformation matrix of currentElement (https://www.w3.org/TR/css-transforms-2/#ctm) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use bikeshed references for this.
</ol> | ||
|
||
The <dfn method for=GeometryUtils lt="convertPointFromNode(point, from, options)|convertPointFromNode(point, from)">convertPointFromNode(<var>point</var>, <var>from</var>, <var>options</var>)</dfn> | ||
method must run the following steps: | ||
|
||
<ol> | ||
<li><p class=issue>... | ||
1. get the resulting matrix between the element and the document.defaultView via the algorithm defined in getCompleteTransform |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All these algorithms need to be in terms of node
s, as GeometryUtils
also applies to text nodes and such.
- 'border': no change | ||
- 'margin': x - margin.left, y - margin.top | ||
- 'padding': x + border.leftWidth, y + border.topWidth | ||
- 'content': x + border.leftWidth + padding.left, y + border.topWidth + padding.top |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not actually based on the computed style but on the actual used padding box etc. Those boxes are defined already elsewhere and we should reuse the definitions.
Fixes #10537
A linked issue:
#10514
A firefox issue with a little bit of description:
https://bugzilla.mozilla.org/show_bug.cgi?id=1107559
A polyfill for the API
https://github.com/jogibear9988/getBoxQuadsPolyfill