#include "config.h"
#include "core/svg/animation/SVGSMILElement.h"
-#include "bindings/v8/ExceptionStatePlaceholder.h"
-#include "bindings/v8/ScriptEventListener.h"
+#include "bindings/core/v8/ExceptionStatePlaceholder.h"
+#include "bindings/core/v8/ScriptEventListener.h"
#include "core/XLinkNames.h"
#include "core/dom/Document.h"
+#include "core/events/Event.h"
#include "core/events/EventListener.h"
#include "core/events/EventSender.h"
+#include "core/frame/UseCounter.h"
#include "core/svg/SVGDocumentExtensions.h"
#include "core/svg/SVGSVGElement.h"
#include "core/svg/SVGURIReference.h"
#include "wtf/StdLibExtras.h"
#include "wtf/Vector.h"
-namespace WebCore {
+namespace blink {
class RepeatEvent FINAL : public Event {
public:
SVGSMILElement::SVGSMILElement(const QualifiedName& tagName, Document& doc)
: SVGElement(tagName, doc)
+ , SVGTests(this)
, m_attributeName(anyQName())
, m_targetElement(nullptr)
, m_syncBaseConditionsConnected(false)
void SVGSMILElement::clearResourceAndEventBaseReferences()
{
- document().accessSVGExtensions().removeAllTargetReferencesForElement(this);
+ removeAllOutgoingReferences();
}
void SVGSMILElement::clearConditions()
} else {
// Register us with the target in the dependencies map. Any change of hrefElement
// that leads to relayout/repainting now informs us, so we can react to it.
- document().accessSVGExtensions().addElementReferencingTarget(this, svgTarget);
+ addReferenceTo(svgTarget);
}
connectEventBaseConditions();
}
if (!rootParent->inDocument())
return InsertionDone;
+ UseCounter::count(document(), UseCounter::SVGSMILElementInDocument);
+
setAttributeName(constructQualifiedName(this, fastGetAttribute(SVGNames::attributeNameAttr)));
SVGSVGElement* owner = ownerSVGElement();
if (!owner)
result = parse.left(parse.length() - 1).toDouble(&ok);
else
result = parse.toDouble(&ok);
- if (!ok)
+ if (!ok || !SMILTime(result).isFinite())
return SMILTime::unresolved();
return result;
}
} else
return parseOffsetValue(parse);
- if (!ok)
+ if (!ok || !SMILTime(result).isFinite())
return SMILTime::unresolved();
return result;
}
{
DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ());
if (supportedAttributes.isEmpty()) {
+ SVGTests::addSupportedAttributes(supportedAttributes);
supportedAttributes.add(SVGNames::beginAttr);
supportedAttributes.add(SVGNames::endAttr);
supportedAttributes.add(SVGNames::durAttr);
setAttributeEventListener(EventTypeNames::endEvent, createAttributeEventListener(this, name, value, eventParameterName()));
} else if (name == SVGNames::onrepeatAttr) {
setAttributeEventListener(EventTypeNames::repeatEvent, createAttributeEventListener(this, name, value, eventParameterName()));
- } else
- SVGElement::parseAttribute(name, value);
+ } else {
+ SVGElement::parseAttributeNew(name, value);
+ }
}
void SVGSMILElement::svgAttributeChanged(const QualifiedName& attrName)
ASSERT(!condition->eventListener());
condition->setEventListener(ConditionEventListener::create(this, condition));
eventBase->addEventListener(AtomicString(condition->name()), condition->eventListener(), false);
- document().accessSVGExtensions().addElementReferencingTarget(this, eventBase);
+ addReferenceTo(eventBase);
}
}
}
void SVGSMILElement::trace(Visitor* visitor)
{
+#if ENABLE(OILPAN)
visitor->trace(m_targetElement);
visitor->trace(m_timeContainer);
visitor->trace(m_conditions);
visitor->trace(m_syncBaseDependents);
+#endif
SVGElement::trace(visitor);
}