https://bugs.webkit.org/show_bug.cgi?id=129662
Reviewed by Andreas Kling.
The vast majority of attributes don't need synchronization. Avoid calling synchronizeAttribute in setters
for those content attributes generated by "Reflect" keyword in IDL.
* bindings/scripts/CodeGenerator.pm:
(SetterExpression):
* dom/Element.cpp:
(WebCore::Element::setAttributeWithoutSynchronization): Added.
* dom/Element.h:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@165046
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2014-03-04 Ryosuke Niwa <rniwa@webkit.org>
+
+ Don't synchronize attributes in reflect setters when we don't need to
+ https://bugs.webkit.org/show_bug.cgi?id=129662
+
+ Reviewed by Andreas Kling.
+
+ The vast majority of attributes don't need synchronization. Avoid calling synchronizeAttribute in setters
+ for those content attributes generated by "Reflect" keyword in IDL.
+
+ * bindings/scripts/CodeGenerator.pm:
+ (SetterExpression):
+ * dom/Element.cpp:
+ (WebCore::Element::setAttributeWithoutSynchronization): Added.
+ * dom/Element.h:
+
2014-03-04 Andreas Kling <akling@apple.com>
Remove Document::idAttributeName().
return ("set" . $generator->WK_ucfirst($generator->AttributeNameForGetterAndSetter($attribute)));
}
+ my $attributeType = $attribute->signature->type;
+
my $functionName;
- if ($attribute->signature->type eq "boolean") {
+ if ($attributeType eq "boolean") {
$functionName = "setBooleanAttribute";
- } elsif ($attribute->signature->type eq "long") {
+ } elsif ($attributeType eq "long") {
$functionName = "setIntegralAttribute";
- } elsif ($attribute->signature->type eq "unsigned long") {
+ } elsif ($attributeType eq "unsigned long") {
$functionName = "setUnsignedIntegralAttribute";
- } else {
+ } elsif ($generator->IsSVGAnimatedType($attributeType)) {
$functionName = "setAttribute";
+ } else {
+ $functionName = "setAttributeWithoutSynchronization";
}
return ($functionName, $contentAttributeName);
setAttributeInternal(index, name, value, NotInSynchronizationOfLazyAttribute);
}
+void Element::setAttributeWithoutSynchronization(const QualifiedName& name, const AtomicString& value)
+{
+ unsigned index = elementData() ? elementData()->findAttributeIndexByName(name) : ElementData::attributeNotFound;
+ setAttributeInternal(index, name, value, NotInSynchronizationOfLazyAttribute);
+}
+
void Element::setSynchronizedLazyAttribute(const QualifiedName& name, const AtomicString& value)
{
unsigned index = elementData() ? elementData()->findAttributeIndexByName(name) : ElementData::attributeNotFound;
void Element::setPseudo(const AtomicString& value)
{
- setAttribute(pseudoAttr, value);
+ setAttributeWithoutSynchronization(pseudoAttr, value);
}
LayoutSize Element::minimumSizeForResizing() const
bool hasAttribute(const QualifiedName&) const;
const AtomicString& getAttribute(const QualifiedName&) const;
void setAttribute(const QualifiedName&, const AtomicString& value);
+ void setAttributeWithoutSynchronization(const QualifiedName&, const AtomicString& value);
void setSynchronizedLazyAttribute(const QualifiedName&, const AtomicString& value);
bool removeAttribute(const QualifiedName&);