Skip to content

Stop using UncheckedKey containers in WebCore/dom #47354

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

Merged
merged 1 commit into from
Jun 30, 2025

Conversation

cdumez
Copy link
Contributor

@cdumez cdumez commented Jun 29, 2025

ba42b51

Stop using UncheckedKey containers in WebCore/dom
https://bugs.webkit.org/show_bug.cgi?id=295179

Reviewed by Anne van Kesteren.

Stop using UncheckedKey containers in WebCore/dom, for safety.
This tested as performance neutral on Speedometer.

* Source/WebCore/dom/ChildListMutationScope.cpp:
* Source/WebCore/dom/ConstantPropertyMap.h:
* Source/WebCore/dom/CustomElementDefaultARIA.h:
* Source/WebCore/dom/CustomElementRegistry.h:
* Source/WebCore/dom/DataTransfer.cpp:
* Source/WebCore/dom/DeviceOrientationAndMotionAccessController.h:
* Source/WebCore/dom/Document.cpp:
(WebCore::Document::buildAccessKeyCache):
(WebCore::Document::runScrollSteps):
(WebCore::hasRealtimeMediaSource):
(WebCore::findNearestCommonComposedAncestor):
* Source/WebCore/dom/Document.h:
(WebCore::Document::attachmentElementsByIdentifier const):
* Source/WebCore/dom/DocumentMarkerController.h:
* Source/WebCore/dom/DocumentSharedObjectPool.h:
* Source/WebCore/dom/Element.cpp:
(WebCore::attrNodeListMap):
(WebCore::elementIdentifiersMap):
(WebCore::Element::topmostPopoverAncestor):
* Source/WebCore/dom/Element.h:
* Source/WebCore/dom/ExtensionStyleSheets.h:
* Source/WebCore/dom/IdTargetObserverRegistry.h:
* Source/WebCore/dom/MessagePort.cpp:
(WebCore::WTF_REQUIRES_LOCK):
(WebCore::MessagePort::disentanglePorts):
* Source/WebCore/dom/MutationObserver.cpp:
(WebCore::MutationObserver::deliver):
* Source/WebCore/dom/MutationObserver.h:
* Source/WebCore/dom/MutationObserverInterestGroup.cpp:
(WebCore::MutationObserverInterestGroup::MutationObserverInterestGroup):
* Source/WebCore/dom/MutationObserverInterestGroup.h:
* Source/WebCore/dom/MutationObserverRegistration.cpp:
(WebCore::MutationObserverRegistration::takeTransientRegistrations):
* Source/WebCore/dom/MutationObserverRegistration.h:
* Source/WebCore/dom/Node.cpp:
(WebCore::Node::dumpStatistics):
(WebCore::nodeSetPreTransformedFromNodeOrStringVector):
(WebCore::firstPrecedingSiblingNotInNodeSet):
(WebCore::firstFollowingSiblingNotInNodeSet):
(WebCore::Node::registeredMutationObservers):
* Source/WebCore/dom/Node.h:
* Source/WebCore/dom/NodeRareData.h:
* Source/WebCore/dom/QualifiedNameCache.h:
* Source/WebCore/dom/RadioButtonGroups.h:
* Source/WebCore/dom/Range.cpp:
(WebCore::Range::processContents):
* Source/WebCore/dom/ScriptExecutionContext.cpp:
* Source/WebCore/dom/ScriptExecutionContext.h:
* Source/WebCore/dom/ScriptRunner.h:
* Source/WebCore/dom/SelectorQuery.h:
* Source/WebCore/dom/ShadowRoot.cpp:
* Source/WebCore/dom/ShadowRoot.h:
* Source/WebCore/dom/SimulatedClick.cpp:
(WebCore::simulateClick):
* Source/WebCore/dom/SlotAssignment.cpp:
(WebCore::ManualSlotAssignment::slotManualAssignmentDidChange):
* Source/WebCore/dom/SlotAssignment.h:
* Source/WebCore/dom/SpaceSplitString.cpp:
* Source/WebCore/dom/TreeScopeOrderedMap.h:
* Source/WebCore/dom/VisitedLinkState.h:
* Source/WebCore/dom/WindowEventLoop.h:
* Source/WebCore/dom/messageports/MessagePortChannel.h:
* Source/WebCore/dom/messageports/MessagePortChannelRegistry.h:
* Source/WebCore/dom/messageports/WorkerMessagePortChannelProvider.h:

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

f24c158

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
⏳ 🧪 webkitpy ⏳ 🧪 ios-wk2-wpt ⏳ 🧪 mac-wk1 ⏳ 🛠 wpe-cairo
⏳ 🛠 🧪 jsc ⏳ 🧪 api-ios ⏳ 🧪 mac-wk2 ⏳ 🛠 gtk
⏳ 🛠 🧪 jsc-arm64 ⏳ 🛠 vision ⏳ 🧪 mac-AS-debug-wk2 ⏳ 🧪 gtk-wk2
⏳ 🧪 services ⏳ 🛠 vision-sim ⏳ 🧪 mac-wk2-stress ⏳ 🧪 api-gtk
⏳ 🧪 vision-wk2 ⏳ 🧪 mac-intel-wk2 ⏳ 🛠 playstation
✅ 🛠 🧪 unsafe-merge ⏳ 🛠 tv ⏳ 🛠 mac-safer-cpp ⏳ 🛠 jsc-armv7
⏳ 🛠 tv-sim ⏳ 🧪 jsc-armv7-tests
⏳ 🛠 watch
⏳ 🛠 watch-sim

