Skip to content
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

Update parserSetAttributes() to take in a Span instead of a Vector #10178

Merged

Conversation

cdumez
Copy link
Contributor

@cdumez cdumez commented Feb 16, 2023

7ee416a

Update parserSetAttributes() to take in a Span instead of a Vector
https://bugs.webkit.org/show_bug.cgi?id=252361

Reviewed by Ryosuke Niwa.

Update parserSetAttributes() to take in a Span instead of a Vector.
Its implementation doesn't require a Vector, a Span suffices. Using a Span has
a couple of benefits:
1. It allows some call sites to not create a Vector at all to set a single
   attribute.
2. It allows call sites to use Vectors that can have various inline capacities.

* Source/WebCore/dom/DocumentSharedObjectPool.cpp:
(WebCore::hasSameAttributes):
(WebCore::DocumentSharedObjectPool::cachedShareableElementDataWithAttributes):
* Source/WebCore/dom/DocumentSharedObjectPool.h:
* Source/WebCore/dom/Element.cpp:
(WebCore::Element::parserSetAttributes):
* Source/WebCore/dom/Element.h:
* Source/WebCore/dom/ElementData.cpp:
(WebCore::ShareableElementData::createWithAttributes):
(WebCore::ShareableElementData::ShareableElementData):
* Source/WebCore/dom/ElementData.h:
* Source/WebCore/html/parser/HTMLConstructionSite.cpp:
(WebCore::setAttributes):
* Source/WebCore/html/shadow/TextControlInnerElements.cpp:
(WebCore::TextControlInnerTextElement::updateInnerTextElementEditabilityImpl):
* Source/WebCore/xml/XMLErrors.cpp:
(WebCore::createXHTMLParserErrorHeader):
(WebCore::XMLErrors::insertErrorMessageBlock):
* Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::setAttributes):

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

d26fa97

Misc iOS, tvOS & watchOS macOS Linux Windows
βœ… πŸ§ͺ style βœ… πŸ›  ios βœ… πŸ›  mac βœ… πŸ›  wpe   πŸ›  wincairo
βœ… πŸ§ͺ bindings βœ… πŸ›  ios-sim βœ… πŸ›  mac-AS-debug βœ… πŸ›  gtk
βœ… πŸ§ͺ webkitperl   πŸ§ͺ ios-wk2 βœ… πŸ§ͺ api-mac   πŸ§ͺ gtk-wk2
  πŸ§ͺ api-ios βœ… πŸ§ͺ mac-wk1   πŸ§ͺ api-gtk
βœ… πŸ›  tv βœ… πŸ§ͺ mac-wk2
βœ… πŸ›  tv-sim   πŸ§ͺ mac-AS-debug-wk2
βœ… πŸ›  watch βœ… πŸ§ͺ mac-wk2-stress
❌ πŸ›  πŸ§ͺ merge βœ… πŸ›  watch-sim

@cdumez cdumez requested a review from rniwa as a code owner February 16, 2023 00:25
@cdumez cdumez self-assigned this Feb 16, 2023
@cdumez cdumez added the WebCore Misc. For miscellaneous bugs in the WebCore framework (and not JavaScriptCore or WebKit). label Feb 16, 2023
@cdumez cdumez added the merge-queue Applied to send a pull request to merge-queue label Feb 16, 2023
https://bugs.webkit.org/show_bug.cgi?id=252361

Reviewed by Ryosuke Niwa.

Update parserSetAttributes() to take in a Span instead of a Vector.
Its implementation doesn't require a Vector, a Span suffices. Using a Span has
a couple of benefits:
1. It allows some call sites to not create a Vector at all to set a single
   attribute.
2. It allows call sites to use Vectors that can have various inline capacities.

* Source/WebCore/dom/DocumentSharedObjectPool.cpp:
(WebCore::hasSameAttributes):
(WebCore::DocumentSharedObjectPool::cachedShareableElementDataWithAttributes):
* Source/WebCore/dom/DocumentSharedObjectPool.h:
* Source/WebCore/dom/Element.cpp:
(WebCore::Element::parserSetAttributes):
* Source/WebCore/dom/Element.h:
* Source/WebCore/dom/ElementData.cpp:
(WebCore::ShareableElementData::createWithAttributes):
(WebCore::ShareableElementData::ShareableElementData):
* Source/WebCore/dom/ElementData.h:
* Source/WebCore/html/parser/HTMLConstructionSite.cpp:
(WebCore::setAttributes):
* Source/WebCore/html/shadow/TextControlInnerElements.cpp:
(WebCore::TextControlInnerTextElement::updateInnerTextElementEditabilityImpl):
* Source/WebCore/xml/XMLErrors.cpp:
(WebCore::createXHTMLParserErrorHeader):
(WebCore::XMLErrors::insertErrorMessageBlock):
* Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::setAttributes):

Canonical link: https://commits.webkit.org/260349@main
@webkit-commit-queue
Copy link
Collaborator

Committed 260349@main (7ee416a): https://commits.webkit.org/260349@main

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

@webkit-early-warning-system webkit-early-warning-system merged commit 7ee416a into WebKit:main Feb 16, 2023
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Feb 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WebCore Misc. For miscellaneous bugs in the WebCore framework (and not JavaScriptCore or WebKit).
Projects
None yet
4 participants