Commit c66b4401 authored by philipj@opera.com's avatar philipj@opera.com

Add a UseCounter for the Attr.value setter with associated Element

This will distinguish between setting the value on a newly created Attr
object from Document.createAttribute() and setting the value on an Attr
object already attached to an Element, e.g. one from Element.attributes.

If the first case is common but the second is rare it won't be possible
to make value readonly, but it could still be possible to drop the
Element association, which is the point of making it readonly.

BUG=none

Review URL: https://codereview.chromium.org/208333014

git-svn-id: svn://svn.chromium.org/blink/trunk@169844 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent fec20f20
......@@ -123,6 +123,8 @@ const AtomicString& Attr::valueForBindings() const
void Attr::setValueForBindings(const AtomicString& value)
{
UseCounter::count(document(), UseCounter::AttrSetValue);
if (m_element)
UseCounter::count(document(), UseCounter::AttrSetValueWithElement);
setValueInternal(value);
}
......
......@@ -317,6 +317,7 @@ public:
AnimationConstructorKeyframeListEffectObjectTiming = 300,
AnimationConstructorKeyframeListEffectDoubleTiming = 301,
AnimationConstructorKeyframeListEffectNoTiming = 302,
AttrSetValueWithElement = 303,
// Add new features immediately above this line. Don't change assigned
// numbers of any item, and don't reuse removed slots.
NumberOfFeatures, // This enum value must be last.
......
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