Created
August 22, 2026 07:16
-
-
Save jogibear9988/9d7bc56709ca9e2ef783b1f07705911a to your computer and use it in GitHub Desktop.
CSSOM View GeometryUtils – Developer Trial Instructions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # CSSOM View GeometryUtils – Developer Trial Instructions | |
| The CSSOM View GeometryUtils APIs are currently available in Chromium behind the **Experimental Web Platform features** flag. | |
| ## Enable the feature | |
| 1. Open `chrome://flags/#enable-experimental-web-platform-features` in Chrome Canary. | |
| 2. Set **Experimental Web Platform features** to **Enabled**. | |
| 3. Restart Chrome. | |
| Alternatively, start Chromium with: | |
| ```text | |
| --enable-experimental-web-platform-features | |
| ``` | |
| ## Testing `getBoxQuads()` | |
| ```html | |
| <div id="target" style="width: 100px; height: 50px; transform: rotate(20deg)"> | |
| Test | |
| </div> | |
| <script> | |
| const element = document.getElementById("target"); | |
| const quads = element.getBoxQuads(); | |
| console.log(quads[0]); | |
| </script> | |
| ``` | |
| `getBoxQuads()` returns a `DOMQuad` describing the transformed geometry of the element. | |
| ## Coordinate conversion | |
| The implementation also provides the CSSOM View coordinate conversion APIs: | |
| ```js | |
| element.convertPointFromNode(point, otherElement); | |
| element.convertRectFromNode(rect, otherElement); | |
| element.convertQuadFromNode(quad, otherElement); | |
| ``` | |
| These APIs convert geometry between the coordinate systems of different nodes. | |
| ## Specification | |
| CSSOM View Module – GeometryUtils: | |
| https://drafts.csswg.org/cssom-view/#geometry |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment