Commit e5720746 authored by akling@apple.com's avatar akling@apple.com

Elements with class names automatically get unique ElementData.

<https://webkit.org/b/124184>

We were calling Element::ensureUniqueElementData() for all Elements
with a non-empty list of class names. Doing that on parser-fresh
Elements caused us to upgrade them to UniqueElementData despite not
needing it (ElementData::setClass() is a const function for caching
the "cooked" class and can be called on ShareableElementData.)

1.09 MB progression on HTML5 spec at <http://whatwg.org/c>

Reviewed by Antti Koivisto.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159104 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 6a9e57e3
2013-11-11 Andreas Kling <akling@apple.com>
Elements with class names automatically get unique ElementData.
<https://webkit.org/b/124184>
We were calling Element::ensureUniqueElementData() for all Elements
with a non-empty list of class names. Doing that on parser-fresh
Elements caused us to upgrade them to UniqueElementData despite not
needing it (ElementData::setClass() is a const function for caching
the "cooked" class and can be called on ShareableElementData.)
1.09 MB progression on HTML5 spec at <http://whatwg.org/c>
Reviewed by Antti Koivisto.
2013-11-12 Zan Dobersek <zdobersek@igalia.com>
JSC bindings generator should generate deletable JSC functions
......
......@@ -1197,7 +1197,10 @@ void Element::classAttributeChanged(const AtomicString& newClassString)
if (classStringHasClassName(newClassString)) {
const bool shouldFoldCase = document().inQuirksMode();
const SpaceSplitString oldClasses = ensureUniqueElementData().classNames();
// Note: We'll need ElementData, but it doesn't have to be UniqueElementData.
if (!elementData())
ensureUniqueElementData();
const SpaceSplitString oldClasses = elementData()->classNames();
elementData()->setClass(newClassString, shouldFoldCase);
const SpaceSplitString& newClasses = elementData()->classNames();
shouldInvalidateStyle = testShouldInvalidateStyle && checkSelectorForClassChange(oldClasses, newClasses, *styleResolver);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment