Skip to content
Permalink
Browse files
ElementData::setClassNames() can take an r-value reference
https://bugs.webkit.org/show_bug.cgi?id=239789

Reviewed by Geoffrey Garen.

* Source/WebCore/dom/Element.cpp:
(WebCore::Element::classAttributeChanged):
* Source/WebCore/dom/ElementData.h:
(WebCore::ElementData::setClassNames const):

Canonical link: https://commits.webkit.org/250010@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@293474 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
cdumez committed Apr 26, 2022
1 parent 96f919b commit 6a219ecd01caf99a5e7fc8e72bdbedd40febb373
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
@@ -2001,7 +2001,7 @@ void Element::classAttributeChanged(const AtomString& newClassString)
auto newClassNames = newStringHasClasses ? SpaceSplitString(newClassString, shouldFoldCase) : SpaceSplitString();
{
Style::ClassChangeInvalidation styleInvalidation(*this, oldClassNames, newClassNames);
elementData()->setClassNames(newClassNames);
elementData()->setClassNames(WTFMove(newClassNames));
}

if (hasRareData()) {
@@ -85,7 +85,7 @@ class ElementData : public RefCounted<ElementData> {

static const unsigned attributeNotFound = static_cast<unsigned>(-1);

void setClassNames(const SpaceSplitString& classNames) const { m_classNames = classNames; }
void setClassNames(SpaceSplitString&& classNames) const { m_classNames = WTFMove(classNames); }
const SpaceSplitString& classNames() const { return m_classNames; }
static ptrdiff_t classNamesMemoryOffset() { return OBJECT_OFFSETOF(ElementData, m_classNames); }

0 comments on commit 6a219ec

Please sign in to comment.