Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: ea2e1a014dcbc1bf2b8986c0424a86a0b96f7b03
https://github.com/WebKit/WebKit/commit/ea2e1a014dcbc1bf2b8986c0424a86a0b96f7b03
Author: Chris Dumez <[email protected]>
Date: 2026-10-07 (Wed, 07 Oct 2026)
Changed paths:
M Source/WebCore/SaferCPPExpectations/UncheckedCallArgsCheckerExpectations
M Source/WebCore/SaferCPPExpectations/UncountedCallArgsCheckerExpectations
M Source/WebCore/html/CachedHTMLCollection.h
M Source/WebCore/html/CachedHTMLCollectionInlines.h
M Source/WebCore/html/CollectionTraversalInlines.h
Log Message:
-----------
Address Safer C++ warnings in WebCore/html collection templates
https://bugs.webkit.org/show_bug.cgi?id=326596
Reviewed by Geoffrey Garen and Rupin Mittal.
Protect the elements passed to elementMatches() during collection traversal,
as well as the document and root node. Cast this to the collection class at
the call sites instead of calling collection(), so the static analyzer can
see that the argument is this; remove the now unused collection().
This tested as performance neutral on Speedometer with PGO profiles updated.
* Source/WebCore/html/CachedHTMLCollection.h:
(WebCore::CachedHTMLCollection::willValidateIndexCache const):
* Source/WebCore/html/CachedHTMLCollectionInlines.h:
(WebCore::CachedHTMLCollection<HTMLCollectionClass>::~CachedHTMLCollection):
(WebCore::CachedHTMLCollection<HTMLCollectionClass>::length const):
(WebCore::CachedHTMLCollection<HTMLCollectionClass>::item const):
(WebCore::CachedHTMLCollection<HTMLCollectionClass>::namedItem const):
(WebCore::CachedHTMLCollection<HTMLCollectionClass>::collectionBegin const):
(WebCore::CachedHTMLCollection<HTMLCollectionClass>::collectionLast const):
(WebCore::CachedHTMLCollection<HTMLCollectionClass>::collectionTraverseForward
const):
(WebCore::CachedHTMLCollection<HTMLCollectionClass>::collectionTraverseBackward
const):
* Source/WebCore/html/CollectionTraversalInlines.h:
(WebCore::CollectionTraversal<CollectionTraversalType::Descendants>::begin):
(WebCore::CollectionTraversal<CollectionTraversalType::Descendants>::last):
(WebCore::CollectionTraversal<CollectionTraversalType::Descendants>::traverseForward):
(WebCore::CollectionTraversal<CollectionTraversalType::Descendants>::traverseBackward):
(WebCore::CollectionTraversal<CollectionTraversalType::WeakPtrDescendants>::begin):
(WebCore::CollectionTraversal<CollectionTraversalType::WeakPtrDescendants>::last):
(WebCore::CollectionTraversal<CollectionTraversalType::WeakPtrDescendants>::traverseForward):
(WebCore::CollectionTraversal<CollectionTraversalType::WeakPtrDescendants>::traverseBackward):
(WebCore::CollectionTraversal<CollectionTraversalType::ChildrenOnly>::begin):
(WebCore::CollectionTraversal<CollectionTraversalType::ChildrenOnly>::last):
(WebCore::CollectionTraversal<CollectionTraversalType::ChildrenOnly>::traverseForward):
(WebCore::CollectionTraversal<CollectionTraversalType::ChildrenOnly>::traverseBackward):
Canonical link: https://commits.webkit.org/323049@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications