OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2001 Peter Kelly (pmk@post.com) | 4 * (C) 2001 Peter Kelly (pmk@post.com) |
5 * (C) 2001 Dirk Mueller (mueller@kde.org) | 5 * (C) 2001 Dirk Mueller (mueller@kde.org) |
6 * (C) 2007 David Smith (catfish.man@gmail.com) | 6 * (C) 2007 David Smith (catfish.man@gmail.com) |
7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc.
All rights reserved. | 7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc.
All rights reserved. |
8 * (C) 2007 Eric Seidel (eric@webkit.org) | 8 * (C) 2007 Eric Seidel (eric@webkit.org) |
9 * | 9 * |
10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
(...skipping 2880 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2891 | 2891 |
2892 if (oldForAttributeValue == newForAttributeValue) | 2892 if (oldForAttributeValue == newForAttributeValue) |
2893 return; | 2893 return; |
2894 | 2894 |
2895 if (!oldForAttributeValue.isEmpty()) | 2895 if (!oldForAttributeValue.isEmpty()) |
2896 scope.removeLabel(oldForAttributeValue, toHTMLLabelElement(this)); | 2896 scope.removeLabel(oldForAttributeValue, toHTMLLabelElement(this)); |
2897 if (!newForAttributeValue.isEmpty()) | 2897 if (!newForAttributeValue.isEmpty()) |
2898 scope.addLabel(newForAttributeValue, toHTMLLabelElement(this)); | 2898 scope.addLabel(newForAttributeValue, toHTMLLabelElement(this)); |
2899 } | 2899 } |
2900 | 2900 |
2901 static bool hasSelectorForAttribute(Document* document, const AtomicString& loca
lName) | |
2902 { | |
2903 return document->ensureStyleResolver().ensureUpdatedRuleFeatureSet().hasSele
ctorForAttribute(localName); | |
2904 } | |
2905 | |
2906 void Element::willModifyAttribute(const QualifiedName& name, const AtomicString&
oldValue, const AtomicString& newValue) | 2901 void Element::willModifyAttribute(const QualifiedName& name, const AtomicString&
oldValue, const AtomicString& newValue) |
2907 { | 2902 { |
2908 if (isIdAttributeName(name)) { | 2903 if (isIdAttributeName(name)) { |
2909 updateId(oldValue, newValue); | 2904 updateId(oldValue, newValue); |
2910 } else if (name == HTMLNames::nameAttr) { | 2905 } else if (name == HTMLNames::nameAttr) { |
2911 updateName(oldValue, newValue); | 2906 updateName(oldValue, newValue); |
2912 } else if (name == HTMLNames::forAttr && isHTMLLabelElement(*this)) { | 2907 } else if (name == HTMLNames::forAttr && isHTMLLabelElement(*this)) { |
2913 TreeScope& scope = treeScope(); | 2908 TreeScope& scope = treeScope(); |
2914 if (scope.shouldCacheLabelsByForAttribute()) | 2909 if (scope.shouldCacheLabelsByForAttribute()) |
2915 updateLabel(scope, oldValue, newValue); | 2910 updateLabel(scope, oldValue, newValue); |
2916 } | 2911 } |
2917 | 2912 |
2918 if (oldValue != newValue) { | 2913 if (oldValue != newValue) { |
2919 if (inActiveDocument() && hasSelectorForAttribute(&document(), name.loca
lName())) | 2914 if (inActiveDocument()) |
2920 setNeedsStyleRecalc(SubtreeStyleChange); | 2915 document().ensureStyleResolver().ensureUpdatedRuleFeatureSet().sched
uleStyleInvalidationForAttributeChange(name, this); |
2921 | 2916 |
2922 if (isUpgradedCustomElement()) | 2917 if (isUpgradedCustomElement()) |
2923 CustomElement::attributeDidChange(this, name.localName(), oldValue,
newValue); | 2918 CustomElement::attributeDidChange(this, name.localName(), oldValue,
newValue); |
2924 } | 2919 } |
2925 | 2920 |
2926 if (OwnPtr<MutationObserverInterestGroup> recipients = MutationObserverInter
estGroup::createForAttributesMutation(*this, name)) | 2921 if (OwnPtr<MutationObserverInterestGroup> recipients = MutationObserverInter
estGroup::createForAttributesMutation(*this, name)) |
2927 recipients->enqueueMutationRecord(MutationRecord::createAttributes(this,
name, oldValue)); | 2922 recipients->enqueueMutationRecord(MutationRecord::createAttributes(this,
name, oldValue)); |
2928 | 2923 |
2929 InspectorInstrumentation::willModifyDOMAttr(this, oldValue, newValue); | 2924 InspectorInstrumentation::willModifyDOMAttr(this, oldValue, newValue); |
2930 } | 2925 } |
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3421 // Before doing so, we need to resolve issues in HTMLSelectElement::recalcLi
stItems | 3416 // Before doing so, we need to resolve issues in HTMLSelectElement::recalcLi
stItems |
3422 // and RenderMenuList::setText. See also https://bugs.webkit.org/show_bug.cg
i?id=88405 | 3417 // and RenderMenuList::setText. See also https://bugs.webkit.org/show_bug.cg
i?id=88405 |
3423 if (isHTMLOptionElement(*this) || isHTMLOptGroupElement(*this)) | 3418 if (isHTMLOptionElement(*this) || isHTMLOptGroupElement(*this)) |
3424 return false; | 3419 return false; |
3425 if (FullscreenElementStack::isActiveFullScreenElement(this)) | 3420 if (FullscreenElementStack::isActiveFullScreenElement(this)) |
3426 return false; | 3421 return false; |
3427 return true; | 3422 return true; |
3428 } | 3423 } |
3429 | 3424 |
3430 } // namespace WebCore | 3425 } // namespace WebCore |
OLD | NEW |