[webkit-changes] [WebKit/WebKit] 7ee416: Update parserSetAttributes() to take in a Span ins...

Chris Dumez noreply at github.com
Wed Feb 15 20:46:36 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 7ee416a7a42e06bc63dc488a43757ebc9f283bb7
      https://github.com/WebKit/WebKit/commit/7ee416a7a42e06bc63dc488a43757ebc9f283bb7
  Author: Chris Dumez <cdumez at apple.com>
  Date:   2023-02-15 (Wed, 15 Feb 2023)

  Changed paths:
    M Source/WebCore/dom/DocumentSharedObjectPool.cpp
    M Source/WebCore/dom/DocumentSharedObjectPool.h
    M Source/WebCore/dom/Element.cpp
    M Source/WebCore/dom/Element.h
    M Source/WebCore/dom/ElementData.cpp
    M Source/WebCore/dom/ElementData.h
    M Source/WebCore/html/parser/HTMLConstructionSite.cpp
    M Source/WebCore/html/shadow/TextControlInnerElements.cpp
    M Source/WebCore/xml/XMLErrors.cpp
    M Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp

  Log Message:
  -----------
  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




More information about the webkit-changes mailing list