Skip to content

Implement CSSOM View GeometryUtils - #71448

Draft
jogibear9988 wants to merge 4 commits into
WebKit:mainfrom
jogibear9988:agent/implement-cssom-geometryutils
Draft

jogibear9988 wants to merge 4 commits into
WebKit:mainfrom
jogibear9988:agent/implement-cssom-geometryutils

Conversation

@jogibear9988

@jogibear9988 jogibear9988 commented Aug 12, 2026 •

Copy link
Copy Markdown

Summary

  • Implement the CSSOM View GeometryUtils mixin for Document, Element, and Text.
  • Add getBoxQuads(), convertQuadFromNode(), convertRectFromNode(), and convertPointFromNode() with support for CSS box selection and relative coordinate spaces.
  • Synchronize geometry reads with style, layout, transforms, content-visibility subtrees, and same-origin frame boundaries.
  • Add the required Web IDL dictionaries and enum, and integrate the generated sources with the CMake, Make, and Xcode builds.
  • Update the existing CSSOM View WPT expectations and add lifecycle regression coverage.

Scope note

The current CSSOM View specification also includes CSSPseudoElement in GeometryNode. WebKit does not yet expose a CSSPseudoElement interface, so this change implements the full API for the geometry node types currently available in WebKit: Document, Element, and Text.

Bug: https://bugs.webkit.org/show_bug.cgi?id=321597

Spec: https://drafts.csswg.org/cssom-view/#the-geometryutils-interface

Testing

  • Release WebCore, WebKit, WebKitTestRunner, DumpRenderTree, LayoutTestHelper, and MiniBrowser builds completed successfully.
  • Tools/Scripts/run-webkit-tests --release --no-build imported/w3c/web-platform-tests/css/cssom-view/cssom-getBoxQuads-001.html imported/w3c/web-platform-tests/css/cssom-view/cssom-getBoxQuads-002.html imported/w3c/web-platform-tests/css/cssom-view/cssom-geometryutils-lifecycle.html — all 3 tests ran as expected.
  • Tools/Scripts/check-webkit-style --git-commit=HEAD — zero errors.
  • git diff --check — clean.

ad41116

Misc iOS, visionOS, tvOS & watchOS macOS Linux Windows
✅ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe ✅ 🛠 win
✅ 🧪 bindings ✅ 🛠 ios-sim ✅ 🛠 mac-AS-debug ✅ 🧪 wpe-wk2 ❌ 🧪 win-tests
✅ 🧪 webkitperl ✅ 🧪 ios-wk2 ✅ 🧪 api-mac ✅ 🧪 api-wpe
✅ 🧪 ios-wk2-wpt ✅ 🧪 api-mac-debug
✅ 🧪 api-ios ✅ 🧪 mac-wk2 ✅ 🛠 gtk3-gcc
✅ 🛠 ios-safer-cpp ✅ 🧪 mac-AS-debug-wk2 ✅ 🛠 gtk
✅ 🛠 vision ✅ 🧪 mac-wk2-stress ✅ 🧪 gtk-wk2
✅ 🛠 vision-sim ❌ 🧪 mac-intel-wk2 ✅ 🧪 api-gtk
✅ 🧪 vision-wk2 ✅ 🛠 mac-safer-cpp   🛠 playstation
✅ 🛠 tv ❌ 🧪 mac-site-isolation
✅ 🛠 tv-sim
✅ 🛠 watch
✅ 🛠 watch-sim

https://bugs.webkit.org/show_bug.cgi?id=321597

Reviewed by NOBODY (OOPS!).

Implement getBoxQuads(), convertQuadFromNode(), convertRectFromNode(), and convertPointFromNode() for Document, Element, and Text. Keep geometry reads synchronized with style, layout, transforms, content-visibility subtrees, and same-origin frame boundaries.

Add the Web IDL dictionaries and enum, integrate the generated sources with all build systems, update the existing CSSOM View WPT expectations, and add lifecycle coverage.

CSSPseudoElement remains unsupported because WebKit does not yet expose that interface.
@jogibear9988

Copy link
Copy Markdown
Author

The implementation also landed in current chrome: https://chromium-review.googlesource.com/c/chromium/src/+/8039580/31

@webkit-ews-buildbot

Copy link
Copy Markdown
Collaborator

iOS Safer C++ Build #46816 (dfe6d78)

❌ Found 1 failing file with 35 issues. Please address these issues before landing. See WebKit Guidelines for Safer C++ Programming.
(cc @rniwa)

@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Aug 12, 2026
https://bugs.webkit.org/show_bug.cgi?id=321597

Reviewed by NOBODY (OOPS!).

Protect ref-counted DOM objects and checked renderer/style objects across non-trivial GeometryUtils operations, satisfying the Safer C++ checks. Also terminate the lifecycle test baseline consistently with the WPT harness output.
Comment thread Source/WebCore/dom/BoxQuadOptions.h Resolved
@webkit-ews-buildbot

Copy link
Copy Markdown
Collaborator

macOS Safer C++ Build #126834 (dfe6d78)

❌ Found 1 failing file with 35 issues. Please address these issues before landing. See WebKit Guidelines for Safer C++ Programming.
(cc @rniwa)

https://bugs.webkit.org/show_bug.cgi?id=321597

Reviewed by NOBODY (OOPS!).

Replace the abbreviated LGPL notices on the new GeometryUtils source files with the preferred WebCore BSD-style license.
https://bugs.webkit.org/show_bug.cgi?id=321597

Reviewed by NOBODY (OOPS!).

Update the CSSOM View IDL harness expectations now that GeometryUtils is exposed, and update the inspector remote-object preview expected properties for Text.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merging-blocked Applied to prevent a change from being merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants