Commit e1ae116e authored by pdr@chromium.org's avatar pdr@chromium.org

Add a usecounter for SMIL elements in the document

The current SVGAnimation usecounter [1] is skewed by Modernizr [2] and
doesn't count the other animation types such as <animateMotion>. This
patch adds a new usecounter for SMIL animation elements that are in
the document. I manually confirmed this does not fire on the
Modernizr test page [3] whereas the old SVGAnimation counter does.

[1] http://www.chromestatus.com/metrics/feature/timeline/popularity/90
[2] https://github.com/Modernizr/Modernizr/blob/v2.8.3/modernizr.js#L832-L835
[3] http://modernizr.github.io/Modernizr/test/

BUG=258298

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

git-svn-id: svn://svn.chromium.org/blink/trunk@179191 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 3ec3a1a9
...@@ -490,6 +490,7 @@ public: ...@@ -490,6 +490,7 @@ public:
HTMLObjectElementStandby = 498, HTMLObjectElementStandby = 498,
HTMLTableCellElementChar = 499, HTMLTableCellElementChar = 499,
HTMLTableCellElementCharOff = 500, HTMLTableCellElementCharOff = 500,
SVGSMILElementInDocument = 501,
// Add new features immediately above this line. Don't change assigned // Add new features immediately above this line. Don't change assigned
// numbers of any item, and don't reuse removed slots. // numbers of any item, and don't reuse removed slots.
// Also, run update_use_counter_feature_enum.py in chromium/src/tools/metrics/histograms/ // Also, run update_use_counter_feature_enum.py in chromium/src/tools/metrics/histograms/
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#include "core/events/Event.h" #include "core/events/Event.h"
#include "core/events/EventListener.h" #include "core/events/EventListener.h"
#include "core/events/EventSender.h" #include "core/events/EventSender.h"
#include "core/frame/UseCounter.h"
#include "core/svg/SVGDocumentExtensions.h" #include "core/svg/SVGDocumentExtensions.h"
#include "core/svg/SVGSVGElement.h" #include "core/svg/SVGSVGElement.h"
#include "core/svg/SVGURIReference.h" #include "core/svg/SVGURIReference.h"
...@@ -313,6 +314,8 @@ Node::InsertionNotificationRequest SVGSMILElement::insertedInto(ContainerNode* r ...@@ -313,6 +314,8 @@ Node::InsertionNotificationRequest SVGSMILElement::insertedInto(ContainerNode* r
if (!rootParent->inDocument()) if (!rootParent->inDocument())
return InsertionDone; return InsertionDone;
UseCounter::count(document(), UseCounter::SVGSMILElementInDocument);
setAttributeName(constructQualifiedName(this, fastGetAttribute(SVGNames::attributeNameAttr))); setAttributeName(constructQualifiedName(this, fastGetAttribute(SVGNames::attributeNameAttr)));
SVGSVGElement* owner = ownerSVGElement(); SVGSVGElement* owner = ownerSVGElement();
if (!owner) if (!owner)
......
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