@cdumez cdumez requested a review from rniwa as a code owner June 29, 2025 18:04
@cdumez cdumez self-assigned this Jun 29, 2025
@cdumez cdumez added the DOM For bugs specific to XML/HTML DOM elements (including parsing). label Jun 29, 2025
@cdumez cdumez added merge-queue Applied to send a pull request to merge-queue unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing and removed merge-queue Applied to send a pull request to merge-queue labels Jun 29, 2025
@webkit-commit-queue webkit-commit-queue force-pushed the dom_hashmap_checked_keys branch from f24c158 to e368bb8 Compare June 30, 2025 01:35
https://bugs.webkit.org/show_bug.cgi?id=295179

Reviewed by Anne van Kesteren.

Stop using UncheckedKey containers in WebCore/dom, for safety.
This tested as performance neutral on Speedometer.

* Source/WebCore/dom/ChildListMutationScope.cpp:
* Source/WebCore/dom/ConstantPropertyMap.h:
* Source/WebCore/dom/CustomElementDefaultARIA.h:
* Source/WebCore/dom/CustomElementRegistry.h:
* Source/WebCore/dom/DataTransfer.cpp:
* Source/WebCore/dom/DeviceOrientationAndMotionAccessController.h:
* Source/WebCore/dom/Document.cpp:
(WebCore::Document::buildAccessKeyCache):
(WebCore::Document::runScrollSteps):
(WebCore::hasRealtimeMediaSource):
(WebCore::findNearestCommonComposedAncestor):
* Source/WebCore/dom/Document.h:
(WebCore::Document::attachmentElementsByIdentifier const):
* Source/WebCore/dom/DocumentMarkerController.h:
* Source/WebCore/dom/DocumentSharedObjectPool.h:
* Source/WebCore/dom/Element.cpp:
(WebCore::attrNodeListMap):
(WebCore::elementIdentifiersMap):
(WebCore::Element::topmostPopoverAncestor):
* Source/WebCore/dom/Element.h:
* Source/WebCore/dom/ExtensionStyleSheets.h:
* Source/WebCore/dom/IdTargetObserverRegistry.h:
* Source/WebCore/dom/MessagePort.cpp:
(WebCore::WTF_REQUIRES_LOCK):
(WebCore::MessagePort::disentanglePorts):
* Source/WebCore/dom/MutationObserver.cpp:
(WebCore::MutationObserver::deliver):
* Source/WebCore/dom/MutationObserver.h:
* Source/WebCore/dom/MutationObserverInterestGroup.cpp:
(WebCore::MutationObserverInterestGroup::MutationObserverInterestGroup):
* Source/WebCore/dom/MutationObserverInterestGroup.h:
* Source/WebCore/dom/MutationObserverRegistration.cpp:
(WebCore::MutationObserverRegistration::takeTransientRegistrations):
* Source/WebCore/dom/MutationObserverRegistration.h:
* Source/WebCore/dom/Node.cpp:
(WebCore::Node::dumpStatistics):
(WebCore::nodeSetPreTransformedFromNodeOrStringVector):
(WebCore::firstPrecedingSiblingNotInNodeSet):
(WebCore::firstFollowingSiblingNotInNodeSet):
(WebCore::Node::registeredMutationObservers):
* Source/WebCore/dom/Node.h:
* Source/WebCore/dom/NodeRareData.h:
* Source/WebCore/dom/QualifiedNameCache.h:
* Source/WebCore/dom/RadioButtonGroups.h:
* Source/WebCore/dom/Range.cpp:
(WebCore::Range::processContents):
* Source/WebCore/dom/ScriptExecutionContext.cpp:
* Source/WebCore/dom/ScriptExecutionContext.h:
* Source/WebCore/dom/ScriptRunner.h:
* Source/WebCore/dom/SelectorQuery.h:
* Source/WebCore/dom/ShadowRoot.cpp:
* Source/WebCore/dom/ShadowRoot.h:
* Source/WebCore/dom/SimulatedClick.cpp:
(WebCore::simulateClick):
* Source/WebCore/dom/SlotAssignment.cpp:
(WebCore::ManualSlotAssignment::slotManualAssignmentDidChange):
* Source/WebCore/dom/SlotAssignment.h:
* Source/WebCore/dom/SpaceSplitString.cpp:
* Source/WebCore/dom/TreeScopeOrderedMap.h:
* Source/WebCore/dom/VisitedLinkState.h:
* Source/WebCore/dom/WindowEventLoop.h:
* Source/WebCore/dom/messageports/MessagePortChannel.h:
* Source/WebCore/dom/messageports/MessagePortChannelRegistry.h:
* Source/WebCore/dom/messageports/WorkerMessagePortChannelProvider.h:

Canonical link: https://commits.webkit.org/296785@main
@webkit-commit-queue webkit-commit-queue force-pushed the dom_hashmap_checked_keys branch from e368bb8 to ba42b51 Compare June 30, 2025 01:37
@webkit-commit-queue
Copy link
Collaborator

Committed 296785@main (ba42b51): https://commits.webkit.org/296785@main

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

@webkit-commit-queue webkit-commit-queue merged commit ba42b51 into WebKit:main Jun 30, 2025
@webkit-commit-queue webkit-commit-queue removed the unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing label Jun 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DOM For bugs specific to XML/HTML DOM elements (including parsing).
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants