Merge from Chromium at DEPS revision r199464

This commit was generated by merge_to_master.py.

Change-Id: I19655f81f4534807b2fa07bc72b5208501b02896
diff --git a/Source/core/dom/Element.cpp b/Source/core/dom/Element.cpp
index 1ea9515..cd5ec55 100644
--- a/Source/core/dom/Element.cpp
+++ b/Source/core/dom/Element.cpp
@@ -33,7 +33,7 @@
 #include "core/css/CSSParser.h"
 #include "core/css/CSSSelectorList.h"
 #include "core/css/StylePropertySet.h"
-#include "core/css/StyleResolver.h"
+#include "core/css/resolver/StyleResolver.h"
 #include "core/dom/Attr.h"
 #include "core/dom/ClientRect.h"
 #include "core/dom/ClientRectList.h"
@@ -183,13 +183,6 @@
     return 0;
 }
 
-// Need a template since ElementShadow is not a Node, but has the style recalc methods.
-template<class T>
-static inline bool shouldRecalcStyle(Node::StyleChange change, const T* node)
-{
-    return change >= Node::Inherit || node->childNeedsStyleRecalc() || node->needsStyleRecalc();
-}
-
 PassRefPtr<Element> Element::create(const QualifiedName& tagName, Document* document)
 {
     return adoptRef(new Element(tagName, document, CreateElement));
@@ -340,6 +333,36 @@
     return rareData->attributeMap();
 }
 
+void Element::addActiveAnimation(Animation* animation)
+{
+    ElementRareData* rareData = ensureElementRareData();
+    if (!rareData->activeAnimations())
+        rareData->setActiveAnimations(adoptPtr(new Vector<Animation*>));
+    rareData->activeAnimations()->append(animation);
+}
+
+void Element::removeActiveAnimation(Animation* animation)
+{
+    ElementRareData* rareData = elementRareData();
+    ASSERT(rareData);
+    size_t position = rareData->activeAnimations()->find(animation);
+    ASSERT(position != notFound);
+    rareData->activeAnimations()->remove(position);
+}
+
+bool Element::hasActiveAnimations() const
+{
+    return hasRareData() && elementRareData()->activeAnimations()
+        && elementRareData()->activeAnimations()->size();
+}
+
+Vector<Animation*>* Element::activeAnimations() const
+{
+    if (!elementRareData())
+        return 0;
+    return elementRareData()->activeAnimations();
+}
+
 Node::NodeType Element::nodeType() const
 {
     return ELEMENT_NODE;
@@ -1555,7 +1578,6 @@
     case COMMENT_NODE:
     case PROCESSING_INSTRUCTION_NODE:
     case CDATA_SECTION_NODE:
-    case ENTITY_REFERENCE_NODE:
         return true;
     default:
         break;
@@ -2889,6 +2911,11 @@
     info.addMember(m_elementData, "elementData");
 }
 
+InputMethodContext* Element::getInputContext()
+{
+    return ensureElementRareData()->ensureInputMethodContext(toHTMLElement(this));
+}
+
 #if ENABLE(SVG)
 bool Element::hasPendingResources() const
 {