Skip to content

Include Element attributes in render tree output #47415

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

Conversation

smfr
Copy link
Contributor

@smfr smfr commented Jul 1, 2025

e31e65e

Include Element attributes in render tree output
https://bugs.webkit.org/show_bug.cgi?id=295248
rdar://154712771

Reviewed by Alan Baradlay.

When using `showRenderTree()` it's helpful to see element classnames and
ids to match renderers to elements.

Add `Element::Element::attributesForDescription()`, and call it from
`RenderObject::outputRenderObject()`.

* Source/WebCore/dom/Element.cpp:
(WebCore::Element::attributesForDescription const):
* Source/WebCore/dom/Element.h:
* Source/WebCore/rendering/RenderLayer.cpp:
(WebCore::outputIndent): Typo fix
(WebCore::outputPaintOrderTreeRecursive):
(WebCore::outputLayerPositionTreeRecursive):
(WebCore::outputIdent): Deleted.
* Source/WebCore/rendering/RenderObject.cpp:
(WebCore::RenderObject::outputRenderObject const):

Canonical link: https://commits.webkit.org/296849@main

301af9a

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 ✅ 🧪 mac-wk1 ✅ 🛠 wpe-cairo
✅ 🧪 api-ios ✅ 🧪 mac-wk2 ✅ 🛠 gtk
✅ 🛠 vision ✅ 🧪 mac-AS-debug-wk2 ✅ 🧪 gtk-wk2
✅ 🛠 vision-sim ✅ 🧪 mac-wk2-stress ✅ 🧪 api-gtk
✅ 🛠 🧪 merge ✅ 🧪 vision-wk2 ✅ 🧪 mac-intel-wk2 ✅ 🛠 playstation
✅ 🛠 tv ✅ 🛠 mac-safer-cpp
✅ 🛠 tv-sim
✅ 🛠 watch
✅ 🛠 watch-sim

@smfr smfr requested review from rniwa and cdumez as code owners July 1, 2025 00:19
@smfr smfr self-assigned this Jul 1, 2025
@smfr smfr added the Tools / Tests Tools in the Tools directory, build issues, test infrastructure, and bugs in test cases label Jul 1, 2025
@smfr smfr force-pushed the eng/Include-Element-attributes-in-render-tree-output branch from 08b23e0 to 301af9a Compare July 1, 2025 00:23
@smfr smfr added the merge-queue Applied to send a pull request to merge-queue label Jul 1, 2025
https://bugs.webkit.org/show_bug.cgi?id=295248
rdar://154712771

Reviewed by Alan Baradlay.

When using `showRenderTree()` it's helpful to see element classnames and
ids to match renderers to elements.

Add `Element::Element::attributesForDescription()`, and call it from
`RenderObject::outputRenderObject()`.

* Source/WebCore/dom/Element.cpp:
(WebCore::Element::attributesForDescription const):
* Source/WebCore/dom/Element.h:
* Source/WebCore/rendering/RenderLayer.cpp:
(WebCore::outputIndent): Typo fix
(WebCore::outputPaintOrderTreeRecursive):
(WebCore::outputLayerPositionTreeRecursive):
(WebCore::outputIdent): Deleted.
* Source/WebCore/rendering/RenderObject.cpp:
(WebCore::RenderObject::outputRenderObject const):

Canonical link: https://commits.webkit.org/296849@main
@webkit-commit-queue webkit-commit-queue force-pushed the eng/Include-Element-attributes-in-render-tree-output branch from 301af9a to e31e65e Compare July 1, 2025 04:21
@webkit-commit-queue
Copy link
Collaborator

Committed 296849@main (e31e65e): https://commits.webkit.org/296849@main

Reviewed commits have been landed. Closing PR #47415 and removing active labels.

@webkit-commit-queue webkit-commit-queue merged commit e31e65e into WebKit:main Jul 1, 2025
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Jul 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Tools / Tests Tools in the Tools directory, build issues, test infrastructure, and bugs in test cases
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants