Merge from Chromium at DEPS revision 269336

This commit was generated by merge_to_master.py.

Change-Id: Ibf41f59c608fa0127526255ada8e255a93306a7e
diff --git a/Source/core/OWNERS b/Source/core/OWNERS
index c7815eb..9339172 100644
--- a/Source/core/OWNERS
+++ b/Source/core/OWNERS
@@ -44,11 +44,13 @@
 philipj@opera.com
 pkasting@chromium.org
 rob.buis@samsung.com
+rune@opera.com
 schenney@chromium.org
 senorblanco@chromium.org
 sigbjornf@opera.com
 steveblock@chromium.org
 thakis@chromium.org
+timloh@chromium.org
 tkent@chromium.org
 tony@chromium.org
 tonyg@chromium.org
diff --git a/Source/core/accessibility/AXRenderObject.cpp b/Source/core/accessibility/AXRenderObject.cpp
index 0c2efaa..9b02429 100644
--- a/Source/core/accessibility/AXRenderObject.cpp
+++ b/Source/core/accessibility/AXRenderObject.cpp
@@ -65,7 +65,7 @@
 #include "core/rendering/RenderTextFragment.h"
 #include "core/rendering/RenderView.h"
 #include "core/rendering/RenderWidget.h"
-#include "core/svg/SVGDocument.h"
+#include "core/svg/SVGDocumentExtensions.h"
 #include "core/svg/SVGSVGElement.h"
 #include "core/svg/graphics/SVGImage.h"
 #include "platform/text/PlatformLocale.h"
@@ -2024,7 +2024,7 @@
     if (!doc || !doc->isSVGDocument())
         return 0;
 
-    SVGSVGElement* rootElement = toSVGDocument(doc)->rootElement();
+    SVGSVGElement* rootElement = doc->accessSVGExtensions().rootElement();
     if (!rootElement)
         return 0;
     RenderObject* rendererRoot = rootElement->renderer();
diff --git a/Source/core/animation/ActiveAnimations.cpp b/Source/core/animation/ActiveAnimations.cpp
index e12cbdc..3509885 100644
--- a/Source/core/animation/ActiveAnimations.cpp
+++ b/Source/core/animation/ActiveAnimations.cpp
@@ -37,10 +37,6 @@
 
 ActiveAnimations::~ActiveAnimations()
 {
-}
-
-void ActiveAnimations::dispose()
-{
     for (size_t i = 0; i < m_animations.size(); ++i)
         m_animations[i]->notifyElementDestroyed();
     m_animations.clear();
@@ -96,6 +92,9 @@
 void ActiveAnimations::trace(Visitor* visitor)
 {
     visitor->trace(m_cssAnimations);
+#if ENABLE(OILPAN)
+    visitor->trace(m_target);
+#endif
 }
 
 } // namespace WebCore
diff --git a/Source/core/animation/ActiveAnimations.h b/Source/core/animation/ActiveAnimations.h
index 1a4c0a0..966f73c 100644
--- a/Source/core/animation/ActiveAnimations.h
+++ b/Source/core/animation/ActiveAnimations.h
@@ -53,7 +53,6 @@
     }
 
     ~ActiveAnimations();
-    void dispose();
 
     // Animations that are currently active for this element, their effects will be applied
     // during a style recalc. CSS Transitions are included in this stack.
@@ -94,6 +93,16 @@
     // won't be needed once Element and Animation are moved to Oilpan.
     Vector<Animation*> m_animations;
 
+#if ENABLE(OILPAN)
+    // Keep a back reference to the target Element, so that this object
+    // will be finalized during the same GC sweep as the target (as the
+    // Element keeps a reference in the other direction via its
+    // rare data.) This is done so that we can accurately notify the
+    // the Element as destroyed to the above vector of Animations in
+    // the ActiveAnimations finalizer.
+    Member<Element> m_target;
+#endif
+
     // CSSAnimations checks if a style change is due to animation.
     friend class CSSAnimations;
 };
diff --git a/Source/core/animation/AnimatableClipPathOperation.h b/Source/core/animation/AnimatableClipPathOperation.h
index 2cffa78..0a0188d 100644
--- a/Source/core/animation/AnimatableClipPathOperation.h
+++ b/Source/core/animation/AnimatableClipPathOperation.h
@@ -45,7 +45,7 @@
     }
     ClipPathOperation* clipPathOperation() const { return m_operation.get(); }
 
-    virtual void trace(Visitor*) OVERRIDE { }
+    virtual void trace(Visitor* visitor) OVERRIDE { AnimatableValue::trace(visitor); }
 
 protected:
     virtual PassRefPtrWillBeRawPtr<AnimatableValue> interpolateTo(const AnimatableValue*, double fraction) const OVERRIDE;
diff --git a/Source/core/animation/AnimatableColor.h b/Source/core/animation/AnimatableColor.h
index 5723248..87196a0 100644
--- a/Source/core/animation/AnimatableColor.h
+++ b/Source/core/animation/AnimatableColor.h
@@ -62,7 +62,7 @@
     Color color() const { return m_color.toColor(); }
     Color visitedLinkColor() const { return m_visitedLinkColor.toColor(); }
 
-    virtual void trace(Visitor*) OVERRIDE { }
+    virtual void trace(Visitor* visitor) OVERRIDE { AnimatableValue::trace(visitor); }
 
 protected:
     virtual PassRefPtrWillBeRawPtr<AnimatableValue> interpolateTo(const AnimatableValue*, double fraction) const OVERRIDE;
diff --git a/Source/core/animation/AnimatableDouble.cpp b/Source/core/animation/AnimatableDouble.cpp
index eaadd00..b27e515 100644
--- a/Source/core/animation/AnimatableDouble.cpp
+++ b/Source/core/animation/AnimatableDouble.cpp
@@ -31,18 +31,11 @@
 #include "config.h"
 #include "core/animation/AnimatableDouble.h"
 
-#include "core/css/CSSPrimitiveValue.h"
-#include "core/css/CSSValuePool.h"
 #include "platform/animation/AnimationUtilities.h"
 #include <math.h>
 
 namespace WebCore {
 
-PassRefPtrWillBeRawPtr<CSSValue> AnimatableDouble::toCSSValue() const
-{
-    return cssValuePool().createValue(m_number, CSSPrimitiveValue::CSS_NUMBER);
-}
-
 bool AnimatableDouble::usesDefaultInterpolationWith(const AnimatableValue* value) const
 {
     const AnimatableDouble* other = toAnimatableDouble(value);
diff --git a/Source/core/animation/AnimatableDouble.h b/Source/core/animation/AnimatableDouble.h
index 0d6496a..88ef247 100644
--- a/Source/core/animation/AnimatableDouble.h
+++ b/Source/core/animation/AnimatableDouble.h
@@ -32,7 +32,6 @@
 #define AnimatableDouble_h
 
 #include "core/animation/AnimatableValue.h"
-#include "core/css/CSSValue.h"
 
 namespace WebCore {
 
@@ -50,10 +49,9 @@
         return adoptRefWillBeNoop(new AnimatableDouble(number, constraint));
     }
 
-    PassRefPtrWillBeRawPtr<CSSValue> toCSSValue() const;
     double toDouble() const { return m_number; }
 
-    virtual void trace(Visitor*) OVERRIDE { }
+    virtual void trace(Visitor* visitor) OVERRIDE { AnimatableValue::trace(visitor); }
 
 protected:
     virtual PassRefPtrWillBeRawPtr<AnimatableValue> interpolateTo(const AnimatableValue*, double fraction) const OVERRIDE;
diff --git a/Source/core/animation/AnimatableDoubleTest.cpp b/Source/core/animation/AnimatableDoubleTest.cpp
index 1f6e8cc..f1948fb 100644
--- a/Source/core/animation/AnimatableDoubleTest.cpp
+++ b/Source/core/animation/AnimatableDoubleTest.cpp
@@ -31,8 +31,6 @@
 #include "config.h"
 #include "core/animation/AnimatableDouble.h"
 
-#include "core/css/CSSPrimitiveValue.h"
-
 #include <gtest/gtest.h>
 
 using namespace WebCore;
@@ -51,14 +49,6 @@
     EXPECT_FALSE(AnimatableDouble::create(5)->equals(AnimatableDouble::create(10).get()));
 }
 
-TEST(AnimationAnimatableDoubleTest, ToCSSValue)
-{
-    RefPtrWillBeRawPtr<CSSValue> cssValue5 = CSSPrimitiveValue::create(5, CSSPrimitiveValue::CSS_NUMBER);
-    RefPtrWillBeRawPtr<CSSValue> cssValue10 = CSSPrimitiveValue::create(10, CSSPrimitiveValue::CSS_NUMBER);
-    EXPECT_TRUE(AnimatableDouble::create(5)->toCSSValue()->equals(*cssValue5.get()));
-    EXPECT_FALSE(AnimatableDouble::create(5)->toCSSValue()->equals(*cssValue10.get()));
-}
-
 TEST(AnimationAnimatableDoubleTest, ToDouble)
 {
     EXPECT_EQ(5.9, AnimatableDouble::create(5.9)->toDouble());
diff --git a/Source/core/animation/AnimatableFilterOperations.h b/Source/core/animation/AnimatableFilterOperations.h
index 569d694..e047201 100644
--- a/Source/core/animation/AnimatableFilterOperations.h
+++ b/Source/core/animation/AnimatableFilterOperations.h
@@ -45,7 +45,7 @@
     }
     const FilterOperations& operations() const { return m_operations; }
 
-    virtual void trace(Visitor*) OVERRIDE { }
+    virtual void trace(Visitor* visitor) OVERRIDE { AnimatableValue::trace(visitor); }
 
 protected:
     virtual PassRefPtrWillBeRawPtr<AnimatableValue> interpolateTo(const AnimatableValue*, double fraction) const OVERRIDE;
diff --git a/Source/core/animation/AnimatableImage.h b/Source/core/animation/AnimatableImage.h
index c7e535c..e76b619 100644
--- a/Source/core/animation/AnimatableImage.h
+++ b/Source/core/animation/AnimatableImage.h
@@ -46,7 +46,11 @@
     }
     CSSValue* toCSSValue() const { return m_value.get(); }
 
-    virtual void trace(Visitor* visitor) OVERRIDE { visitor->trace(m_value); }
+    virtual void trace(Visitor* visitor) OVERRIDE
+    {
+        visitor->trace(m_value);
+        AnimatableValue::trace(visitor);
+    }
 
 protected:
     virtual PassRefPtrWillBeRawPtr<AnimatableValue> interpolateTo(const AnimatableValue*, double fraction) const OVERRIDE;
diff --git a/Source/core/animation/AnimatableLength.cpp b/Source/core/animation/AnimatableLength.cpp
index fcc2668..c167c20 100644
--- a/Source/core/animation/AnimatableLength.cpp
+++ b/Source/core/animation/AnimatableLength.cpp
@@ -31,127 +31,53 @@
 #include "config.h"
 #include "core/animation/AnimatableLength.h"
 
-#include "core/css/CSSPrimitiveValueMappings.h"
 #include "platform/CalculationValue.h"
 #include "platform/animation/AnimationUtilities.h"
 
 namespace WebCore {
 
-PassRefPtrWillBeRawPtr<AnimatableLength> AnimatableLength::create(CSSValue* value)
+namespace {
+
+double clampNumber(double value, ValueRange range)
 {
-    ASSERT(canCreateFrom(value));
-    if (value->isPrimitiveValue()) {
-        CSSPrimitiveValue* primitiveValue = WebCore::toCSSPrimitiveValue(value);
-        const CSSCalcValue* calcValue = primitiveValue->cssCalcValue();
-        if (calcValue)
-            return create(calcValue->expressionNode(), primitiveValue);
-        CSSPrimitiveValue::LengthUnitType unitType;
-        bool isPrimitiveLength = CSSPrimitiveValue::unitTypeToLengthUnitType(primitiveValue->primitiveType(), unitType);
-        ASSERT_UNUSED(isPrimitiveLength, isPrimitiveLength);
-        const double scale = CSSPrimitiveValue::conversionToCanonicalUnitsScaleFactor(primitiveValue->primitiveType());
-        return create(primitiveValue->getDoubleValue() * scale, unitType, primitiveValue);
-    }
-
-    if (value->isCalcValue())
-        return create(toCSSCalcValue(value)->expressionNode());
-
-    ASSERT_NOT_REACHED();
-    return nullptr;
+    if (range == ValueRangeNonNegative)
+        return std::max(value, 0.0);
+    ASSERT(range == ValueRangeAll);
+    return value;
 }
 
-bool AnimatableLength::canCreateFrom(const CSSValue* value)
-{
-    ASSERT(value);
-    if (value->isPrimitiveValue()) {
-        const CSSPrimitiveValue* primitiveValue = WebCore::toCSSPrimitiveValue(value);
-        if (primitiveValue->cssCalcValue())
-            return true;
+} // namespace
 
-        CSSPrimitiveValue::LengthUnitType type;
-        // Only returns true if the type is a primitive length unit.
-        return CSSPrimitiveValue::unitTypeToLengthUnitType(primitiveValue->primitiveType(), type);
-    }
-    return value->isCalcValue();
+AnimatableLength::AnimatableLength(const Length& length, float zoom)
+{
+    ASSERT(zoom);
+    PixelsAndPercent pixelsAndPercent = length.pixelsAndPercent();
+    m_pixels = pixelsAndPercent.pixels / zoom;
+    m_percent = pixelsAndPercent.percent;
+    m_hasPixels = length.type() != Percent;
+    m_hasPercent = !length.isFixed();
 }
 
-PassRefPtrWillBeRawPtr<CSSValue> AnimatableLength::toCSSValue(NumberRange range) const
+Length AnimatableLength::length(float zoom, ValueRange range) const
 {
-    return toCSSPrimitiveValue(range);
-}
-
-Length AnimatableLength::toLength(const CSSToLengthConversionData& conversionData, NumberRange range) const
-{
-    // Avoid creating a CSSValue in the common cases
-    if (m_lengthUnitType == CSSPrimitiveValue::UnitTypePixels)
-        return Length(clampedNumber(range) * conversionData.zoom(), Fixed);
-    if (m_lengthUnitType == CSSPrimitiveValue::UnitTypePercentage)
-        return Length(clampedNumber(range), Percent);
-
-    return toCSSPrimitiveValue(range)->convertToLength<AnyConversion>(conversionData);
+    if (!m_hasPercent)
+        return Length(clampNumber(m_pixels, range) * zoom, Fixed);
+    if (!m_hasPixels)
+        return Length(clampNumber(m_percent, range), Percent);
+    return Length(CalculationValue::create(PixelsAndPercent(m_pixels * zoom, m_percent), range));
 }
 
 PassRefPtrWillBeRawPtr<AnimatableValue> AnimatableLength::interpolateTo(const AnimatableValue* value, double fraction) const
 {
     const AnimatableLength* length = toAnimatableLength(value);
-    CSSPrimitiveValue::LengthUnitType type = commonUnitType(length);
-    if (!isCalc(type))
-        return AnimatableLength::create(blend(m_lengthValue, length->m_lengthValue, fraction), type);
-    return AnimatableLength::create(scale(1 - fraction).get(), length->scale(fraction).get());
+    return create(blend(m_pixels, length->m_pixels, fraction), blend(m_percent, length->m_percent, fraction),
+        m_hasPixels || length->m_hasPixels, m_hasPercent || length->m_hasPercent);
 }
 
 bool AnimatableLength::equalTo(const AnimatableValue* value) const
 {
     const AnimatableLength* length = toAnimatableLength(value);
-    if (m_lengthUnitType != length->m_lengthUnitType)
-        return false;
-    if (isCalc())
-        return m_calcExpression == length->m_calcExpression || m_calcExpression->equals(*length->m_calcExpression);
-    return m_lengthValue == length->m_lengthValue;
-}
-
-PassRefPtrWillBeRawPtr<CSSCalcExpressionNode> AnimatableLength::toCSSCalcExpressionNode() const
-{
-    if (isCalc())
-        return m_calcExpression;
-    return CSSCalcValue::createExpressionNode(toCSSPrimitiveValue(AllValues), m_lengthValue == trunc(m_lengthValue));
-}
-
-static bool isCompatibleWithRange(const CSSPrimitiveValue* primitiveValue, NumberRange range)
-{
-    ASSERT(primitiveValue);
-    if (range == AllValues)
-        return true;
-    if (primitiveValue->isCalculated())
-        return primitiveValue->cssCalcValue()->permittedValueRange() == ValueRangeNonNegative;
-    return primitiveValue->getDoubleValue() >= 0;
-}
-
-PassRefPtrWillBeRawPtr<CSSPrimitiveValue> AnimatableLength::toCSSPrimitiveValue(NumberRange range) const
-{
-    if (!m_cachedCSSPrimitiveValue || !isCompatibleWithRange(m_cachedCSSPrimitiveValue.get(), range)) {
-        if (isCalc())
-            m_cachedCSSPrimitiveValue = CSSPrimitiveValue::create(CSSCalcValue::create(m_calcExpression, range == AllValues ? ValueRangeAll : ValueRangeNonNegative));
-        else
-            m_cachedCSSPrimitiveValue = CSSPrimitiveValue::create(clampedNumber(range), static_cast<CSSPrimitiveValue::UnitTypes>(CSSPrimitiveValue::lengthUnitTypeToUnitType(m_lengthUnitType)));
-    }
-    return m_cachedCSSPrimitiveValue;
-}
-
-PassRefPtrWillBeRawPtr<AnimatableLength> AnimatableLength::scale(double factor) const
-{
-    if (isCalc()) {
-        return AnimatableLength::create(CSSCalcValue::createExpressionNode(
-            m_calcExpression,
-            CSSCalcValue::createExpressionNode(CSSPrimitiveValue::create(factor, CSSPrimitiveValue::CSS_NUMBER)),
-            CalcMultiply));
-    }
-    return AnimatableLength::create(m_lengthValue * factor, m_lengthUnitType);
-}
-
-void AnimatableLength::trace(Visitor* visitor)
-{
-    visitor->trace(m_calcExpression);
-    visitor->trace(m_cachedCSSPrimitiveValue);
+    return m_pixels == length->m_pixels && m_percent == length->m_percent && m_hasPixels == length->m_hasPixels && m_hasPercent == length->m_hasPercent;
 }
 
 } // namespace WebCore
diff --git a/Source/core/animation/AnimatableLength.h b/Source/core/animation/AnimatableLength.h
index adfb136..754c043 100644
--- a/Source/core/animation/AnimatableLength.h
+++ b/Source/core/animation/AnimatableLength.h
@@ -32,109 +32,44 @@
 #define AnimatableLength_h
 
 #include "core/animation/AnimatableValue.h"
-#include "core/css/CSSCalculationValue.h"
-#include "core/css/CSSPrimitiveValue.h"
 #include "platform/Length.h"
 
 namespace WebCore {
 
-enum NumberRange {
-    AllValues,
-    NonNegativeValues,
-};
-
-// Handles animation of CSS length and percentage values including CSS calc.
-// See primitiveUnitToLengthType() for the list of supported units.
-// If created from a CSSPrimitiveValue this class will cache it to be returned in toCSSValue().
 class AnimatableLength FINAL : public AnimatableValue {
 public:
-    virtual ~AnimatableLength() { }
-    static bool canCreateFrom(const CSSValue*);
-    static PassRefPtrWillBeRawPtr<AnimatableLength> create(CSSValue*);
-    static PassRefPtrWillBeRawPtr<AnimatableLength> create(double number, CSSPrimitiveValue::LengthUnitType unitType, CSSPrimitiveValue* cssPrimitiveValue = 0)
+    static PassRefPtrWillBeRawPtr<AnimatableLength> create(const Length& length, float zoom)
     {
-        return adoptRefWillBeNoop(new AnimatableLength(number, unitType, cssPrimitiveValue));
+        return adoptRefWillBeNoop(new AnimatableLength(length, zoom));
     }
-    static PassRefPtrWillBeRawPtr<AnimatableLength> create(PassRefPtrWillBeRawPtr<CSSCalcExpressionNode> calcExpression, CSSPrimitiveValue* cssPrimitiveValue = 0)
-    {
-        return adoptRefWillBeNoop(new AnimatableLength(calcExpression, cssPrimitiveValue));
-    }
-    PassRefPtrWillBeRawPtr<CSSValue> toCSSValue(NumberRange = AllValues) const;
-    Length toLength(const CSSToLengthConversionData&, NumberRange = AllValues) const;
-
-    virtual void trace(Visitor*) OVERRIDE;
+    Length length(float zoom, ValueRange) const;
 
 protected:
     virtual PassRefPtrWillBeRawPtr<AnimatableValue> interpolateTo(const AnimatableValue*, double fraction) const OVERRIDE;
 
 private:
-    AnimatableLength(double number, CSSPrimitiveValue::LengthUnitType unitType, CSSPrimitiveValue* cssPrimitiveValue)
-        : m_lengthValue(number)
-        , m_lengthUnitType(unitType)
-        , m_cachedCSSPrimitiveValue(cssPrimitiveValue)
+    static PassRefPtrWillBeRawPtr<AnimatableLength> create(double pixels, double percent, bool hasPixels, bool hasPercent)
     {
-        ASSERT(!isCalc());
+        return adoptRefWillBeNoop(new AnimatableLength(pixels, percent, hasPixels, hasPercent));
     }
-    AnimatableLength(PassRefPtrWillBeRawPtr<CSSCalcExpressionNode> calcExpression, CSSPrimitiveValue* cssPrimitiveValue)
-        : m_lengthUnitType(CSSPrimitiveValue::UnitTypeCalc)
-        , m_calcExpression(calcExpression)
-        , m_cachedCSSPrimitiveValue(cssPrimitiveValue)
+    AnimatableLength(const Length&, float zoom);
+    AnimatableLength(double pixels, double percent, bool hasPixels, bool hasPercent)
+        : m_pixels(pixels)
+        , m_percent(percent)
+        , m_hasPixels(hasPixels)
+        , m_hasPercent(hasPercent)
     {
-        ASSERT(isCalc());
-        ASSERT(m_calcExpression);
+        ASSERT(m_hasPixels || m_hasPercent);
     }
     virtual AnimatableType type() const OVERRIDE { return TypeLength; }
     virtual bool equalTo(const AnimatableValue*) const OVERRIDE;
 
-    static bool isCalc(CSSPrimitiveValue::LengthUnitType type) { return type == CSSPrimitiveValue::UnitTypeCalc; }
-    bool isCalc() const { return isCalc(m_lengthUnitType); }
+    virtual void trace(Visitor* visitor) OVERRIDE { AnimatableValue::trace(visitor); }
 
-    static PassRefPtrWillBeRawPtr<AnimatableLength> create(const AnimatableLength* leftAddend, const AnimatableLength* rightAddend)
-    {
-        ASSERT(leftAddend && rightAddend);
-        return create(CSSCalcValue::createExpressionNode(leftAddend->toCSSCalcExpressionNode(), rightAddend->toCSSCalcExpressionNode(), CalcAdd));
-    }
-
-    PassRefPtrWillBeRawPtr<CSSPrimitiveValue> toCSSPrimitiveValue(NumberRange) const;
-    PassRefPtrWillBeRawPtr<CSSCalcExpressionNode> toCSSCalcExpressionNode() const;
-
-    PassRefPtrWillBeRawPtr<AnimatableLength> scale(double) const;
-    double clampedNumber(NumberRange range) const
-    {
-        ASSERT(!isCalc());
-        return (range == NonNegativeValues && m_lengthValue <= 0) ? 0 : m_lengthValue;
-    }
-
-    // Zero is effectively unitless, except in the case of percentage.
-    // http://www.w3.org/TR/css3-values/#calc-computed-value
-    // e.g. calc(100% - 100% + 1em) resolves to calc(0% + 1em), not to calc(1em)
-    bool isUnitlessZero() const
-    {
-        return !isCalc() && !m_lengthValue && m_lengthUnitType != CSSPrimitiveValue::UnitTypePercentage;
-    }
-
-    CSSPrimitiveValue::LengthUnitType commonUnitType(const AnimatableLength* length) const
-    {
-        if (m_lengthUnitType == length->m_lengthUnitType)
-            return m_lengthUnitType;
-
-        if (isUnitlessZero())
-            return length->m_lengthUnitType;
-        if (length->isUnitlessZero())
-            return m_lengthUnitType;
-
-        return CSSPrimitiveValue::UnitTypeCalc;
-    }
-
-    double m_lengthValue;
-    const CSSPrimitiveValue::LengthUnitType m_lengthUnitType;
-
-    RefPtrWillBeMember<CSSCalcExpressionNode> m_calcExpression;
-
-    mutable RefPtrWillBeMember<CSSPrimitiveValue> m_cachedCSSPrimitiveValue;
-
-    friend class AnimationAnimatableLengthTest;
-    friend class LengthStyleInterpolation;
+    double m_pixels;
+    double m_percent;
+    bool m_hasPixels;
+    bool m_hasPercent;
 };
 
 DEFINE_ANIMATABLE_VALUE_TYPE_CASTS(AnimatableLength, isLength());
diff --git a/Source/core/animation/AnimatableLengthBox.cpp b/Source/core/animation/AnimatableLengthBox.cpp
index ebf760e..2589621 100644
--- a/Source/core/animation/AnimatableLengthBox.cpp
+++ b/Source/core/animation/AnimatableLengthBox.cpp
@@ -58,6 +58,7 @@
     visitor->trace(m_right);
     visitor->trace(m_top);
     visitor->trace(m_bottom);
+    AnimatableValue::trace(visitor);
 }
 
 }
diff --git a/Source/core/animation/AnimatableLengthBoxAndBool.cpp b/Source/core/animation/AnimatableLengthBoxAndBool.cpp
index 8aec4d7..c598ec4 100644
--- a/Source/core/animation/AnimatableLengthBoxAndBool.cpp
+++ b/Source/core/animation/AnimatableLengthBoxAndBool.cpp
@@ -61,6 +61,7 @@
 void AnimatableLengthBoxAndBool::trace(Visitor* visitor)
 {
     visitor->trace(m_box);
+    AnimatableValue::trace(visitor);
 }
 
 }
diff --git a/Source/core/animation/AnimatableLengthPoint.cpp b/Source/core/animation/AnimatableLengthPoint.cpp
index e47279e..b8805d0 100644
--- a/Source/core/animation/AnimatableLengthPoint.cpp
+++ b/Source/core/animation/AnimatableLengthPoint.cpp
@@ -51,6 +51,7 @@
 {
     visitor->trace(m_x);
     visitor->trace(m_y);
+    AnimatableValue::trace(visitor);
 }
 
 }
diff --git a/Source/core/animation/AnimatableLengthPoint3D.cpp b/Source/core/animation/AnimatableLengthPoint3D.cpp
index da031a3..402f0a8 100644
--- a/Source/core/animation/AnimatableLengthPoint3D.cpp
+++ b/Source/core/animation/AnimatableLengthPoint3D.cpp
@@ -53,6 +53,7 @@
     visitor->trace(m_x);
     visitor->trace(m_y);
     visitor->trace(m_z);
+    AnimatableValue::trace(visitor);
 }
 
 }
diff --git a/Source/core/animation/AnimatableLengthSize.cpp b/Source/core/animation/AnimatableLengthSize.cpp
index 79f52e1..c632395 100644
--- a/Source/core/animation/AnimatableLengthSize.cpp
+++ b/Source/core/animation/AnimatableLengthSize.cpp
@@ -51,6 +51,7 @@
 {
     visitor->trace(m_width);
     visitor->trace(m_height);
+    AnimatableValue::trace(visitor);
 }
 
 }
diff --git a/Source/core/animation/AnimatableLengthTest.cpp b/Source/core/animation/AnimatableLengthTest.cpp
index 48d8ec6..c5887e2 100644
--- a/Source/core/animation/AnimatableLengthTest.cpp
+++ b/Source/core/animation/AnimatableLengthTest.cpp
@@ -1,318 +1,73 @@
-/*
- * Copyright (c) 2013, Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- *     * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
 
 #include "config.h"
 
 #include "core/animation/AnimatableLength.h"
-
-#include "core/animation/AnimatableValueTestHelper.h"
-#include "core/css/CSSCalculationValue.h"
-#include "core/css/CSSPrimitiveValue.h"
-#include "core/css/CSSToLengthConversionData.h"
-#include "core/rendering/style/RenderStyle.h"
-#include "core/rendering/style/StyleInheritedData.h"
 #include "platform/CalculationValue.h"
-#include "wtf/MathExtras.h"
 
 #include <gtest/gtest.h>
 
-#define EXPECT_ROUNDTRIP(a, f) EXPECT_REFV_EQ(a, f(a.get()))
-
 namespace WebCore {
 
-class AnimationAnimatableLengthTest : public ::testing::Test {
-protected:
-    AnimationAnimatableLengthTest()
-        : style(RenderStyle::createDefaultStyle())
-        , conversionDataZoom1(style.get(), style.get(), 0, 0, 1.0f)
-        , conversionDataZoom3(style.get(), style.get(), 0, 0, 3.0f)
+namespace {
+
+    PassRefPtrWillBeRawPtr<AnimatableLength> create(const Length& length, double zoom = 1)
     {
+        return AnimatableLength::create(length, zoom);
     }
 
-    PassRefPtrWillBeRawPtr<AnimatableLength> create(double value, CSSPrimitiveValue::UnitTypes type)
-    {
-        return AnimatableLength::create(CSSPrimitiveValue::create(value, type).get());
-    }
+} // namespace
 
-    PassRefPtrWillBeRawPtr<AnimatableLength> create(double valueLeft, CSSPrimitiveValue::UnitTypes typeLeft, double valueRight, CSSPrimitiveValue::UnitTypes typeRight)
-    {
-        return AnimatableLength::create(createCalc(valueLeft, typeLeft, valueRight, typeRight).get());
-    }
-
-    PassRefPtrWillBeRawPtr<CSSCalcValue> createCalc(double valueLeft, CSSPrimitiveValue::UnitTypes typeLeft, double valueRight, CSSPrimitiveValue::UnitTypes typeRight)
-    {
-        return CSSCalcValue::create(CSSCalcValue::createExpressionNode(
-            CSSCalcValue::createExpressionNode(CSSPrimitiveValue::create(valueLeft, typeLeft), valueLeft == trunc(valueLeft)),
-            CSSCalcValue::createExpressionNode(CSSPrimitiveValue::create(valueRight, typeRight), valueRight == trunc(valueRight)),
-            CalcAdd
-        ));
-    }
-
-    PassRefPtrWillBeRawPtr<CSSValue> toCSSValue(CSSValue* cssValue)
-    {
-        return AnimatableLength::create(cssValue)->toCSSValue();
-    }
-
-    CSSPrimitiveValue::LengthUnitType commonUnitType(PassRefPtrWillBeRawPtr<AnimatableLength> a, PassRefPtrWillBeRawPtr<AnimatableLength> b)
-    {
-        return a->commonUnitType(b.get());
-    }
-
-    bool isUnitlessZero(PassRefPtrWillBeRawPtr<AnimatableLength> a)
-    {
-        return a->isUnitlessZero();
-    }
-
-    RefPtr<RenderStyle> style;
-    CSSToLengthConversionData conversionDataZoom1;
-    CSSToLengthConversionData conversionDataZoom3;
-};
-
-TEST_F(AnimationAnimatableLengthTest, CanCreateFrom)
+TEST(AnimationAnimatableLengthTest, RoundTripConversion)
 {
-    EXPECT_TRUE(AnimatableLength::canCreateFrom(CSSPrimitiveValue::create(5, CSSPrimitiveValue::CSS_PX).get()));
-    EXPECT_TRUE(AnimatableLength::canCreateFrom(CSSPrimitiveValue::create(5, CSSPrimitiveValue::CSS_CM).get()));
-    EXPECT_TRUE(AnimatableLength::canCreateFrom(CSSPrimitiveValue::create(5, CSSPrimitiveValue::CSS_MM).get()));
-    EXPECT_TRUE(AnimatableLength::canCreateFrom(CSSPrimitiveValue::create(5, CSSPrimitiveValue::CSS_IN).get()));
-    EXPECT_TRUE(AnimatableLength::canCreateFrom(CSSPrimitiveValue::create(5, CSSPrimitiveValue::CSS_PT).get()));
-    EXPECT_TRUE(AnimatableLength::canCreateFrom(CSSPrimitiveValue::create(5, CSSPrimitiveValue::CSS_PC).get()));
-    EXPECT_TRUE(AnimatableLength::canCreateFrom(CSSPrimitiveValue::create(5, CSSPrimitiveValue::CSS_EMS).get()));
-    EXPECT_TRUE(AnimatableLength::canCreateFrom(CSSPrimitiveValue::create(5, CSSPrimitiveValue::CSS_EXS).get()));
-    EXPECT_TRUE(AnimatableLength::canCreateFrom(CSSPrimitiveValue::create(5, CSSPrimitiveValue::CSS_REMS).get()));
-    EXPECT_TRUE(AnimatableLength::canCreateFrom(CSSPrimitiveValue::create(5, CSSPrimitiveValue::CSS_PERCENTAGE).get()));
-    EXPECT_TRUE(AnimatableLength::canCreateFrom(CSSPrimitiveValue::create(5, CSSPrimitiveValue::CSS_VW).get()));
-    EXPECT_TRUE(AnimatableLength::canCreateFrom(CSSPrimitiveValue::create(5, CSSPrimitiveValue::CSS_VH).get()));
-    EXPECT_TRUE(AnimatableLength::canCreateFrom(CSSPrimitiveValue::create(5, CSSPrimitiveValue::CSS_VMIN).get()));
-    EXPECT_TRUE(AnimatableLength::canCreateFrom(CSSPrimitiveValue::create(5, CSSPrimitiveValue::CSS_VMAX).get()));
-
-    EXPECT_TRUE(AnimatableLength::canCreateFrom(createCalc(3, CSSPrimitiveValue::CSS_PX, 5, CSSPrimitiveValue::CSS_CM).get()));
-    EXPECT_TRUE(AnimatableLength::canCreateFrom(CSSPrimitiveValue::create(createCalc(3, CSSPrimitiveValue::CSS_PX, 5, CSSPrimitiveValue::CSS_CM)).get()));
-
-    EXPECT_FALSE(AnimatableLength::canCreateFrom(CSSPrimitiveValue::create("NaN", CSSPrimitiveValue::CSS_STRING).get()));
+    EXPECT_EQ(Length(0, Fixed), create(Length(0, Fixed))->length(1, ValueRangeAll));
+    EXPECT_EQ(Length(0, Percent), create(Length(0, Percent))->length(1, ValueRangeAll));
+    EXPECT_EQ(Length(10, Fixed), create(Length(10, Fixed))->length(1, ValueRangeAll));
+    EXPECT_EQ(Length(10, Percent), create(Length(10, Percent))->length(1, ValueRangeAll));
+    EXPECT_EQ(Length(-10, Fixed), create(Length(-10, Fixed))->length(1, ValueRangeAll));
+    EXPECT_EQ(Length(-10, Percent), create(Length(-10, Percent))->length(1, ValueRangeAll));
+    Length calc = Length(CalculationValue::create(PixelsAndPercent(5, 10), ValueRangeAll));
+    EXPECT_EQ(calc, create(calc)->length(1, ValueRangeAll));
 }
 
-TEST_F(AnimationAnimatableLengthTest, Create)
+TEST(AnimationAnimatableLengthTest, ValueRangeNonNegative)
 {
-    EXPECT_TRUE(static_cast<bool>(create(5, CSSPrimitiveValue::CSS_PX).get()));
-    EXPECT_TRUE(static_cast<bool>(create(5, CSSPrimitiveValue::CSS_CM).get()));
-    EXPECT_TRUE(static_cast<bool>(create(5, CSSPrimitiveValue::CSS_MM).get()));
-    EXPECT_TRUE(static_cast<bool>(create(5, CSSPrimitiveValue::CSS_IN).get()));
-    EXPECT_TRUE(static_cast<bool>(create(5, CSSPrimitiveValue::CSS_PT).get()));
-    EXPECT_TRUE(static_cast<bool>(create(5, CSSPrimitiveValue::CSS_PC).get()));
-    EXPECT_TRUE(static_cast<bool>(create(5, CSSPrimitiveValue::CSS_EMS).get()));
-    EXPECT_TRUE(static_cast<bool>(create(5, CSSPrimitiveValue::CSS_EXS).get()));
-    EXPECT_TRUE(static_cast<bool>(create(5, CSSPrimitiveValue::CSS_REMS).get()));
-    EXPECT_TRUE(static_cast<bool>(create(5, CSSPrimitiveValue::CSS_PERCENTAGE).get()));
-    EXPECT_TRUE(static_cast<bool>(create(5, CSSPrimitiveValue::CSS_VW).get()));
-    EXPECT_TRUE(static_cast<bool>(create(5, CSSPrimitiveValue::CSS_VH).get()));
-    EXPECT_TRUE(static_cast<bool>(create(5, CSSPrimitiveValue::CSS_VMIN).get()));
-    EXPECT_TRUE(static_cast<bool>(create(5, CSSPrimitiveValue::CSS_VMAX).get()));
-
-    EXPECT_TRUE(static_cast<bool>(
-        AnimatableLength::create(createCalc(3, CSSPrimitiveValue::CSS_PX, 5, CSSPrimitiveValue::CSS_CM).get()).get()
-    ));
-    EXPECT_TRUE(static_cast<bool>(
-        AnimatableLength::create(CSSPrimitiveValue::create(createCalc(3, CSSPrimitiveValue::CSS_PX, 5, CSSPrimitiveValue::CSS_CM)).get()).get()
-    ));
+    EXPECT_EQ(Length(10, Fixed), create(Length(10, Fixed))->length(1, ValueRangeNonNegative));
+    EXPECT_EQ(Length(10, Percent), create(Length(10, Percent))->length(1, ValueRangeNonNegative));
+    EXPECT_EQ(Length(0, Fixed), create(Length(-10, Fixed))->length(1, ValueRangeNonNegative));
+    EXPECT_EQ(Length(0, Percent), create(Length(-10, Percent))->length(1, ValueRangeNonNegative));
+    Length calc = Length(CalculationValue::create(PixelsAndPercent(-5, -10), ValueRangeNonNegative));
+    EXPECT_TRUE(calc == create(calc)->length(1, ValueRangeNonNegative));
 }
 
-
-TEST_F(AnimationAnimatableLengthTest, ToCSSValue)
+TEST(AnimationAnimatableLengthTest, Zoom)
 {
-
-    EXPECT_ROUNDTRIP(CSSPrimitiveValue::create(-5, CSSPrimitiveValue::CSS_PX), toCSSValue);
-    EXPECT_ROUNDTRIP(CSSPrimitiveValue::create(-5, CSSPrimitiveValue::CSS_CM), toCSSValue);
-    EXPECT_ROUNDTRIP(CSSPrimitiveValue::create(-5, CSSPrimitiveValue::CSS_MM), toCSSValue);
-    EXPECT_ROUNDTRIP(CSSPrimitiveValue::create(-5, CSSPrimitiveValue::CSS_IN), toCSSValue);
-    EXPECT_ROUNDTRIP(CSSPrimitiveValue::create(-5, CSSPrimitiveValue::CSS_PT), toCSSValue);
-    EXPECT_ROUNDTRIP(CSSPrimitiveValue::create(-5, CSSPrimitiveValue::CSS_PC), toCSSValue);
-    EXPECT_ROUNDTRIP(CSSPrimitiveValue::create(-5, CSSPrimitiveValue::CSS_EMS), toCSSValue);
-    EXPECT_ROUNDTRIP(CSSPrimitiveValue::create(-5, CSSPrimitiveValue::CSS_EXS), toCSSValue);
-    EXPECT_ROUNDTRIP(CSSPrimitiveValue::create(-5, CSSPrimitiveValue::CSS_REMS), toCSSValue);
-    EXPECT_ROUNDTRIP(CSSPrimitiveValue::create(-5, CSSPrimitiveValue::CSS_PERCENTAGE), toCSSValue);
-    EXPECT_ROUNDTRIP(CSSPrimitiveValue::create(-5, CSSPrimitiveValue::CSS_VW), toCSSValue);
-    EXPECT_ROUNDTRIP(CSSPrimitiveValue::create(-5, CSSPrimitiveValue::CSS_VH), toCSSValue);
-    EXPECT_ROUNDTRIP(CSSPrimitiveValue::create(-5, CSSPrimitiveValue::CSS_VMIN), toCSSValue);
-    EXPECT_ROUNDTRIP(CSSPrimitiveValue::create(-5, CSSPrimitiveValue::CSS_VMAX), toCSSValue);
-
-    EXPECT_ROUNDTRIP(CSSPrimitiveValue::create(createCalc(3, CSSPrimitiveValue::CSS_PX, 5, CSSPrimitiveValue::CSS_IN)), toCSSValue);
-    EXPECT_ROUNDTRIP(CSSPrimitiveValue::create(createCalc(3, CSSPrimitiveValue::CSS_PX, 5, CSSPrimitiveValue::CSS_IN)), toCSSValue);
+    EXPECT_EQ(Length(4, Fixed), create(Length(10, Fixed), 5)->length(2, ValueRangeAll));
+    EXPECT_EQ(Length(10, Percent), create(Length(10, Percent), 5)->length(2, ValueRangeAll));
+    Length calc = Length(CalculationValue::create(PixelsAndPercent(5, 10), ValueRangeAll));
+    Length result = Length(CalculationValue::create(PixelsAndPercent(2, 10), ValueRangeAll));
+    EXPECT_TRUE(result == create(calc, 5)->length(2, ValueRangeAll));
 }
 
-
-TEST_F(AnimationAnimatableLengthTest, ToLength)
+TEST(AnimationAnimatableLengthTest, Equals)
 {
-    EXPECT_EQ(Length(-5, WebCore::Fixed), create(-5, CSSPrimitiveValue::CSS_PX)->toLength(conversionDataZoom1));
-    EXPECT_EQ(Length(-15, WebCore::Fixed), create(-5, CSSPrimitiveValue::CSS_PX)->toLength(conversionDataZoom3));
-    EXPECT_EQ(Length(0, WebCore::Fixed), create(-5, CSSPrimitiveValue::CSS_PX)->toLength(conversionDataZoom1, NonNegativeValues));
-    EXPECT_EQ(Length(0, WebCore::Fixed), create(-5, CSSPrimitiveValue::CSS_PX)->toLength(conversionDataZoom3, NonNegativeValues));
-
-    EXPECT_EQ(Length(-5, Percent), create(-5, CSSPrimitiveValue::CSS_PERCENTAGE)->toLength(conversionDataZoom1));
-    EXPECT_EQ(Length(-5, Percent), create(-5, CSSPrimitiveValue::CSS_PERCENTAGE)->toLength(conversionDataZoom3));
-    EXPECT_EQ(Length(0, Percent), create(-5, CSSPrimitiveValue::CSS_PERCENTAGE)->toLength(conversionDataZoom1, NonNegativeValues));
-    EXPECT_EQ(Length(0, Percent), create(-5, CSSPrimitiveValue::CSS_PERCENTAGE)->toLength(conversionDataZoom3, NonNegativeValues));
-
-    EXPECT_EQ(
-        Length(CalculationValue::create(PixelsAndPercent(-5, -5), ValueRangeAll)),
-        create(-5, CSSPrimitiveValue::CSS_PX, -5, CSSPrimitiveValue::CSS_PERCENTAGE)->toLength(conversionDataZoom1));
-    EXPECT_EQ(
-        Length(CalculationValue::create(PixelsAndPercent(-15, -5), ValueRangeAll)),
-        create(-5, CSSPrimitiveValue::CSS_PX, -5, CSSPrimitiveValue::CSS_PERCENTAGE)->toLength(conversionDataZoom3));
-    EXPECT_EQ(
-        Length(CalculationValue::create(PixelsAndPercent(-5, -5), ValueRangeNonNegative)),
-        create(-5, CSSPrimitiveValue::CSS_PX, -5, CSSPrimitiveValue::CSS_PERCENTAGE)->toLength(conversionDataZoom1, NonNegativeValues));
-    EXPECT_EQ(
-        Length(CalculationValue::create(PixelsAndPercent(-15, -5), ValueRangeNonNegative)),
-        create(-5, CSSPrimitiveValue::CSS_PX, -5, CSSPrimitiveValue::CSS_PERCENTAGE)->toLength(conversionDataZoom3, NonNegativeValues));
+    EXPECT_TRUE(create(Length(10, Fixed))->equals(create(Length(10, Fixed)).get()));
+    EXPECT_TRUE(create(Length(20, Percent))->equals(create(Length(20, Percent)).get()));
+    EXPECT_FALSE(create(Length(10, Fixed))->equals(create(Length(10, Percent)).get()));
+    EXPECT_FALSE(create(Length(0, Percent))->equals(create(Length(0, Fixed)).get()));
+    Length calc = Length(CalculationValue::create(PixelsAndPercent(5, 10), ValueRangeAll));
+    EXPECT_TRUE(create(calc)->equals(create(calc).get()));
+    EXPECT_FALSE(create(calc)->equals(create(Length(10, Percent)).get()));
 }
 
-TEST_F(AnimationAnimatableLengthTest, Interpolate)
+TEST(AnimationAnimatableLengthTest, Interpolate)
 {
-    RefPtrWillBeRawPtr<AnimatableLength> from10px = create(10, CSSPrimitiveValue::CSS_PX);
-    RefPtrWillBeRawPtr<AnimatableLength> to20pxAsInches = create(20.0 / 96, CSSPrimitiveValue::CSS_IN);
-
-    EXPECT_REFV_EQ(create(5,  CSSPrimitiveValue::CSS_PX),
-        AnimatableValue::interpolate(from10px.get(), to20pxAsInches.get(), -0.5));
-
-    EXPECT_REFV_EQ(create(10, CSSPrimitiveValue::CSS_PX),
-        AnimatableValue::interpolate(from10px.get(), to20pxAsInches.get(),  0));
-    EXPECT_REFV_EQ(create(14, CSSPrimitiveValue::CSS_PX),
-        AnimatableValue::interpolate(from10px.get(), to20pxAsInches.get(),  0.4));
-    EXPECT_REFV_EQ(create(15, CSSPrimitiveValue::CSS_PX),
-        AnimatableValue::interpolate(from10px.get(), to20pxAsInches.get(),  0.5));
-    EXPECT_REFV_EQ(create(16, CSSPrimitiveValue::CSS_PX),
-        AnimatableValue::interpolate(from10px.get(), to20pxAsInches.get(),  0.6));
-    EXPECT_REFV_EQ(create(20.0 / 96, CSSPrimitiveValue::CSS_IN),
-        AnimatableValue::interpolate(from10px.get(), to20pxAsInches.get(),  1));
-    EXPECT_REFV_EQ(create(25, CSSPrimitiveValue::CSS_PX),
-        AnimatableValue::interpolate(from10px.get(), to20pxAsInches.get(),  1.5));
-
-    RefPtrWillBeRawPtr<AnimatableLength> from10em = create(10, CSSPrimitiveValue::CSS_EMS);
-    RefPtrWillBeRawPtr<AnimatableLength> to20rem = create(20, CSSPrimitiveValue::CSS_REMS);
-    EXPECT_REFV_EQ(create(15, CSSPrimitiveValue::CSS_EMS, -10, CSSPrimitiveValue::CSS_REMS),
-        AnimatableValue::interpolate(from10em.get(), to20rem.get(), -0.5));
-    EXPECT_REFV_EQ(create(10, CSSPrimitiveValue::CSS_EMS),
-        AnimatableValue::interpolate(from10em.get(), to20rem.get(),  0));
-    EXPECT_REFV_EQ(create(6, CSSPrimitiveValue::CSS_EMS, 8, CSSPrimitiveValue::CSS_REMS),
-        AnimatableValue::interpolate(from10em.get(), to20rem.get(),  0.4));
-    EXPECT_REFV_EQ(create(5, CSSPrimitiveValue::CSS_EMS, 10, CSSPrimitiveValue::CSS_REMS),
-        AnimatableValue::interpolate(from10em.get(), to20rem.get(),  0.5));
-    EXPECT_REFV_EQ(create(4, CSSPrimitiveValue::CSS_EMS, 12, CSSPrimitiveValue::CSS_REMS),
-        AnimatableValue::interpolate(from10em.get(), to20rem.get(),  0.6));
-    EXPECT_REFV_EQ(create(20, CSSPrimitiveValue::CSS_REMS),
-        AnimatableValue::interpolate(from10em.get(), to20rem.get(),  1));
-    EXPECT_REFV_EQ(create(-5, CSSPrimitiveValue::CSS_EMS, 30, CSSPrimitiveValue::CSS_REMS),
-        AnimatableValue::interpolate(from10em.get(), to20rem.get(),  1.5));
-
-    // Zero values are typeless and hence we can don't get a calc
-    RefPtrWillBeRawPtr<AnimatableLength> from0px = create(0, CSSPrimitiveValue::CSS_PX);
-    EXPECT_REFV_EQ(create(-10, CSSPrimitiveValue::CSS_REMS),
-        AnimatableValue::interpolate(from0px.get(), to20rem.get(), -0.5));
-    // At t=0, interpolate always returns the "from" value.
-    EXPECT_REFV_EQ(create(0, CSSPrimitiveValue::CSS_PX),
-        AnimatableValue::interpolate(from0px.get(), to20rem.get(), 0));
-    EXPECT_REFV_EQ(create(10, CSSPrimitiveValue::CSS_REMS),
-        AnimatableValue::interpolate(from0px.get(), to20rem.get(), 0.5));
-    EXPECT_REFV_EQ(create(20, CSSPrimitiveValue::CSS_REMS),
-        AnimatableValue::interpolate(from0px.get(), to20rem.get(), 1.0));
-    EXPECT_REFV_EQ(create(30, CSSPrimitiveValue::CSS_REMS),
-        AnimatableValue::interpolate(from0px.get(), to20rem.get(), 1.5));
-
-    // Except 0% which is special
-    RefPtrWillBeRawPtr<AnimatableLength> from0percent = create(0, CSSPrimitiveValue::CSS_PERCENTAGE);
-    EXPECT_REFV_EQ(create(0, CSSPrimitiveValue::CSS_PERCENTAGE, -10, CSSPrimitiveValue::CSS_REMS),
-        AnimatableValue::interpolate(from0percent.get(), to20rem.get(), -0.5));
-    // At t=0, interpolate always returns the "from" value.
-    EXPECT_REFV_EQ(create(0, CSSPrimitiveValue::CSS_PERCENTAGE),
-        AnimatableValue::interpolate(from0percent.get(), to20rem.get(), 0));
-    EXPECT_REFV_EQ(create(0, CSSPrimitiveValue::CSS_PERCENTAGE, 10, CSSPrimitiveValue::CSS_REMS),
-        AnimatableValue::interpolate(from0percent.get(), to20rem.get(), 0.5));
-    // At t=1, interpolate always returns the "to" value.
-    EXPECT_REFV_EQ(create(20, CSSPrimitiveValue::CSS_REMS),
-        AnimatableValue::interpolate(from0percent.get(), to20rem.get(), 1.0));
-    EXPECT_REFV_EQ(create(0, CSSPrimitiveValue::CSS_PERCENTAGE, 30, CSSPrimitiveValue::CSS_REMS),
-        AnimatableValue::interpolate(from0percent.get(), to20rem.get(), 1.5));
-}
-
-TEST_F(AnimationAnimatableLengthTest, IsUnitless)
-{
-    EXPECT_TRUE(isUnitlessZero(create(0, CSSPrimitiveValue::CSS_PX)));
-    EXPECT_FALSE(isUnitlessZero(create(0, CSSPrimitiveValue::CSS_PERCENTAGE)));
-    EXPECT_TRUE(isUnitlessZero(create(0, CSSPrimitiveValue::CSS_EMS)));
-    EXPECT_TRUE(isUnitlessZero(create(0, CSSPrimitiveValue::CSS_EXS)));
-    EXPECT_TRUE(isUnitlessZero(create(0, CSSPrimitiveValue::CSS_REMS)));
-    EXPECT_TRUE(isUnitlessZero(create(0, CSSPrimitiveValue::CSS_VW)));
-    EXPECT_TRUE(isUnitlessZero(create(0, CSSPrimitiveValue::CSS_VH)));
-    EXPECT_TRUE(isUnitlessZero(create(0, CSSPrimitiveValue::CSS_VMIN)));
-    EXPECT_TRUE(isUnitlessZero(create(0, CSSPrimitiveValue::CSS_VMAX)));
-
-    EXPECT_FALSE(isUnitlessZero(create(1, CSSPrimitiveValue::CSS_PX)));
-    EXPECT_FALSE(isUnitlessZero(create(2, CSSPrimitiveValue::CSS_PERCENTAGE)));
-    EXPECT_FALSE(isUnitlessZero(create(3, CSSPrimitiveValue::CSS_EMS)));
-    EXPECT_FALSE(isUnitlessZero(create(4, CSSPrimitiveValue::CSS_EXS)));
-    EXPECT_FALSE(isUnitlessZero(create(5, CSSPrimitiveValue::CSS_REMS)));
-    EXPECT_FALSE(isUnitlessZero(create(6, CSSPrimitiveValue::CSS_VW)));
-    EXPECT_FALSE(isUnitlessZero(create(7, CSSPrimitiveValue::CSS_VH)));
-    EXPECT_FALSE(isUnitlessZero(create(8, CSSPrimitiveValue::CSS_VMIN)));
-    EXPECT_FALSE(isUnitlessZero(create(9, CSSPrimitiveValue::CSS_VMAX)));
-}
-
-TEST_F(AnimationAnimatableLengthTest, CommonUnitType)
-{
-    RefPtrWillBeRawPtr<AnimatableLength> length10px = create(10, CSSPrimitiveValue::CSS_PX);
-    EXPECT_EQ(CSSPrimitiveValue::UnitTypePixels, commonUnitType(length10px, create(1, CSSPrimitiveValue::CSS_PX).get()));
-    EXPECT_EQ(CSSPrimitiveValue::UnitTypeCalc, commonUnitType(length10px, create(2, CSSPrimitiveValue::CSS_PERCENTAGE).get()));
-    EXPECT_EQ(CSSPrimitiveValue::UnitTypeCalc, commonUnitType(length10px, create(3, CSSPrimitiveValue::CSS_EMS).get()));
-    EXPECT_EQ(CSSPrimitiveValue::UnitTypeCalc, commonUnitType(length10px, create(4, CSSPrimitiveValue::CSS_PX, 5, CSSPrimitiveValue::CSS_CM).get()));
-    EXPECT_EQ(CSSPrimitiveValue::UnitTypeCalc, commonUnitType(length10px, create(0, CSSPrimitiveValue::CSS_PERCENTAGE).get()));
-
-    RefPtrWillBeRawPtr<AnimatableLength> length0px = create(0, CSSPrimitiveValue::CSS_PX);
-    EXPECT_EQ(CSSPrimitiveValue::UnitTypePixels, commonUnitType(length0px, create(1, CSSPrimitiveValue::CSS_PX).get()));
-    EXPECT_EQ(CSSPrimitiveValue::UnitTypePercentage, commonUnitType(length0px, create(2, CSSPrimitiveValue::CSS_PERCENTAGE).get()));
-    EXPECT_EQ(CSSPrimitiveValue::UnitTypeFontSize, commonUnitType(length0px, create(3, CSSPrimitiveValue::CSS_EMS).get()));
-    EXPECT_EQ(CSSPrimitiveValue::UnitTypeCalc, commonUnitType(length0px, create(4, CSSPrimitiveValue::CSS_PX, 5, CSSPrimitiveValue::CSS_CM).get()));
-    EXPECT_EQ(CSSPrimitiveValue::UnitTypePercentage, commonUnitType(length0px, create(0, CSSPrimitiveValue::CSS_PERCENTAGE).get()));
-
-    RefPtrWillBeRawPtr<AnimatableLength> length0percent = create(0, CSSPrimitiveValue::CSS_PERCENTAGE);
-    EXPECT_EQ(CSSPrimitiveValue::UnitTypeCalc, commonUnitType(length0percent, create(1, CSSPrimitiveValue::CSS_PX).get()));
-    EXPECT_EQ(CSSPrimitiveValue::UnitTypePercentage, commonUnitType(length0percent, create(2, CSSPrimitiveValue::CSS_PERCENTAGE).get()));
-    EXPECT_EQ(CSSPrimitiveValue::UnitTypeCalc, commonUnitType(length0percent, create(3, CSSPrimitiveValue::CSS_EMS).get()));
-    EXPECT_EQ(CSSPrimitiveValue::UnitTypeCalc, commonUnitType(length0percent, create(4, CSSPrimitiveValue::CSS_PX, 5, CSSPrimitiveValue::CSS_CM).get()));
-    EXPECT_EQ(CSSPrimitiveValue::UnitTypePercentage, commonUnitType(length0percent, create(0, CSSPrimitiveValue::CSS_PERCENTAGE).get()));
-
-    RefPtrWillBeRawPtr<AnimatableLength> lengthCalc = create(3, CSSPrimitiveValue::CSS_PX, 5, CSSPrimitiveValue::CSS_CM);
-    EXPECT_EQ(CSSPrimitiveValue::UnitTypeCalc, commonUnitType(lengthCalc, create(1, CSSPrimitiveValue::CSS_PX).get()));
-    EXPECT_EQ(CSSPrimitiveValue::UnitTypeCalc, commonUnitType(lengthCalc, create(2, CSSPrimitiveValue::CSS_PERCENTAGE).get()));
-    EXPECT_EQ(CSSPrimitiveValue::UnitTypeCalc, commonUnitType(lengthCalc, create(3, CSSPrimitiveValue::CSS_EMS).get()));
-    EXPECT_EQ(CSSPrimitiveValue::UnitTypeCalc, commonUnitType(lengthCalc, create(4, CSSPrimitiveValue::CSS_PX, 5, CSSPrimitiveValue::CSS_CM).get()));
-    EXPECT_EQ(CSSPrimitiveValue::UnitTypeCalc, commonUnitType(lengthCalc, create(0, CSSPrimitiveValue::CSS_PERCENTAGE).get()));
+    EXPECT_TRUE(AnimatableValue::interpolate(create(Length(10, Fixed)).get(), create(Length(0, Fixed)).get(), 0.2)->equals(create(Length(8, Fixed)).get()));
+    EXPECT_TRUE(AnimatableValue::interpolate(create(Length(4, Percent)).get(), create(Length(12, Percent)).get(), 0.25)->equals(create(Length(6, Percent)).get()));
+    Length calc = Length(CalculationValue::create(PixelsAndPercent(12, 4), ValueRangeAll));
+    EXPECT_TRUE(AnimatableValue::interpolate(create(Length(20, Fixed)).get(), create(Length(10, Percent)).get(), 0.4)->equals(create(calc).get()));
 }
 
 } // namespace WebCore
diff --git a/Source/core/animation/AnimatableNeutral.h b/Source/core/animation/AnimatableNeutral.h
index 30b5cb7..16f8595 100644
--- a/Source/core/animation/AnimatableNeutral.h
+++ b/Source/core/animation/AnimatableNeutral.h
@@ -39,7 +39,7 @@
 public:
     virtual ~AnimatableNeutral() { }
 
-    virtual void trace(Visitor* visitor) OVERRIDE { }
+    virtual void trace(Visitor* visitor) OVERRIDE { AnimatableValue::trace(visitor); }
 
 protected:
     static PassRefPtrWillBeRawPtr<AnimatableNeutral> create() { return adoptRefWillBeNoop(new AnimatableNeutral()); }
diff --git a/Source/core/animation/AnimatableRepeatable.cpp b/Source/core/animation/AnimatableRepeatable.cpp
index f732f1f..72a4166 100644
--- a/Source/core/animation/AnimatableRepeatable.cpp
+++ b/Source/core/animation/AnimatableRepeatable.cpp
@@ -105,6 +105,7 @@
 void AnimatableRepeatable::trace(Visitor* visitor)
 {
     visitor->trace(m_values);
+    AnimatableValue::trace(visitor);
 }
 
 } // namespace WebCore
diff --git a/Source/core/animation/AnimatableSVGLength.h b/Source/core/animation/AnimatableSVGLength.h
index d390fd4..5b7f791 100644
--- a/Source/core/animation/AnimatableSVGLength.h
+++ b/Source/core/animation/AnimatableSVGLength.h
@@ -50,7 +50,7 @@
         return m_length.get();
     }
 
-    virtual void trace(Visitor*) OVERRIDE { }
+    virtual void trace(Visitor* visitor) OVERRIDE { AnimatableValue::trace(visitor); }
 
 protected:
     virtual PassRefPtrWillBeRawPtr<AnimatableValue> interpolateTo(const AnimatableValue*, double fraction) const OVERRIDE;
diff --git a/Source/core/animation/AnimatableSVGPaint.h b/Source/core/animation/AnimatableSVGPaint.h
index 6a08ac6..c098e1f 100644
--- a/Source/core/animation/AnimatableSVGPaint.h
+++ b/Source/core/animation/AnimatableSVGPaint.h
@@ -52,7 +52,7 @@
     Color color() const { return m_color.toColor(); };
     const String& uri() const { return m_uri; };
 
-    virtual void trace(Visitor*) OVERRIDE { }
+    virtual void trace(Visitor* visitor) OVERRIDE { AnimatableValue::trace(visitor); }
 
 protected:
     virtual PassRefPtrWillBeRawPtr<AnimatableValue> interpolateTo(const AnimatableValue*, double fraction) const OVERRIDE;
diff --git a/Source/core/animation/AnimatableShadow.h b/Source/core/animation/AnimatableShadow.h
index 146c858..80a7cf5 100644
--- a/Source/core/animation/AnimatableShadow.h
+++ b/Source/core/animation/AnimatableShadow.h
@@ -45,7 +45,7 @@
     }
     ShadowList* shadowList() const { return m_shadowList.get(); }
 
-    virtual void trace(Visitor*) OVERRIDE { }
+    virtual void trace(Visitor* visitor) OVERRIDE { AnimatableValue::trace(visitor); }
 
 protected:
     virtual PassRefPtrWillBeRawPtr<AnimatableValue> interpolateTo(const AnimatableValue*, double fraction) const OVERRIDE;
diff --git a/Source/core/animation/AnimatableShapeValue.h b/Source/core/animation/AnimatableShapeValue.h
index 4306b29..decc6f3 100644
--- a/Source/core/animation/AnimatableShapeValue.h
+++ b/Source/core/animation/AnimatableShapeValue.h
@@ -45,7 +45,7 @@
     }
     ShapeValue* shapeValue() const { return m_shape.get(); }
 
-    virtual void trace(Visitor*) OVERRIDE { }
+    virtual void trace(Visitor* visitor) OVERRIDE { AnimatableValue::trace(visitor); }
 
 protected:
     virtual PassRefPtrWillBeRawPtr<AnimatableValue> interpolateTo(const AnimatableValue*, double fraction) const OVERRIDE;
diff --git a/Source/core/animation/AnimatableStrokeDasharrayList.cpp b/Source/core/animation/AnimatableStrokeDasharrayList.cpp
index 5d4ff29..f81e351 100644
--- a/Source/core/animation/AnimatableStrokeDasharrayList.cpp
+++ b/Source/core/animation/AnimatableStrokeDasharrayList.cpp
@@ -75,11 +75,7 @@
     if (from.isEmpty() && to.isEmpty())
         return takeConstRef(this);
     if (from.isEmpty() || to.isEmpty()) {
-#if ENABLE_OILPAN
-        DEFINE_STATIC_LOCAL(Persistent<AnimatableSVGLength>, zeroPixels, (AnimatableSVGLength::create(SVGLength::create())));
-#else
-        DEFINE_STATIC_REF(AnimatableSVGLength, zeroPixels, AnimatableSVGLength::create(SVGLength::create()).leakRef());
-#endif
+        DEFINE_STATIC_REF_WILL_BE_PERSISTENT(AnimatableSVGLength, zeroPixels, (AnimatableSVGLength::create(SVGLength::create())));
         if (from.isEmpty()) {
             from.append(zeroPixels);
             from.append(zeroPixels);
diff --git a/Source/core/animation/AnimatableTransform.h b/Source/core/animation/AnimatableTransform.h
index 18164de..51896af 100644
--- a/Source/core/animation/AnimatableTransform.h
+++ b/Source/core/animation/AnimatableTransform.h
@@ -45,7 +45,7 @@
         return m_transform;
     }
 
-    virtual void trace(Visitor*) OVERRIDE { }
+    virtual void trace(Visitor* visitor) OVERRIDE { AnimatableValue::trace(visitor); }
 
 protected:
     virtual PassRefPtrWillBeRawPtr<AnimatableValue> interpolateTo(const AnimatableValue*, double fraction) const OVERRIDE;
diff --git a/Source/core/animation/AnimatableUnknown.h b/Source/core/animation/AnimatableUnknown.h
index c310416..a483910 100644
--- a/Source/core/animation/AnimatableUnknown.h
+++ b/Source/core/animation/AnimatableUnknown.h
@@ -56,6 +56,7 @@
     virtual void trace(Visitor* visitor) OVERRIDE
     {
         visitor->trace(m_value);
+        AnimatableValue::trace(visitor);
     }
 
 protected:
diff --git a/Source/core/animation/AnimatableValue.cpp b/Source/core/animation/AnimatableValue.cpp
index 4176a8e..af0aec9 100644
--- a/Source/core/animation/AnimatableValue.cpp
+++ b/Source/core/animation/AnimatableValue.cpp
@@ -44,13 +44,8 @@
 
 const AnimatableValue* AnimatableValue::neutralValue()
 {
-#if ENABLE_OILPAN
-    DEFINE_STATIC_LOCAL(Persistent<AnimatableNeutral>, neutralSentinelValue, (AnimatableNeutral::create()));
-    return neutralSentinelValue.get();
-#else
-    DEFINE_STATIC_REF(AnimatableNeutral, neutralSentinelValue, (AnimatableNeutral::create()));
+    DEFINE_STATIC_REF_WILL_BE_PERSISTENT(AnimatableNeutral, neutralSentinelValue, (AnimatableNeutral::create()));
     return neutralSentinelValue;
-#endif
 }
 
 PassRefPtrWillBeRawPtr<AnimatableValue> AnimatableValue::interpolate(const AnimatableValue* left, const AnimatableValue* right, double fraction)
diff --git a/Source/core/animation/AnimatableValue.h b/Source/core/animation/AnimatableValue.h
index 6f59146..2306142 100644
--- a/Source/core/animation/AnimatableValue.h
+++ b/Source/core/animation/AnimatableValue.h
@@ -87,7 +87,7 @@
         return value->type() == type();
     }
 
-    virtual void trace(Visitor*) = 0;
+    virtual void trace(Visitor*) { }
 
 protected:
     enum AnimatableType {
diff --git a/Source/core/animation/AnimatableValueKeyframe.cpp b/Source/core/animation/AnimatableValueKeyframe.cpp
index 75b146b..b131b0e 100644
--- a/Source/core/animation/AnimatableValueKeyframe.cpp
+++ b/Source/core/animation/AnimatableValueKeyframe.cpp
@@ -74,6 +74,7 @@
 void AnimatableValueKeyframe::PropertySpecificKeyframe::trace(Visitor* visitor)
 {
     visitor->trace(m_value);
+    Keyframe::PropertySpecificKeyframe::trace(visitor);
 }
 
 }
diff --git a/Source/core/animation/AnimatableValueTestHelper.cpp b/Source/core/animation/AnimatableValueTestHelper.cpp
index 66c2d09..c3f4a60 100644
--- a/Source/core/animation/AnimatableValueTestHelper.cpp
+++ b/Source/core/animation/AnimatableValueTestHelper.cpp
@@ -51,52 +51,11 @@
         << animColor.visitedLinkColor().serialized().utf8().data() << ")";
 }
 
-void PrintTo(const AnimatableDouble& animDouble, ::std::ostream* os)
-{
-    PrintTo(*(animDouble.toCSSValue().get()), os, "AnimatableDouble");
-}
-
 void PrintTo(const AnimatableImage& animImage, ::std::ostream* os)
 {
     PrintTo(*(animImage.toCSSValue()), os, "AnimatableImage");
 }
 
-void PrintTo(const AnimatableLength& animLength, ::std::ostream* os)
-{
-    PrintTo(*(animLength.toCSSValue().get()), os, "AnimatableLength");
-}
-
-void PrintTo(const AnimatableLengthBox& animLengthBox, ::std::ostream* os)
-{
-    *os << "AnimatableLengthBox(";
-    PrintTo(*(animLengthBox.left()), os);
-    *os << ", ";
-    PrintTo(*(animLengthBox.right()), os);
-    *os << ", ";
-    PrintTo(*(animLengthBox.top()), os);
-    *os << ", ";
-    PrintTo(*(animLengthBox.bottom()), os);
-    *os << ")";
-}
-
-void PrintTo(const AnimatableLengthPoint& animLengthPoint, ::std::ostream* os)
-{
-    *os << "AnimatableLengthPoint(";
-    PrintTo(*(animLengthPoint.x()), os);
-    *os << ", ";
-    PrintTo(*(animLengthPoint.y()), os);
-    *os << ")";
-}
-
-void PrintTo(const AnimatableLengthSize& animLengthSize, ::std::ostream* os)
-{
-    *os << "AnimatableLengthSize(";
-    PrintTo(*(animLengthSize.width()), os);
-    *os << ", ";
-    PrintTo(*(animLengthSize.height()), os);
-    *os << ")";
-}
-
 void PrintTo(const AnimatableNeutral& animValue, ::std::ostream* os)
 {
     *os << "AnimatableNeutral@" << &animValue;
@@ -231,18 +190,8 @@
         PrintTo(*(toAnimatableClipPathOperation(&animValue)), os);
     else if (animValue.isColor())
         PrintTo(*(toAnimatableColor(&animValue)), os);
-    else if (animValue.isDouble())
-        PrintTo(*(toAnimatableDouble(&animValue)), os);
     else if (animValue.isImage())
         PrintTo(*(toAnimatableImage(&animValue)), os);
-    else if (animValue.isLength())
-        PrintTo(*(toAnimatableLength(&animValue)), os);
-    else if (animValue.isLengthBox())
-        PrintTo(*(toAnimatableLengthBox(&animValue)), os);
-    else if (animValue.isLengthPoint())
-        PrintTo(*(toAnimatableLengthPoint(&animValue)), os);
-    else if (animValue.isLengthSize())
-        PrintTo(*(toAnimatableLengthSize(&animValue)), os);
     else if (animValue.isNeutral())
         PrintTo(*(static_cast<const AnimatableNeutral*>(&animValue)), os);
     else if (animValue.isRepeatable())
diff --git a/Source/core/animation/AnimatableValueTestHelper.h b/Source/core/animation/AnimatableValueTestHelper.h
index 65a8660..bff27ed 100644
--- a/Source/core/animation/AnimatableValueTestHelper.h
+++ b/Source/core/animation/AnimatableValueTestHelper.h
@@ -38,12 +38,7 @@
 
 #include "core/animation/AnimatableClipPathOperation.h"
 #include "core/animation/AnimatableColor.h"
-#include "core/animation/AnimatableDouble.h"
 #include "core/animation/AnimatableImage.h"
-#include "core/animation/AnimatableLength.h"
-#include "core/animation/AnimatableLengthBox.h"
-#include "core/animation/AnimatableLengthPoint.h"
-#include "core/animation/AnimatableLengthSize.h"
 #include "core/animation/AnimatableNeutral.h"
 #include "core/animation/AnimatableRepeatable.h"
 #include "core/animation/AnimatableSVGLength.h"
@@ -68,12 +63,7 @@
 
 void PrintTo(const AnimatableClipPathOperation&, ::std::ostream*);
 void PrintTo(const AnimatableColor&, ::std::ostream*);
-void PrintTo(const AnimatableDouble&, ::std::ostream*);
 void PrintTo(const AnimatableImage&, ::std::ostream*);
-void PrintTo(const AnimatableLength&, ::std::ostream*);
-void PrintTo(const AnimatableLengthBox&, ::std::ostream*);
-void PrintTo(const AnimatableLengthPoint&, ::std::ostream*);
-void PrintTo(const AnimatableLengthSize&, ::std::ostream*);
 void PrintTo(const AnimatableNeutral&, ::std::ostream*);
 void PrintTo(const AnimatableRepeatable&, ::std::ostream*);
 void PrintTo(const AnimatableSVGLength&, ::std::ostream*);
diff --git a/Source/core/animation/AnimatableValueTestHelperTest.cpp b/Source/core/animation/AnimatableValueTestHelperTest.cpp
index 6ae5965..f1d1c22 100644
--- a/Source/core/animation/AnimatableValueTestHelperTest.cpp
+++ b/Source/core/animation/AnimatableValueTestHelperTest.cpp
@@ -67,48 +67,10 @@
         ::std::string("AnimatableColor(rgba(0, 0, 0, 0), #ff0000)"),
         PrintToString(AnimatableColor::create(Color(0x000000FF), Color(0xFFFF0000))));
 
-    EXPECT_EQ(
-        ::std::string("AnimatableDouble(1)"),
-        PrintToString(AnimatableDouble::create(1.0)));
-
-    EXPECT_EQ(
-        ::std::string("AnimatableLength(5px)"),
-        PrintToString(AnimatableLength::create(CSSPrimitiveValue::create(5, CSSPrimitiveValue::CSS_PX).get())));
-
-    EXPECT_EQ(
-        ::std::string("AnimatableLengthBox(AnimatableLength(1px), AnimatableLength(2em), AnimatableLength(3rem), AnimatableLength(4pt))"),
-        PrintToString(AnimatableLengthBox::create(
-            AnimatableLength::create(CSSPrimitiveValue::create(1, CSSPrimitiveValue::CSS_PX).get()),
-            AnimatableLength::create(CSSPrimitiveValue::create(2, CSSPrimitiveValue::CSS_EMS).get()),
-            AnimatableLength::create(CSSPrimitiveValue::create(3, CSSPrimitiveValue::CSS_REMS).get()),
-            AnimatableLength::create(CSSPrimitiveValue::create(4, CSSPrimitiveValue::CSS_PT).get())
-            )));
-
-    EXPECT_EQ(
-        ::std::string("AnimatableLengthPoint(AnimatableLength(5%), AnimatableLength(6px))"),
-        PrintToString(AnimatableLengthPoint::create(
-            AnimatableLength::create(CSSPrimitiveValue::create(5, CSSPrimitiveValue::CSS_PERCENTAGE).get()),
-            AnimatableLength::create(CSSPrimitiveValue::create(6, CSSPrimitiveValue::CSS_PX).get())
-            )));
-
-    EXPECT_EQ(
-        ::std::string("AnimatableLengthSize(AnimatableLength(3rem), AnimatableLength(4pt))"),
-        PrintToString(AnimatableLengthSize::create(
-            AnimatableLength::create(CSSPrimitiveValue::create(3, CSSPrimitiveValue::CSS_REMS).get()),
-            AnimatableLength::create(CSSPrimitiveValue::create(4, CSSPrimitiveValue::CSS_PT).get())
-            )));
-
     EXPECT_THAT(
         PrintToString(const_cast<AnimatableValue*>(AnimatableValue::neutralValue())),
         testing::StartsWith("AnimatableNeutral@"));
 
-    WillBeHeapVector<RefPtrWillBeMember<AnimatableValue> > v1;
-    v1.append(AnimatableLength::create(CSSPrimitiveValue::create(3, CSSPrimitiveValue::CSS_REMS).get()));
-    v1.append(AnimatableLength::create(CSSPrimitiveValue::create(4, CSSPrimitiveValue::CSS_PT).get()));
-    EXPECT_EQ(
-        ::std::string("AnimatableRepeatable(AnimatableLength(3rem), AnimatableLength(4pt))"),
-        PrintToString(AnimatableRepeatable::create(v1)));
-
     RefPtr<SVGLength> length1cm = SVGLength::create(LengthModeOther);
     RefPtr<SVGLength> length2cm = SVGLength::create(LengthModeOther);
     length1cm->setValueAsString("1cm", ASSERT_NO_EXCEPTION);
diff --git a/Source/core/animation/AnimatableVisibility.h b/Source/core/animation/AnimatableVisibility.h
index 2b344b3..72d653e 100644
--- a/Source/core/animation/AnimatableVisibility.h
+++ b/Source/core/animation/AnimatableVisibility.h
@@ -46,7 +46,7 @@
 
     EVisibility visibility() const { return m_visibility; }
 
-    virtual void trace(Visitor*) OVERRIDE { }
+    virtual void trace(Visitor* visitor) OVERRIDE { AnimatableValue::trace(visitor); }
 
 protected:
     virtual PassRefPtrWillBeRawPtr<AnimatableValue> interpolateTo(const AnimatableValue*, double fraction) const OVERRIDE;
diff --git a/Source/core/animation/AnimationClock.cpp b/Source/core/animation/AnimationClock.cpp
index 6492206..304136c 100644
--- a/Source/core/animation/AnimationClock.cpp
+++ b/Source/core/animation/AnimationClock.cpp
@@ -28,26 +28,54 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#include <math.h>
 #include "config.h"
 #include "core/animation/AnimationClock.h"
+#include "wtf/CurrentTime.h"
+
+namespace {
+
+// FIXME: This is an approximation of time between frames, used when
+// ticking the animation clock outside of animation frame callbacks.
+// Ideally this would be generated by the compositor.
+const double approximateFrameTime = 1 / 60.0;
+
+}
 
 namespace WebCore {
 
+unsigned AnimationClock::s_currentTask = 0;
+
 void AnimationClock::updateTime(double time)
 {
     if (time > m_time)
         m_time = time;
-    m_frozen = true;
+    m_currentTask = s_currentTask;
 }
 
 double AnimationClock::currentTime()
 {
-    if (!m_frozen) {
-        double newTime = m_monotonicallyIncreasingTime();
-        if (newTime >= m_time + minTimeBeforeUnsynchronizedAnimationClockTick)
-            m_time = newTime;
+    if (m_currentTask != s_currentTask) {
+        const double currentTime = m_monotonicallyIncreasingTime();
+        if (m_time < currentTime) {
+            // Advance to the first estimated frame after the current time.
+            const double frameShift = fmod(currentTime - m_time, approximateFrameTime);
+            const double newTime = currentTime + approximateFrameTime - frameShift;
+            ASSERT(newTime > currentTime);
+            ASSERT(newTime <= currentTime + approximateFrameTime);
+            updateTime(newTime);
+        } else {
+            m_currentTask = s_currentTask;
+        }
     }
     return m_time;
 }
 
+void AnimationClock::resetTimeForTesting()
+{
+    m_time = 0;
+    m_currentTask = 0;
+    s_currentTask = 0;
+}
+
 }
diff --git a/Source/core/animation/AnimationClock.h b/Source/core/animation/AnimationClock.h
index 540dfbe..e5a3bdb 100644
--- a/Source/core/animation/AnimationClock.h
+++ b/Source/core/animation/AnimationClock.h
@@ -31,40 +31,34 @@
 #ifndef AnimationClock_h
 #define AnimationClock_h
 
+#include <limits>
 #include "wtf/CurrentTime.h"
 #include "wtf/PassOwnPtr.h"
+#include "wtf/Noncopyable.h"
 
 namespace WebCore {
 
-// FIXME: This value is used to suppress updates when time is required outside of a frame.
-// The purpose of allowing the clock to update during such periods is to allow animations
-// to have an appropriate start time and for getComputedStyle to attempt to catch-up to a
-// compositor animation. However a more accurate system might be to attempt to phase-lock
-// with the frame clock.
-const double minTimeBeforeUnsynchronizedAnimationClockTick = 0.005;
-
 class AnimationClock {
+    WTF_MAKE_NONCOPYABLE(AnimationClock);
 public:
-    static PassOwnPtr<AnimationClock> create(WTF::TimeFunction monotonicallyIncreasingTime = WTF::monotonicallyIncreasingTime)
+    explicit AnimationClock(WTF::TimeFunction monotonicallyIncreasingTime = WTF::monotonicallyIncreasingTime)
+        : m_monotonicallyIncreasingTime(monotonicallyIncreasingTime)
+        , m_time(0)
+        , m_currentTask(std::numeric_limits<unsigned>::max())
     {
-        return adoptPtr(new AnimationClock(monotonicallyIncreasingTime));
     }
 
     void updateTime(double time);
     double currentTime();
-    void unfreeze() { m_frozen = false; }
-    void resetTimeForTesting() { m_time = 0; m_frozen = true; }
+    void resetTimeForTesting();
+
+    static void notifyTaskStart() { ++s_currentTask; }
 
 private:
-    AnimationClock(WTF::TimeFunction monotonicallyIncreasingTime)
-        : m_monotonicallyIncreasingTime(monotonicallyIncreasingTime)
-        , m_time(0)
-        , m_frozen(false)
-    {
-    }
     WTF::TimeFunction m_monotonicallyIncreasingTime;
     double m_time;
-    bool m_frozen;
+    unsigned m_currentTask;
+    static unsigned s_currentTask;
 };
 
 } // namespace WebCore
diff --git a/Source/core/animation/AnimationClockTest.cpp b/Source/core/animation/AnimationClockTest.cpp
index 7e54cde..2823fb1 100644
--- a/Source/core/animation/AnimationClockTest.cpp
+++ b/Source/core/animation/AnimationClockTest.cpp
@@ -39,11 +39,15 @@
 namespace {
 
 class AnimationAnimationClockTest : public ::testing::Test {
+public:
+    AnimationAnimationClockTest()
+        : animationClock(mockTimeFunction)
+    {}
 protected:
     virtual void SetUp()
     {
-        animationClock = AnimationClock::create(mockTimeFunction);
-        mockTime = 200;
+        mockTime = 0;
+        animationClock.resetTimeForTesting();
     }
 
     static double mockTimeFunction()
@@ -52,36 +56,88 @@
     }
 
     static double mockTime;
-    OwnPtr<AnimationClock> animationClock;
+    AnimationClock animationClock;
 };
 
 double AnimationAnimationClockTest::mockTime;
 
-TEST_F(AnimationAnimationClockTest, CurrentTime)
+TEST_F(AnimationAnimationClockTest, TimeIsGreaterThanZeroForUnitTests)
 {
-    // Current time should not advance until minTimeBeforeUnsynchronizedTick has elapsed
-    EXPECT_EQ(200, animationClock->currentTime());
-    mockTime = 200 + minTimeBeforeUnsynchronizedAnimationClockTick / 2.0;
-    EXPECT_EQ(200, animationClock->currentTime());
-
-    mockTime = 200 + minTimeBeforeUnsynchronizedAnimationClockTick;
-    EXPECT_EQ(mockTime, animationClock->currentTime());
+    AnimationClock clock;
+    // unit tests outside core/animation shouldn't need to do anything to get
+    // a non-zero currentTime().
+    EXPECT_GT(clock.currentTime(), 0);
 }
 
-TEST_F(AnimationAnimationClockTest, UpdateTime)
+TEST_F(AnimationAnimationClockTest, TimeDoesNotChange)
 {
-    animationClock->updateTime(100);
-    EXPECT_EQ(100, animationClock->currentTime());
-    mockTime = 200;
-    EXPECT_EQ(100, animationClock->currentTime());
+    animationClock.updateTime(100);
+    EXPECT_EQ(100, animationClock.currentTime());
+    EXPECT_EQ(100, animationClock.currentTime());
+}
 
-    animationClock->unfreeze();
-    EXPECT_EQ(200, animationClock->currentTime());
+TEST_F(AnimationAnimationClockTest, TimeAdvancesWhenUpdated)
+{
+    animationClock.updateTime(100);
+    EXPECT_EQ(100, animationClock.currentTime());
 
-    animationClock->updateTime(300);
-    EXPECT_EQ(300, animationClock->currentTime());
-    mockTime = 400;
-    EXPECT_EQ(300, animationClock->currentTime());
+    animationClock.updateTime(200);
+    EXPECT_EQ(200, animationClock.currentTime());
+}
+
+TEST_F(AnimationAnimationClockTest, TimeAdvancesToTaskTime)
+{
+    animationClock.updateTime(100);
+    EXPECT_EQ(100, animationClock.currentTime());
+
+    mockTime = 150;
+    AnimationClock::notifyTaskStart();
+    EXPECT_GE(animationClock.currentTime(), mockTime);
+}
+
+TEST_F(AnimationAnimationClockTest, TimeAdvancesToTaskTimeOnlyWhenRequired)
+{
+    animationClock.updateTime(100);
+    EXPECT_EQ(100, animationClock.currentTime());
+
+    AnimationClock::notifyTaskStart();
+    animationClock.updateTime(125);
+    EXPECT_EQ(125, animationClock.currentTime());
+}
+
+TEST_F(AnimationAnimationClockTest, UpdateTimeIsMonotonic)
+{
+    animationClock.updateTime(100);
+    EXPECT_EQ(100, animationClock.currentTime());
+
+    // Update can't go backwards.
+    animationClock.updateTime(50);
+    EXPECT_EQ(100, animationClock.currentTime());
+
+    mockTime = 50;
+    AnimationClock::notifyTaskStart();
+    EXPECT_EQ(100, animationClock.currentTime());
+
+    mockTime = 150;
+    AnimationClock::notifyTaskStart();
+    EXPECT_GE(animationClock.currentTime(), mockTime);
+
+    // Update can't go backwards after advance to estimate.
+    animationClock.updateTime(100);
+    EXPECT_GE(animationClock.currentTime(), mockTime);
+}
+
+TEST_F(AnimationAnimationClockTest, CurrentTimeUpdatesTask)
+{
+    animationClock.updateTime(100);
+    EXPECT_EQ(100, animationClock.currentTime());
+
+    mockTime = 100;
+    AnimationClock::notifyTaskStart();
+    EXPECT_EQ(100, animationClock.currentTime());
+
+    mockTime = 150;
+    EXPECT_EQ(100, animationClock.currentTime());
 }
 
 }
diff --git a/Source/core/animation/AnimationEffect.h b/Source/core/animation/AnimationEffect.h
index f55c8aa..42441e9 100644
--- a/Source/core/animation/AnimationEffect.h
+++ b/Source/core/animation/AnimationEffect.h
@@ -54,7 +54,7 @@
     virtual bool affects(CSSPropertyID) { return false; };
     virtual bool isKeyframeEffectModel() const { return false; }
 
-    virtual void trace(Visitor*) = 0;
+    virtual void trace(Visitor*) { }
 };
 
 } // namespace WebCore
diff --git a/Source/core/animation/AnimationPlayer.cpp b/Source/core/animation/AnimationPlayer.cpp
index 7abd43f..545a737 100644
--- a/Source/core/animation/AnimationPlayer.cpp
+++ b/Source/core/animation/AnimationPlayer.cpp
@@ -64,7 +64,7 @@
     , m_paused(false)
     , m_held(false)
     , m_isPausedForTesting(false)
-    , m_outdated(false)
+    , m_outdated(true)
     , m_finished(false)
 {
     if (m_content) {
@@ -173,17 +173,22 @@
     if (newStartTime == m_startTime)
         return;
     updateCurrentTimingState(); // Update the value of held
+    bool hadStartTime = hasStartTime();
+    double previousCurrentTime = currentTimeInternal();
     m_startTime = newStartTime;
     m_sortInfo.m_startTime = newStartTime;
-    if (!isUpdateFromCompositor)
-        cancelAnimationOnCompositor();
-    if (isUpdateFromCompositor || !m_held)
-        setOutdated();
-    if (m_held)
-        return;
     updateCurrentTimingState();
-    if (!isUpdateFromCompositor)
+    if (previousCurrentTime != currentTimeInternal()) {
+        setOutdated();
+    } else if (!hadStartTime && m_timeline) {
+        // Even though this player is not outdated, time to effect change is
+        // infinity until start time is set.
+        m_timeline->wake();
+    }
+    if (!isUpdateFromCompositor) {
+        cancelAnimationOnCompositor();
         schedulePendingAnimationOnCompositor();
+    }
 }
 
 void AnimationPlayer::setSource(TimedItem* newSource)
@@ -344,7 +349,7 @@
         toAnimation(m_content.get())->cancelAnimationOnCompositor();
 }
 
-bool AnimationPlayer::update(UpdateReason reason)
+bool AnimationPlayer::update(TimingUpdateReason reason)
 {
     m_outdated = false;
 
@@ -353,20 +358,18 @@
 
     if (m_content) {
         double inheritedTime = isNull(m_timeline->currentTimeInternal()) ? nullValue() : currentTimeInternal();
-        m_content->updateInheritedTime(inheritedTime);
+        m_content->updateInheritedTime(inheritedTime, reason);
     }
 
     if (finished() && !m_finished) {
-        const AtomicString& eventType = EventTypeNames::finish;
-        if (executionContext() && hasEventListeners(eventType)) {
-            if (reason == UpdateForAnimationFrame) {
+        if (reason == TimingUpdateForAnimationFrame && hasStartTime()) {
+            const AtomicString& eventType = EventTypeNames::finish;
+            if (executionContext() && hasEventListeners(eventType)) {
                 RefPtrWillBeRawPtr<AnimationPlayerEvent> event = AnimationPlayerEvent::create(eventType, currentTime(), timeline()->currentTime());
                 event->setTarget(this);
                 event->setCurrentTarget(this);
                 m_timeline->document()->enqueueAnimationFrameEvent(event.release());
-                m_finished = true;
             }
-        } else {
             m_finished = true;
         }
     }
diff --git a/Source/core/animation/AnimationPlayer.h b/Source/core/animation/AnimationPlayer.h
index 35d6777..c542533 100644
--- a/Source/core/animation/AnimationPlayer.h
+++ b/Source/core/animation/AnimationPlayer.h
@@ -43,16 +43,12 @@
 class AnimationPlayer FINAL : public RefCounted<AnimationPlayer>, public EventTargetWithInlineData {
     REFCOUNTED_EVENT_TARGET(AnimationPlayer);
 public:
-    enum UpdateReason {
-        UpdateOnDemand,
-        UpdateForAnimationFrame
-    };
 
     ~AnimationPlayer();
     static PassRefPtr<AnimationPlayer> create(DocumentTimeline&, TimedItem*);
 
     // Returns whether the player is finished.
-    bool update(UpdateReason);
+    bool update(TimingUpdateReason);
 
     // timeToEffectChange returns:
     //  infinity  - if this player is no longer in effect
@@ -74,6 +70,9 @@
     void reverse();
     void finish(ExceptionState&);
     bool finished() { return limited(currentTimeInternal()); }
+    // FIXME: Resolve whether finished() should just return the flag, and
+    // remove this method.
+    bool finishedInternal() const { return m_finished; }
 
     DEFINE_ATTRIBUTE_EVENT_LISTENER(finish);
 
diff --git a/Source/core/animation/AnimationPlayerTest.cpp b/Source/core/animation/AnimationPlayerTest.cpp
index 6bb18cf..713af2d 100644
--- a/Source/core/animation/AnimationPlayerTest.cpp
+++ b/Source/core/animation/AnimationPlayerTest.cpp
@@ -80,7 +80,7 @@
     {
         document->animationClock().updateTime(time);
         // The timeline does not know about our player, so we have to explicitly call update().
-        return player->update(AnimationPlayer::UpdateOnDemand);
+        return player->update(TimingUpdateOnDemand);
     }
 
     RefPtr<Document> document;
@@ -599,6 +599,7 @@
 TEST_F(AnimationAnimationPlayerTest, EmptyAnimationPlayersDontUpdateEffects)
 {
     player = timeline->createAnimationPlayer(0);
+    player->update(TimingUpdateOnDemand);
     EXPECT_EQ(std::numeric_limits<double>::infinity(), player->timeToEffectChange());
 
     updateTimeline(1234);
@@ -643,24 +644,24 @@
     EXPECT_EQ(std::numeric_limits<double>::infinity(), player->timeToEffectChange());
 
     player->setCurrentTimeInternal(0);
-    player->update(AnimationPlayer::UpdateOnDemand);
+    player->update(TimingUpdateOnDemand);
     EXPECT_EQ(1, player->timeToEffectChange());
 
     player->setPlaybackRate(2);
-    player->update(AnimationPlayer::UpdateOnDemand);
+    player->update(TimingUpdateOnDemand);
     EXPECT_EQ(0.5, player->timeToEffectChange());
 
     player->setPlaybackRate(0);
-    player->update(AnimationPlayer::UpdateOnDemand);
+    player->update(TimingUpdateOnDemand);
     EXPECT_EQ(std::numeric_limits<double>::infinity(), player->timeToEffectChange());
 
     player->setCurrentTimeInternal(3);
     player->setPlaybackRate(-1);
-    player->update(AnimationPlayer::UpdateOnDemand);
+    player->update(TimingUpdateOnDemand);
     EXPECT_EQ(1, player->timeToEffectChange());
 
     player->setPlaybackRate(-2);
-    player->update(AnimationPlayer::UpdateOnDemand);
+    player->update(TimingUpdateOnDemand);
     EXPECT_EQ(0.5, player->timeToEffectChange());
 }
 
@@ -668,7 +669,7 @@
 {
     EXPECT_EQ(0, player->timeToEffectChange());
     player->pause();
-    player->update(AnimationPlayer::UpdateOnDemand);
+    player->update(TimingUpdateOnDemand);
     EXPECT_EQ(std::numeric_limits<double>::infinity(), player->timeToEffectChange());
 }
 
@@ -678,7 +679,7 @@
     player->setCurrentTimeInternal(-8);
     player->setPlaybackRate(2);
     player->cancel();
-    player->update(AnimationPlayer::UpdateOnDemand);
+    player->update(TimingUpdateOnDemand);
     EXPECT_EQ(4, player->timeToEffectChange());
 }
 
@@ -688,7 +689,7 @@
     player->setCurrentTimeInternal(9);
     player->setPlaybackRate(-3);
     player->cancel();
-    player->update(AnimationPlayer::UpdateOnDemand);
+    player->update(TimingUpdateOnDemand);
     EXPECT_EQ(3, player->timeToEffectChange());
 }
 
@@ -699,11 +700,11 @@
     Timing timing;
     RefPtr<Animation> animation = Animation::create(element.get(), nullptr, timing);
     RefPtr<AnimationPlayer> player = timeline->createAnimationPlayer(animation.get());
-    timeline->serviceAnimations(AnimationPlayer::UpdateForAnimationFrame);
+    player->setStartTime(0);
+    timeline->serviceAnimations(TimingUpdateForAnimationFrame);
     EXPECT_EQ(1, element->activeAnimations()->players().find(player.get())->value);
 
     player.release();
-    EXPECT_EQ(0, element->activeAnimations()->players().find(player.get())->value);
     EXPECT_TRUE(element->activeAnimations()->players().isEmpty());
 }
 
diff --git a/Source/core/animation/AnimationStackTest.cpp b/Source/core/animation/AnimationStackTest.cpp
index 7d44ce4..e28259b 100644
--- a/Source/core/animation/AnimationStackTest.cpp
+++ b/Source/core/animation/AnimationStackTest.cpp
@@ -29,14 +29,14 @@
     {
         AnimationPlayer* player = timeline->createAnimationPlayer(animation);
         player->setStartTimeInternal(startTime);
-        player->update(AnimationPlayer::UpdateOnDemand);
+        player->update(TimingUpdateOnDemand);
         return player;
     }
 
     void updateTimeline(double time)
     {
         document->animationClock().updateTime(time);
-        timeline->serviceAnimations(AnimationPlayer::UpdateOnDemand);
+        timeline->serviceAnimations(TimingUpdateForAnimationFrame);
     }
 
     const Vector<OwnPtr<SampledEffect> >& effects()
diff --git a/Source/core/animation/AnimationTest.cpp b/Source/core/animation/AnimationTest.cpp
index ca3dc6f..c16c5ec 100644
--- a/Source/core/animation/AnimationTest.cpp
+++ b/Source/core/animation/AnimationTest.cpp
@@ -6,7 +6,6 @@
 #include "core/animation/Animation.h"
 
 #include "bindings/v8/Dictionary.h"
-#include "core/animation/AnimatableLength.h"
 #include "core/animation/AnimationClock.h"
 #include "core/animation/AnimationHelpers.h"
 #include "core/animation/AnimationTestHelper.h"
diff --git a/Source/core/animation/DocumentAnimations.cpp b/Source/core/animation/DocumentAnimations.cpp
index 9ea1c6b..7fe6e3e 100644
--- a/Source/core/animation/DocumentAnimations.cpp
+++ b/Source/core/animation/DocumentAnimations.cpp
@@ -46,7 +46,7 @@
 
 namespace {
 
-void updateAnimationTiming(Document& document, AnimationPlayer::UpdateReason reason)
+void updateAnimationTiming(Document& document, TimingUpdateReason reason)
 {
     document.timeline().serviceAnimations(reason);
     document.transitionTimeline().serviceAnimations(reason);
@@ -57,13 +57,13 @@
 void DocumentAnimations::updateAnimationTimingForAnimationFrame(Document& document, double monotonicAnimationStartTime)
 {
     document.animationClock().updateTime(monotonicAnimationStartTime);
-    updateAnimationTiming(document, AnimationPlayer::UpdateForAnimationFrame);
+    updateAnimationTiming(document, TimingUpdateForAnimationFrame);
 }
 
 void DocumentAnimations::updateOutdatedAnimationPlayersIfNeeded(Document& document)
 {
     if (needsOutdatedAnimationPlayerUpdate(document))
-        updateAnimationTiming(document, AnimationPlayer::UpdateOnDemand);
+        updateAnimationTiming(document, TimingUpdateOnDemand);
 }
 
 void DocumentAnimations::updateAnimationTimingForGetComputedStyle(Node& node, CSSPropertyID property)
@@ -75,7 +75,7 @@
         if ((property == CSSPropertyOpacity && style->isRunningOpacityAnimationOnCompositor())
             || ((property == CSSPropertyTransform || property == CSSPropertyWebkitTransform) && style->isRunningTransformAnimationOnCompositor())
             || (property == CSSPropertyWebkitFilter && style->isRunningFilterAnimationOnCompositor())) {
-            updateAnimationTiming(element.document(), AnimationPlayer::UpdateOnDemand);
+            updateAnimationTiming(element.document(), TimingUpdateOnDemand);
         }
     }
 }
@@ -92,8 +92,6 @@
         ASSERT(document.view());
         document.view()->scheduleAnimation();
     }
-
-    document.animationClock().unfreeze();
 }
 
 } // namespace WebCore
diff --git a/Source/core/animation/DocumentTimeline.cpp b/Source/core/animation/DocumentTimeline.cpp
index fd815cf..f989159 100644
--- a/Source/core/animation/DocumentTimeline.cpp
+++ b/Source/core/animation/DocumentTimeline.cpp
@@ -92,12 +92,11 @@
     m_timing->serviceOnNextFrame();
 }
 
-void DocumentTimeline::serviceAnimations(AnimationPlayer::UpdateReason reason)
+void DocumentTimeline::serviceAnimations(TimingUpdateReason reason)
 {
     TRACE_EVENT0("webkit", "DocumentTimeline::serviceAnimations");
 
     m_timing->cancelWake();
-    m_hasOutdatedAnimationPlayer = false;
 
     double timeToNextEffect = std::numeric_limits<double>::infinity();
     Vector<AnimationPlayer*> players;
@@ -119,7 +118,7 @@
     else if (timeToNextEffect != std::numeric_limits<double>::infinity())
         m_timing->wakeAfter(timeToNextEffect - s_minimumDelay);
 
-    ASSERT(!m_hasOutdatedAnimationPlayer);
+    ASSERT(!hasOutdatedAnimationPlayer());
 }
 
 void DocumentTimeline::setZeroTime(double zeroTime)
@@ -127,7 +126,7 @@
     ASSERT(isNull(m_zeroTime));
     m_zeroTime = zeroTime;
     ASSERT(!isNull(m_zeroTime));
-    serviceAnimations(AnimationPlayer::UpdateOnDemand);
+    serviceAnimations(TimingUpdateOnDemand);
 }
 
 void DocumentTimeline::DocumentTimelineTiming::wakeAfter(double duration)
@@ -183,13 +182,22 @@
 {
     for (HashSet<RefPtr<AnimationPlayer> >::iterator it = m_playersNeedingUpdate.begin(); it != m_playersNeedingUpdate.end(); ++it)
         (*it)->pauseForTesting(pauseTime);
-    serviceAnimations(AnimationPlayer::UpdateOnDemand);
+    serviceAnimations(TimingUpdateOnDemand);
+}
+
+bool DocumentTimeline::hasOutdatedAnimationPlayer() const
+{
+    for (HashSet<RefPtr<AnimationPlayer> >::iterator it = m_playersNeedingUpdate.begin(); it != m_playersNeedingUpdate.end(); ++it) {
+        if ((*it)->outdated())
+            return true;
+    }
+    return false;
 }
 
 void DocumentTimeline::setOutdatedAnimationPlayer(AnimationPlayer* player)
 {
+    ASSERT(player->outdated());
     m_playersNeedingUpdate.add(player);
-    m_hasOutdatedAnimationPlayer = true;
     if (m_document && m_document->page() && !m_document->page()->animator().isServicingAnimations())
         m_timing->serviceOnNextFrame();
 }
diff --git a/Source/core/animation/DocumentTimeline.h b/Source/core/animation/DocumentTimeline.h
index 6ff8bdf..a151a30 100644
--- a/Source/core/animation/DocumentTimeline.h
+++ b/Source/core/animation/DocumentTimeline.h
@@ -62,7 +62,7 @@
     static PassRefPtr<DocumentTimeline> create(Document*, PassOwnPtr<PlatformTiming> = nullptr);
     ~DocumentTimeline();
 
-    void serviceAnimations(AnimationPlayer::UpdateReason);
+    void serviceAnimations(TimingUpdateReason);
 
     // Creates a player attached to this timeline, but without a start time.
     AnimationPlayer* createAnimationPlayer(TimedItem*);
@@ -89,10 +89,11 @@
     size_t numberOfActiveAnimationsForTesting() const;
 
     void setOutdatedAnimationPlayer(AnimationPlayer*);
-    bool hasOutdatedAnimationPlayer() const { return m_hasOutdatedAnimationPlayer; }
+    bool hasOutdatedAnimationPlayer() const;
 
     Document* document() { return m_document; }
     void detachFromDocument();
+    void wake();
 
 protected:
     DocumentTimeline(Document*, PassOwnPtr<PlatformTiming>);
@@ -104,9 +105,6 @@
     // i.e. current, in effect, or had timing changed
     HashSet<RefPtr<AnimationPlayer> > m_playersNeedingUpdate;
     HashSet<AnimationPlayer*> m_players;
-    bool m_hasOutdatedAnimationPlayer;
-
-    void wake();
 
     friend class SMILTimeContainer;
     static const double s_minimumDelay;
diff --git a/Source/core/animation/DocumentTimelineTest.cpp b/Source/core/animation/DocumentTimelineTest.cpp
index aa7981b..8da102b 100644
--- a/Source/core/animation/DocumentTimelineTest.cpp
+++ b/Source/core/animation/DocumentTimelineTest.cpp
@@ -102,7 +102,7 @@
     void updateClockAndService(double time)
     {
         document->animationClock().updateTime(time);
-        timeline->serviceAnimations(AnimationPlayer::UpdateForAnimationFrame);
+        timeline->serviceAnimations(TimingUpdateForAnimationFrame);
     }
 
     RefPtr<Document> document;
diff --git a/Source/core/animation/InertAnimation.cpp b/Source/core/animation/InertAnimation.cpp
index 4f4ee13..42479bf 100644
--- a/Source/core/animation/InertAnimation.cpp
+++ b/Source/core/animation/InertAnimation.cpp
@@ -48,7 +48,7 @@
 
 PassOwnPtrWillBeRawPtr<WillBeHeapVector<RefPtrWillBeMember<Interpolation> > > InertAnimation::sample(double inheritedTime)
 {
-    updateInheritedTime(inheritedTime);
+    updateInheritedTime(inheritedTime, TimingUpdateOnDemand);
     if (!isInEffect())
         return nullptr;
 
diff --git a/Source/core/animation/InterpolableValue.cpp b/Source/core/animation/InterpolableValue.cpp
index 97dd774..e1b43a9 100644
--- a/Source/core/animation/InterpolableValue.cpp
+++ b/Source/core/animation/InterpolableValue.cpp
@@ -53,6 +53,7 @@
 #if ENABLE_OILPAN
     visitor->trace(m_values);
 #endif
+    InterpolableValue::trace(visitor);
 }
 
 PassOwnPtrWillBeRawPtr<InterpolableValue> InterpolableAnimatableValue::interpolate(const InterpolableValue &other, const double percentage) const
@@ -68,6 +69,7 @@
 void InterpolableAnimatableValue::trace(Visitor* visitor)
 {
     visitor->trace(m_value);
+    InterpolableValue::trace(visitor);
 }
 
 }
diff --git a/Source/core/animation/InterpolableValue.h b/Source/core/animation/InterpolableValue.h
index 32df14f..3b763aa 100644
--- a/Source/core/animation/InterpolableValue.h
+++ b/Source/core/animation/InterpolableValue.h
@@ -22,7 +22,7 @@
 
     virtual PassOwnPtrWillBeRawPtr<InterpolableValue> clone() const = 0;
 
-    virtual void trace(Visitor*) = 0;
+    virtual void trace(Visitor*) { }
 
 private:
     virtual PassOwnPtrWillBeRawPtr<InterpolableValue> interpolate(const InterpolableValue &to, const double progress) const = 0;
@@ -47,7 +47,7 @@
     double value() const { return m_value; }
     virtual PassOwnPtrWillBeRawPtr<InterpolableValue> clone() const OVERRIDE FINAL { return create(m_value); }
 
-    virtual void trace(Visitor*) OVERRIDE { }
+    virtual void trace(Visitor* visitor) OVERRIDE { InterpolableValue::trace(visitor); }
 
 private:
     virtual PassOwnPtrWillBeRawPtr<InterpolableValue> interpolate(const InterpolableValue &to, const double progress) const OVERRIDE FINAL;
@@ -71,7 +71,7 @@
     bool value() const { return m_value; }
     virtual PassOwnPtrWillBeRawPtr<InterpolableValue> clone() const OVERRIDE FINAL { return create(m_value); }
 
-    virtual void trace(Visitor*) OVERRIDE { }
+    virtual void trace(Visitor* visitor) OVERRIDE { InterpolableValue::trace(visitor); }
 
 private:
     virtual PassOwnPtrWillBeRawPtr<InterpolableValue> interpolate(const InterpolableValue &to, const double progress) const OVERRIDE FINAL;
diff --git a/Source/core/animation/Interpolation.cpp b/Source/core/animation/Interpolation.cpp
index 52fdd8d..1738b81 100644
--- a/Source/core/animation/Interpolation.cpp
+++ b/Source/core/animation/Interpolation.cpp
@@ -5,8 +5,7 @@
 #include "config.h"
 #include "core/animation/Interpolation.h"
 
-#include "core/animation/AnimatableDouble.h"
-#include "core/animation/AnimatableLength.h"
+#include "core/css/CSSCalculationValue.h"
 #include "core/css/resolver/AnimatedStyleBuilder.h"
 #include "core/css/resolver/StyleBuilder.h"
 #include "core/css/resolver/StyleResolverState.h"
@@ -81,6 +80,20 @@
     StyleInterpolation::trace(visitor);
 }
 
+bool LengthStyleInterpolation::canCreateFrom(const CSSValue& value)
+{
+    if (value.isPrimitiveValue()) {
+        const CSSPrimitiveValue& primitiveValue = WebCore::toCSSPrimitiveValue(value);
+        if (primitiveValue.cssCalcValue())
+            return true;
+
+        CSSPrimitiveValue::LengthUnitType type;
+        // Only returns true if the type is a primitive length unit.
+        return CSSPrimitiveValue::unitTypeToLengthUnitType(primitiveValue.primitiveType(), type);
+    }
+    return value.isCalcValue();
+}
+
 PassOwnPtrWillBeRawPtr<InterpolableValue> LengthStyleInterpolation::lengthToInterpolableValue(CSSValue* value)
 {
     OwnPtrWillBeRawPtr<InterpolableList> result = InterpolableList::create(CSSPrimitiveValue::LengthUnitTypeCount);
@@ -159,4 +172,16 @@
     StyleInterpolation::trace(visitor);
 }
 
+void DefaultStyleInterpolation::apply(StyleResolverState& state) const
+{
+    StyleBuilder::applyProperty(m_id, state, toInterpolableBool(m_cachedValue.get())->value() ? m_endCSSValue.get() : m_startCSSValue.get());
+}
+
+void DefaultStyleInterpolation::trace(Visitor* visitor)
+{
+    StyleInterpolation::trace(visitor);
+    visitor->trace(m_startCSSValue);
+    visitor->trace(m_endCSSValue);
+}
+
 }
diff --git a/Source/core/animation/Interpolation.h b/Source/core/animation/Interpolation.h
index 254df7f..206310c 100644
--- a/Source/core/animation/Interpolation.h
+++ b/Source/core/animation/Interpolation.h
@@ -104,6 +104,8 @@
         return adoptRefWillBeNoop(new LengthStyleInterpolation(lengthToInterpolableValue(start), lengthToInterpolableValue(end), id));
     }
 
+    static bool canCreateFrom(const CSSValue&);
+
     virtual void apply(StyleResolverState&) const OVERRIDE;
 
     virtual void trace(Visitor*) OVERRIDE;
@@ -119,6 +121,27 @@
     friend class AnimationInterpolationTest;
 };
 
+class DefaultStyleInterpolation : public StyleInterpolation {
+public:
+    static PassRefPtrWillBeRawPtr<DefaultStyleInterpolation> create(CSSValue* start, CSSValue* end, CSSPropertyID id)
+    {
+        return adoptRefWillBeNoop(new DefaultStyleInterpolation(start, end, id));
+    }
+    virtual void apply(StyleResolverState&) const;
+    virtual void trace(Visitor*) OVERRIDE;
+
+private:
+    DefaultStyleInterpolation(CSSValue* start, CSSValue* end, CSSPropertyID id)
+        : StyleInterpolation(InterpolableBool::create(false), InterpolableBool::create(true), id)
+        , m_startCSSValue(start)
+        , m_endCSSValue(end)
+    {
+    }
+
+    RefPtrWillBeMember<CSSValue> m_startCSSValue;
+    RefPtrWillBeMember<CSSValue> m_endCSSValue;
+};
+
 DEFINE_TYPE_CASTS(StyleInterpolation, Interpolation, value, value->isStyleInterpolation(), value.isStyleInterpolation());
 DEFINE_TYPE_CASTS(LegacyStyleInterpolation, Interpolation, value, value->isLegacyStyleInterpolation(), value.isLegacyStyleInterpolation());
 
diff --git a/Source/core/animation/Keyframe.h b/Source/core/animation/Keyframe.h
index 2e0f933..fa3f70a 100644
--- a/Source/core/animation/Keyframe.h
+++ b/Source/core/animation/Keyframe.h
@@ -66,7 +66,7 @@
         virtual PassOwnPtrWillBeRawPtr<PropertySpecificKeyframe> neutralKeyframe(double offset, PassRefPtr<TimingFunction> easing) const = 0;
         virtual PassRefPtrWillBeRawPtr<Interpolation> createInterpolation(CSSPropertyID, WebCore::Keyframe::PropertySpecificKeyframe* end, Element*) const = 0;
 
-        virtual void trace(Visitor*) = 0;
+        virtual void trace(Visitor*) { }
 
     protected:
         PropertySpecificKeyframe(double offset, PassRefPtr<TimingFunction> easing, AnimationEffect::CompositeOperation);
diff --git a/Source/core/animation/KeyframeEffectModel.cpp b/Source/core/animation/KeyframeEffectModel.cpp
index c1d0d888..580f621 100644
--- a/Source/core/animation/KeyframeEffectModel.cpp
+++ b/Source/core/animation/KeyframeEffectModel.cpp
@@ -201,6 +201,7 @@
 #if ENABLE_OILPAN
     visitor->trace(m_keyframeGroups);
 #endif
+    AnimationEffect::trace(visitor);
 }
 
 Keyframe::PropertySpecificKeyframe::PropertySpecificKeyframe(double offset, PassRefPtr<TimingFunction> easing, AnimationEffect::CompositeOperation composite)
diff --git a/Source/core/animation/KeyframeEffectModelTest.cpp b/Source/core/animation/KeyframeEffectModelTest.cpp
index 7a1a364..02bec9c 100644
--- a/Source/core/animation/KeyframeEffectModelTest.cpp
+++ b/Source/core/animation/KeyframeEffectModelTest.cpp
@@ -51,7 +51,7 @@
 
 PassRefPtrWillBeRawPtr<AnimatableValue> pixelAnimatableValue(double n)
 {
-    return AnimatableLength::create(CSSPrimitiveValue::create(n, CSSPrimitiveValue::CSS_PX).get());
+    return AnimatableLength::create(Length(n, Fixed), 1);
 }
 
 AnimatableValueKeyframeVector keyframesAtZeroAndOne(PassRefPtrWillBeRawPtr<AnimatableValue> zeroValue, PassRefPtrWillBeRawPtr<AnimatableValue> oneValue)
@@ -81,7 +81,7 @@
 
     double actualValue;
     if (value->isLength())
-        actualValue = toCSSPrimitiveValue(toAnimatableLength(value.get())->toCSSValue().get())->getDoubleValue();
+        actualValue = toAnimatableLength(value.get())->length(1, ValueRangeAll).value();
     else
         actualValue = toCSSPrimitiveValue(toAnimatableUnknown(value.get())->toCSSValue().get())->getDoubleValue();
 
diff --git a/Source/core/animation/StringKeyframe.cpp b/Source/core/animation/StringKeyframe.cpp
index 895e19d..c712425 100644
--- a/Source/core/animation/StringKeyframe.cpp
+++ b/Source/core/animation/StringKeyframe.cpp
@@ -5,7 +5,6 @@
 #include "config.h"
 #include "core/animation/StringKeyframe.h"
 
-#include "core/animation/AnimatableLength.h"
 #include "core/animation/Interpolation.h"
 #include "core/animation/css/CSSAnimations.h"
 #include "core/css/resolver/StyleResolver.h"
@@ -22,7 +21,8 @@
 void StringKeyframe::setPropertyValue(CSSPropertyID property, const String& value, StyleSheetContents* styleSheetContents)
 {
     ASSERT(property != CSSPropertyInvalid);
-    m_propertySet->setProperty(property, value, false, styleSheetContents);
+    if (CSSAnimations::isAllowedAnimation(property))
+        m_propertySet->setProperty(property, value, false, styleSheetContents);
 }
 
 PropertySet StringKeyframe::properties() const
@@ -30,12 +30,8 @@
     // This is not used in time-critical code, so we probably don't need to
     // worry about caching this result.
     PropertySet properties;
-    for (unsigned i = 0; i < m_propertySet->propertyCount(); ++i) {
-        // FIXME: Allow for non-animatable properties.
-        CSSPropertyID property = m_propertySet->propertyAt(i).id();
-        if (CSSAnimations::isAnimatableProperty(property))
-            properties.add(property);
-    }
+    for (unsigned i = 0; i < m_propertySet->propertyCount(); ++i)
+        properties.add(m_propertySet->propertyAt(i).id());
     return properties;
 }
 
@@ -71,12 +67,15 @@
     CSSValue* fromCSSValue = m_value.get();
     CSSValue* toCSSValue = toStringPropertySpecificKeyframe(end)->value();
 
+    if (!CSSAnimations::isAnimatableProperty(property))
+        return DefaultStyleInterpolation::create(fromCSSValue, toCSSValue, property);
+
     switch (property) {
     case CSSPropertyLeft:
     case CSSPropertyRight:
     case CSSPropertyWidth:
     case CSSPropertyHeight:
-        if (AnimatableLength::canCreateFrom(fromCSSValue) && AnimatableLength::canCreateFrom(toCSSValue))
+        if (LengthStyleInterpolation::canCreateFrom(*fromCSSValue) && LengthStyleInterpolation::canCreateFrom(*toCSSValue))
             return LengthStyleInterpolation::create(fromCSSValue, toCSSValue, property);
         break;
     default:
@@ -110,6 +109,7 @@
 {
     visitor->trace(m_value);
     visitor->trace(m_animatableValueCache);
+    Keyframe::PropertySpecificKeyframe::trace(visitor);
 }
 
 }
diff --git a/Source/core/animation/TimedItem.cpp b/Source/core/animation/TimedItem.cpp
index 5002823..9743143 100644
--- a/Source/core/animation/TimedItem.cpp
+++ b/Source/core/animation/TimedItem.cpp
@@ -57,7 +57,6 @@
     , m_timing(timing)
     , m_eventDelegate(eventDelegate)
     , m_calculated()
-    , m_isFirstSample(true)
     , m_needsUpdate(true)
     , m_lastUpdateTime(nullValue())
 {
@@ -97,15 +96,12 @@
     specifiedTimingChanged();
 }
 
-void TimedItem::updateInheritedTime(double inheritedTime) const
+void TimedItem::updateInheritedTime(double inheritedTime, TimingUpdateReason reason) const
 {
     bool needsUpdate = m_needsUpdate || (m_lastUpdateTime != inheritedTime && !(isNull(m_lastUpdateTime) && isNull(inheritedTime)));
     m_needsUpdate = false;
     m_lastUpdateTime = inheritedTime;
 
-    const double previousIteration = m_calculated.currentIteration;
-    const Phase previousPhase = m_calculated.phase;
-
     const double localTime = inheritedTime - m_startTime;
     double timeToNextIteration = std::numeric_limits<double>::infinity();
     if (needsUpdate) {
@@ -162,12 +158,9 @@
 
     // Test for events even if timing didn't need an update as the player may have gained a start time.
     // FIXME: Refactor so that we can ASSERT(m_player) here, this is currently required to be nullable for testing.
-    if (!m_player || m_player->hasStartTime()) {
-        // This logic is specific to CSS animation events and assumes that all
-        // animations start after the DocumentTimeline has started.
-        if (m_eventDelegate && (m_isFirstSample || previousPhase != phase() || (phase() == PhaseActive && previousIteration != m_calculated.currentIteration)))
-            m_eventDelegate->onEventCondition(this, m_isFirstSample, previousPhase, previousIteration);
-        m_isFirstSample = false;
+    if (reason == TimingUpdateForAnimationFrame && (!m_player || m_player->hasStartTime())) {
+        if (m_eventDelegate)
+            m_eventDelegate->onEventCondition(this);
     }
 
     if (needsUpdate)  {
@@ -183,7 +176,7 @@
     if (!m_player)
         return m_calculated;
     if (m_player->outdated())
-        m_player->update(AnimationPlayer::UpdateOnDemand);
+        m_player->update(TimingUpdateOnDemand);
     ASSERT(!m_player->outdated());
     return m_calculated;
 }
diff --git a/Source/core/animation/TimedItem.h b/Source/core/animation/TimedItem.h
index 69e82a0..6e026dd 100644
--- a/Source/core/animation/TimedItem.h
+++ b/Source/core/animation/TimedItem.h
@@ -42,6 +42,11 @@
 class TimedItem;
 class TimedItemTiming;
 
+enum TimingUpdateReason {
+    TimingUpdateOnDemand,
+    TimingUpdateForAnimationFrame
+};
+
 static inline bool isNull(double value)
 {
     return std::isnan(value);
@@ -66,7 +71,7 @@
     class EventDelegate {
     public:
         virtual ~EventDelegate() { };
-        virtual void onEventCondition(const TimedItem*, bool isFirstSample, Phase previousPhase, double previousIteration) = 0;
+        virtual void onEventCondition(const TimedItem*) = 0;
     };
 
     virtual ~TimedItem() { }
@@ -111,7 +116,7 @@
     // When TimedItem receives a new inherited time via updateInheritedTime
     // it will (if necessary) recalculate timings and (if necessary) call
     // updateChildrenAndEffects.
-    void updateInheritedTime(double inheritedTime) const;
+    void updateInheritedTime(double inheritedTime, TimingUpdateReason) const;
     void invalidate() const { m_needsUpdate = true; };
     bool hasEvents() const { return m_eventDelegate; }
     void clearEventDelegate() { m_eventDelegate = nullptr; }
@@ -158,7 +163,6 @@
         double timeToForwardsEffectChange;
         double timeToReverseEffectChange;
     } m_calculated;
-    mutable bool m_isFirstSample;
     mutable bool m_needsUpdate;
     mutable double m_lastUpdateTime;
 
diff --git a/Source/core/animation/TimedItemTest.cpp b/Source/core/animation/TimedItemTest.cpp
index 2d48ca3..9bcc621 100644
--- a/Source/core/animation/TimedItemTest.cpp
+++ b/Source/core/animation/TimedItemTest.cpp
@@ -39,27 +39,19 @@
 
 class TestTimedItemEventDelegate : public TimedItem::EventDelegate {
 public:
-    virtual void onEventCondition(const TimedItem* timedItem, bool isFirstSample, TimedItem::Phase previousPhase, double previousIteration) OVERRIDE
+    virtual void onEventCondition(const TimedItem* timedItem) OVERRIDE
     {
         m_eventTriggered = true;
-        m_phaseChanged = previousPhase != timedItem->phase();
-        m_iterationChanged = previousIteration != timedItem->currentIteration();
 
     }
     void reset()
     {
         m_eventTriggered = false;
-        m_phaseChanged = false;
-        m_iterationChanged = false;
     }
     bool eventTriggered() { return m_eventTriggered; }
-    bool phaseChanged() { return m_phaseChanged; }
-    bool iterationChanged() { return m_iterationChanged; }
 
 private:
     bool m_eventTriggered;
-    bool m_phaseChanged;
-    bool m_iterationChanged;
 };
 
 class TestTimedItem : public TimedItem {
@@ -71,8 +63,13 @@
 
     void updateInheritedTime(double time)
     {
+        updateInheritedTime(time, TimingUpdateForAnimationFrame);
+    }
+
+    void updateInheritedTime(double time, TimingUpdateReason reason)
+    {
         m_eventDelegate->reset();
-        TimedItem::updateInheritedTime(time);
+        TimedItem::updateInheritedTime(time, reason);
     }
 
     virtual void updateChildrenAndEffects() const OVERRIDE { }
@@ -723,40 +720,18 @@
     timing.startDelay = 1;
     RefPtr<TestTimedItem> timedItem = TestTimedItem::create(timing);
 
-    // First sample
-    timedItem->updateInheritedTime(0.0);
-    EXPECT_TRUE(timedItem->eventDelegate()->eventTriggered());
-
-    // Before start
-    timedItem->updateInheritedTime(0.5);
+    timedItem->updateInheritedTime(0.0, TimingUpdateOnDemand);
     EXPECT_FALSE(timedItem->eventDelegate()->eventTriggered());
 
-    // First iteration
-    timedItem->updateInheritedTime(1.5);
+    timedItem->updateInheritedTime(0.0, TimingUpdateForAnimationFrame);
     EXPECT_TRUE(timedItem->eventDelegate()->eventTriggered());
-    EXPECT_TRUE(timedItem->eventDelegate()->phaseChanged());
-    EXPECT_TRUE(timedItem->eventDelegate()->iterationChanged());
 
-    timedItem->updateInheritedTime(1.6);
+    timedItem->updateInheritedTime(1.5, TimingUpdateOnDemand);
     EXPECT_FALSE(timedItem->eventDelegate()->eventTriggered());
 
-    // Second iteration
-    timedItem->updateInheritedTime(2.5);
+    timedItem->updateInheritedTime(1.5, TimingUpdateForAnimationFrame);
     EXPECT_TRUE(timedItem->eventDelegate()->eventTriggered());
-    EXPECT_FALSE(timedItem->eventDelegate()->phaseChanged());
-    EXPECT_TRUE(timedItem->eventDelegate()->iterationChanged());
 
-    timedItem->updateInheritedTime(2.6);
-    EXPECT_FALSE(timedItem->eventDelegate()->eventTriggered());
-
-    // After end
-    timedItem->updateInheritedTime(3.5);
-    EXPECT_TRUE(timedItem->eventDelegate()->eventTriggered());
-    EXPECT_TRUE(timedItem->eventDelegate()->phaseChanged());
-    EXPECT_FALSE(timedItem->eventDelegate()->iterationChanged());
-
-    timedItem->updateInheritedTime(3.6);
-    EXPECT_FALSE(timedItem->eventDelegate()->eventTriggered());
 }
 
 TEST(AnimationTimedItemTest, TimeToEffectChange)
diff --git a/Source/core/animation/css/CSSAnimatableValueFactory.cpp b/Source/core/animation/css/CSSAnimatableValueFactory.cpp
index 6151cc5..b9895bb 100644
--- a/Source/core/animation/css/CSSAnimatableValueFactory.cpp
+++ b/Source/core/animation/css/CSSAnimatableValueFactory.cpp
@@ -66,17 +66,9 @@
 {
     switch (length.type()) {
     case Fixed:
-        return AnimatableLength::create(adjustFloatForAbsoluteZoom(length.value(), style), CSSPrimitiveValue::UnitTypePixels);
     case Percent:
-        return AnimatableLength::create(length.value(), CSSPrimitiveValue::UnitTypePercentage);
-    case Calculated: {
-        const CalculationValue& calc = length.calculationValue();
-        if (calc.pixels() && calc.percent())
-            return AnimatableLength::create(CSSCalcValue::createExpressionNode(adjustFloatForAbsoluteZoom(calc.pixels(), style), calc.percent()));
-        if (calc.percent())
-            return createFromLength(Length(calc.percent(), Percent), style);
-        return createFromLength(Length(calc.pixels(), Fixed), style);
-    }
+    case Calculated:
+        return AnimatableLength::create(length, style.effectiveZoom());
     case Auto:
     case Intrinsic:
     case MinIntrinsic:
diff --git a/Source/core/animation/css/CSSAnimations.cpp b/Source/core/animation/css/CSSAnimations.cpp
index fb33249..f615333 100644
--- a/Source/core/animation/css/CSSAnimations.cpp
+++ b/Source/core/animation/css/CSSAnimations.cpp
@@ -58,20 +58,6 @@
 
 namespace {
 
-bool isEarlierPhase(TimedItem::Phase target, TimedItem::Phase reference)
-{
-    ASSERT(target != TimedItem::PhaseNone);
-    ASSERT(reference != TimedItem::PhaseNone);
-    return target < reference;
-}
-
-bool isLaterPhase(TimedItem::Phase target, TimedItem::Phase reference)
-{
-    ASSERT(target != TimedItem::PhaseNone);
-    ASSERT(reference != TimedItem::PhaseNone);
-    return target > reference;
-}
-
 CSSPropertyID propertyForAnimation(CSSPropertyID property)
 {
     switch (property) {
@@ -160,12 +146,14 @@
     if (startKeyframe->offset()) {
         startKeyframe = AnimatableValueKeyframe::create();
         startKeyframe->setOffset(0);
+        startKeyframe->setEasing(defaultTimingFunction);
         keyframes.prepend(startKeyframe);
     }
     RefPtrWillBeRawPtr<AnimatableValueKeyframe> endKeyframe = keyframes[keyframes.size() - 1];
     if (endKeyframe->offset() != 1) {
         endKeyframe = AnimatableValueKeyframe::create();
         endKeyframe->setOffset(1);
+        endKeyframe->setEasing(defaultTimingFunction);
         keyframes.append(endKeyframe);
     }
     ASSERT(keyframes.size() >= 2);
@@ -378,7 +366,9 @@
     DisableCompositingQueryAsserts disabler;
 
     for (Vector<AtomicString>::const_iterator iter = update->cancelledAnimationNames().begin(); iter != update->cancelledAnimationNames().end(); ++iter) {
-        m_animations.take(*iter)->cancel();
+        RefPtr<AnimationPlayer> player = m_animations.take(*iter);
+        player->cancel();
+        player->update(TimingUpdateOnDemand);
     }
 
     for (Vector<AtomicString>::const_iterator iter = update->animationsWithPauseToggled().begin(); iter != update->animationsWithPauseToggled().end(); ++iter) {
@@ -387,6 +377,8 @@
             player->unpause();
         else
             player->pause();
+        if (player->outdated())
+            player->update(TimingUpdateOnDemand);
     }
 
     for (Vector<CSSAnimationUpdate::NewAnimation>::const_iterator iter = update->newAnimations().begin(); iter != update->newAnimations().end(); ++iter) {
@@ -397,7 +389,7 @@
         element->document().compositorPendingAnimations().add(player.get());
         if (inertAnimation->paused())
             player->pause();
-        player->update(AnimationPlayer::UpdateOnDemand);
+        player->update(TimingUpdateOnDemand);
         m_animations.set(iter->name, player.get());
     }
 
@@ -416,6 +408,7 @@
         if (animation->hasActiveAnimationsOnCompositor(id) && update->newTransitions().find(id) != update->newTransitions().end())
             retargetedCompositorTransitions.add(id, std::pair<RefPtr<Animation>, double>(animation, player->startTimeInternal()));
         player->cancel();
+        player->update(TimingUpdateOnDemand);
     }
 
     for (CSSAnimationUpdate::NewTransitionMap::const_iterator iter = update->newTransitions().begin(); iter != update->newTransitions().end(); ++iter) {
@@ -456,7 +449,7 @@
         RefPtr<Animation> transition = Animation::create(element, effect, inertAnimation->specifiedTiming(), Animation::TransitionPriority, eventDelegate.release());
         RefPtr<AnimationPlayer> player = element->document().transitionTimeline().createAnimationPlayer(transition.get());
         element->document().compositorPendingAnimations().add(player.get());
-        player->update(AnimationPlayer::UpdateOnDemand);
+        player->update(TimingUpdateOnDemand);
         runningTransition.player = player;
         m_transitions.set(id, runningTransition);
         ASSERT(id != CSSPropertyInvalid);
@@ -577,11 +570,11 @@
 
     if (activeTransitions) {
         for (TransitionMap::const_iterator iter = activeTransitions->begin(); iter != activeTransitions->end(); ++iter) {
-            const TimedItem* timedItem = iter->value.player->source();
+            const AnimationPlayer& player = *iter->value.player;
             CSSPropertyID id = iter->key;
-            if (timedItem->phase() == TimedItem::PhaseAfter || (!anyTransitionHadAnimateAll && !animationStyleRecalc && !listedProperties.get(id))) {
+            if (player.finishedInternal() || (!anyTransitionHadAnimateAll && !animationStyleRecalc && !listedProperties.get(id))) {
                 // TODO: Figure out why this fails on Chrome OS login page. crbug.com/365507
-                // ASSERT(timedItem->phase() == TimedItem::PhaseAfter || !(activeAnimations && activeAnimations->isAnimationStyleChange()));
+                // ASSERT(player.finishedInternal() || !(activeAnimations && activeAnimations->isAnimationStyleChange()));
                 update->cancelTransition(id);
             }
         }
@@ -590,11 +583,15 @@
 
 void CSSAnimations::cancel()
 {
-    for (AnimationMap::iterator iter = m_animations.begin(); iter != m_animations.end(); ++iter)
+    for (AnimationMap::iterator iter = m_animations.begin(); iter != m_animations.end(); ++iter) {
         iter->value->cancel();
+        iter->value->update(TimingUpdateOnDemand);
+    }
 
-    for (TransitionMap::iterator iter = m_transitions.begin(); iter != m_transitions.end(); ++iter)
+    for (TransitionMap::iterator iter = m_transitions.begin(); iter != m_transitions.end(); ++iter) {
         iter->value.player->cancel();
+        iter->value.player->update(TimingUpdateOnDemand);
+    }
 
     m_animations.clear();
     m_transitions.clear();
@@ -663,39 +660,41 @@
     }
 }
 
-void CSSAnimations::AnimationEventDelegate::onEventCondition(const TimedItem* timedItem, bool isFirstSample, TimedItem::Phase previousPhase, double previousIteration)
+void CSSAnimations::AnimationEventDelegate::onEventCondition(const TimedItem* timedItem)
 {
     const TimedItem::Phase currentPhase = timedItem->phase();
     const double currentIteration = timedItem->currentIteration();
 
-    // Note that the elapsedTime is measured from when the animation starts playing.
-    if (!isFirstSample && previousPhase == TimedItem::PhaseActive && currentPhase == TimedItem::PhaseActive && previousIteration != currentIteration) {
-        ASSERT(!isNull(previousIteration));
-        ASSERT(!isNull(currentIteration));
-        // We fire only a single event for all iterations thast terminate
-        // between a single pair of samples. See http://crbug.com/275263. For
-        // compatibility with the existing implementation, this event uses
-        // the elapsedTime for the first iteration in question.
-        ASSERT(!std::isnan(timedItem->specifiedTiming().iterationDuration));
-        const double elapsedTime = timedItem->specifiedTiming().iterationDuration * (previousIteration + 1);
-        maybeDispatch(Document::ANIMATIONITERATION_LISTENER, EventTypeNames::animationiteration, elapsedTime);
-        return;
-    }
-    if ((isFirstSample || previousPhase == TimedItem::PhaseBefore) && isLaterPhase(currentPhase, TimedItem::PhaseBefore)) {
-        ASSERT(timedItem->specifiedTiming().startDelay > 0 || isFirstSample);
+    if (m_previousPhase != currentPhase
+        && (currentPhase == TimedItem::PhaseActive || currentPhase == TimedItem::PhaseAfter)
+        && (m_previousPhase == TimedItem::PhaseNone || m_previousPhase == TimedItem::PhaseBefore)) {
         // The spec states that the elapsed time should be
         // 'delay < 0 ? -delay : 0', but we always use 0 to match the existing
         // implementation. See crbug.com/279611
         maybeDispatch(Document::ANIMATIONSTART_LISTENER, EventTypeNames::animationstart, 0);
     }
-    if ((isFirstSample || isEarlierPhase(previousPhase, TimedItem::PhaseAfter)) && currentPhase == TimedItem::PhaseAfter)
+
+    if (currentPhase == TimedItem::PhaseActive && m_previousPhase == currentPhase && m_previousIteration != currentIteration) {
+        // We fire only a single event for all iterations thast terminate
+        // between a single pair of samples. See http://crbug.com/275263. For
+        // compatibility with the existing implementation, this event uses
+        // the elapsedTime for the first iteration in question.
+        ASSERT(!std::isnan(timedItem->specifiedTiming().iterationDuration));
+        const double elapsedTime = timedItem->specifiedTiming().iterationDuration * (m_previousIteration + 1);
+        maybeDispatch(Document::ANIMATIONITERATION_LISTENER, EventTypeNames::animationiteration, elapsedTime);
+    }
+
+    if (currentPhase == TimedItem::PhaseAfter && m_previousPhase != TimedItem::PhaseAfter)
         maybeDispatch(Document::ANIMATIONEND_LISTENER, EventTypeNames::animationend, timedItem->activeDurationInternal());
+
+    m_previousPhase = currentPhase;
+    m_previousIteration = currentIteration;
 }
 
-void CSSAnimations::TransitionEventDelegate::onEventCondition(const TimedItem* timedItem, bool isFirstSample, TimedItem::Phase previousPhase, double previousIteration)
+void CSSAnimations::TransitionEventDelegate::onEventCondition(const TimedItem* timedItem)
 {
     const TimedItem::Phase currentPhase = timedItem->phase();
-    if (currentPhase == TimedItem::PhaseAfter && (isFirstSample || previousPhase != currentPhase) && m_target->document().hasListenerType(Document::TRANSITIONEND_LISTENER)) {
+    if (currentPhase == TimedItem::PhaseAfter && currentPhase != m_previousPhase && m_target->document().hasListenerType(Document::TRANSITIONEND_LISTENER)) {
         String propertyName = getPropertyNameString(m_property);
         const Timing& timing = timedItem->specifiedTiming();
         double elapsedTime = timing.iterationDuration;
@@ -705,6 +704,8 @@
         event->setTarget(m_target);
         m_target->document().enqueueAnimationFrameEvent(event);
     }
+
+    m_previousPhase = currentPhase;
 }
 
 bool CSSAnimations::isAnimatableProperty(CSSPropertyID property)
@@ -843,6 +844,46 @@
     return propertyShorthand;
 }
 
+// Animation properties are not allowed to be affected by Web Animations.
+// http://dev.w3.org/fxtf/web-animations/#not-animatable
+bool CSSAnimations::isAllowedAnimation(CSSPropertyID property)
+{
+    switch (property) {
+    case CSSPropertyAnimation:
+    case CSSPropertyAnimationDelay:
+    case CSSPropertyAnimationDirection:
+    case CSSPropertyAnimationDuration:
+    case CSSPropertyAnimationFillMode:
+    case CSSPropertyAnimationIterationCount:
+    case CSSPropertyAnimationName:
+    case CSSPropertyAnimationPlayState:
+    case CSSPropertyAnimationTimingFunction:
+    case CSSPropertyDisplay:
+    case CSSPropertyTransition:
+    case CSSPropertyTransitionDelay:
+    case CSSPropertyTransitionDuration:
+    case CSSPropertyTransitionProperty:
+    case CSSPropertyTransitionTimingFunction:
+    case CSSPropertyWebkitAnimation:
+    case CSSPropertyWebkitAnimationDelay:
+    case CSSPropertyWebkitAnimationDirection:
+    case CSSPropertyWebkitAnimationDuration:
+    case CSSPropertyWebkitAnimationFillMode:
+    case CSSPropertyWebkitAnimationIterationCount:
+    case CSSPropertyWebkitAnimationName:
+    case CSSPropertyWebkitAnimationPlayState:
+    case CSSPropertyWebkitAnimationTimingFunction:
+    case CSSPropertyWebkitTransition:
+    case CSSPropertyWebkitTransitionDelay:
+    case CSSPropertyWebkitTransitionDuration:
+    case CSSPropertyWebkitTransitionProperty:
+    case CSSPropertyWebkitTransitionTimingFunction:
+        return false;
+    default:
+        return true;
+    }
+}
+
 void CSSAnimations::trace(Visitor* visitor)
 {
     visitor->trace(m_transitions);
diff --git a/Source/core/animation/css/CSSAnimations.h b/Source/core/animation/css/CSSAnimations.h
index 11bb1a6..2f36dfb 100644
--- a/Source/core/animation/css/CSSAnimations.h
+++ b/Source/core/animation/css/CSSAnimations.h
@@ -163,6 +163,7 @@
 
     static bool isAnimatableProperty(CSSPropertyID);
     static const StylePropertyShorthand& animatableProperties();
+    static bool isAllowedAnimation(CSSPropertyID);
     // FIXME: This should take a const ScopedStyleTree instead of a StyleResolver.
     // We should also change the Element* to a const Element*
     static PassOwnPtrWillBeRawPtr<CSSAnimationUpdate> calculateUpdate(Element*, const Element& parentElement, const RenderStyle&, RenderStyle* parentStyle, StyleResolver*);
@@ -211,13 +212,17 @@
         AnimationEventDelegate(Element* target, const AtomicString& name)
             : m_target(target)
             , m_name(name)
+            , m_previousPhase(TimedItem::PhaseNone)
+            , m_previousIteration(nullValue())
         {
         }
-        virtual void onEventCondition(const TimedItem*, bool isFirstSample, TimedItem::Phase previousPhase, double previousIteration) OVERRIDE;
+        virtual void onEventCondition(const TimedItem*) OVERRIDE;
     private:
         void maybeDispatch(Document::ListenerType, const AtomicString& eventName, double elapsedTime);
         Element* m_target;
         const AtomicString m_name;
+        TimedItem::Phase m_previousPhase;
+        double m_previousIteration;
     };
 
     class TransitionEventDelegate FINAL : public TimedItem::EventDelegate {
@@ -225,12 +230,14 @@
         TransitionEventDelegate(Element* target, CSSPropertyID property)
             : m_target(target)
             , m_property(property)
+            , m_previousPhase(TimedItem::PhaseNone)
         {
         }
-        virtual void onEventCondition(const TimedItem*, bool isFirstSample, TimedItem::Phase previousPhase, double previousIteration) OVERRIDE;
+        virtual void onEventCondition(const TimedItem*) OVERRIDE;
     private:
         Element* m_target;
         const CSSPropertyID m_property;
+        TimedItem::Phase m_previousPhase;
     };
 };
 
diff --git a/Source/core/animation/css/CSSPropertyEquality.cpp b/Source/core/animation/css/CSSPropertyEquality.cpp
index b4c8dd7..c879652 100644
--- a/Source/core/animation/css/CSSPropertyEquality.cpp
+++ b/Source/core/animation/css/CSSPropertyEquality.cpp
@@ -6,6 +6,7 @@
 #include "core/animation/css/CSSPropertyEquality.h"
 
 #include "core/animation/css/CSSAnimations.h"
+#include "core/rendering/style/DataEquivalency.h"
 #include "core/rendering/style/RenderStyle.h"
 #include "core/rendering/style/ShadowList.h"
 
@@ -39,7 +40,7 @@
                 return false;
             break;
         case CSSPropertyBackgroundImage:
-            if (!StyleImage::imagesEquivalent(aLayer->image(), bLayer->image()))
+            if (!dataEquivalent(aLayer->image(), bLayer->image()))
                 return false;
             break;
         default:
@@ -55,12 +56,6 @@
     return true;
 }
 
-template <typename T>
-bool ptrsOrValuesEqual(T a, T b)
-{
-    return a == b || (a && b && *a == *b);
-}
-
 }
 
 bool CSSPropertyEquality::propertiesEqual(CSSPropertyID prop, const RenderStyle& a, const RenderStyle& b)
@@ -78,7 +73,7 @@
     case CSSPropertyBackgroundSize:
         return fillLayersEqual<CSSPropertyBackgroundSize>(a.backgroundLayers(), b.backgroundLayers());
     case CSSPropertyBaselineShift:
-        return ptrsOrValuesEqual<PassRefPtr<SVGLength> >(a.baselineShiftValue(), b.baselineShiftValue());
+        return dataEquivalent(a.baselineShiftValue(), b.baselineShiftValue());
     case CSSPropertyBorderBottomColor:
         return a.borderBottomColor().resolve(a.color()) == b.borderBottomColor().resolve(b.color())
             && a.visitedLinkBorderBottomColor().resolve(a.color()) == b.visitedLinkBorderBottomColor().resolve(b.color());
@@ -93,7 +88,7 @@
     case CSSPropertyBorderImageSlice:
         return a.borderImageSlices() == b.borderImageSlices();
     case CSSPropertyBorderImageSource:
-        return ptrsOrValuesEqual<StyleImage*>(a.borderImageSource(), b.borderImageSource());
+        return dataEquivalent(a.borderImageSource(), b.borderImageSource());
     case CSSPropertyBorderImageWidth:
         return a.borderImageWidth() == b.borderImageWidth();
     case CSSPropertyBorderLeftColor:
@@ -118,7 +113,7 @@
     case CSSPropertyBottom:
         return a.bottom() == b.bottom();
     case CSSPropertyBoxShadow:
-        return ptrsOrValuesEqual<ShadowList*>(a.boxShadow(), b.boxShadow());
+        return dataEquivalent(a.boxShadow(), b.boxShadow());
     case CSSPropertyClip:
         return a.clip() == b.clip();
     case CSSPropertyColor:
@@ -157,7 +152,7 @@
     case CSSPropertyLineHeight:
         return a.specifiedLineHeight() == b.specifiedLineHeight();
     case CSSPropertyListStyleImage:
-        return ptrsOrValuesEqual<StyleImage*>(a.listStyleImage(), b.listStyleImage());
+        return dataEquivalent(a.listStyleImage(), b.listStyleImage());
     case CSSPropertyMarginBottom:
         return a.marginBottom() == b.marginBottom();
     case CSSPropertyMarginLeft:
@@ -202,7 +197,7 @@
     case CSSPropertyShapeMargin:
         return a.shapeMargin() == b.shapeMargin();
     case CSSPropertyShapeOutside:
-        return ptrsOrValuesEqual<ShapeValue*>(a.shapeOutside(), b.shapeOutside());
+        return dataEquivalent(a.shapeOutside(), b.shapeOutside());
     case CSSPropertyStopColor:
         return a.stopColor() == b.stopColor();
     case CSSPropertyStopOpacity:
@@ -211,22 +206,22 @@
         return a.strokePaintType() == b.strokePaintType()
             && (a.strokePaintType() != SVGPaint::SVG_PAINTTYPE_RGBCOLOR || a.strokePaintColor() == b.strokePaintColor());
     case CSSPropertyStrokeDasharray:
-        return ptrsOrValuesEqual<PassRefPtr<SVGLengthList> >(a.strokeDashArray(), b.strokeDashArray());
+        return dataEquivalent(a.strokeDashArray(), b.strokeDashArray());
     case CSSPropertyStrokeDashoffset:
-        return ptrsOrValuesEqual<PassRefPtr<SVGLength> >(a.strokeDashOffset(), b.strokeDashOffset());
+        return dataEquivalent(a.strokeDashOffset(), b.strokeDashOffset());
     case CSSPropertyStrokeMiterlimit:
         return a.strokeMiterLimit() == b.strokeMiterLimit();
     case CSSPropertyStrokeOpacity:
         return a.strokeOpacity() == b.strokeOpacity();
     case CSSPropertyStrokeWidth:
-        return ptrsOrValuesEqual<PassRefPtr<SVGLength> >(a.strokeWidth(), b.strokeWidth());
+        return dataEquivalent(a.strokeWidth(), b.strokeWidth());
     case CSSPropertyTextDecorationColor:
         return a.textDecorationColor().resolve(a.color()) == b.textDecorationColor().resolve(b.color())
             && a.visitedLinkTextDecorationColor().resolve(a.color()) == b.visitedLinkTextDecorationColor().resolve(b.color());
     case CSSPropertyTextIndent:
         return a.textIndent() == b.textIndent();
     case CSSPropertyTextShadow:
-        return ptrsOrValuesEqual<ShadowList*>(a.textShadow(), b.textShadow());
+        return dataEquivalent(a.textShadow(), b.textShadow());
     case CSSPropertyTop:
         return a.top() == b.top();
     case CSSPropertyVisibility:
@@ -238,9 +233,9 @@
     case CSSPropertyWebkitBorderVerticalSpacing:
         return a.verticalBorderSpacing() == b.verticalBorderSpacing();
     case CSSPropertyWebkitBoxShadow:
-        return ptrsOrValuesEqual<ShadowList*>(a.boxShadow(), b.boxShadow());
+        return dataEquivalent(a.boxShadow(), b.boxShadow());
     case CSSPropertyWebkitClipPath:
-        return ptrsOrValuesEqual<ClipPathOperation*>(a.clipPath(), b.clipPath());
+        return dataEquivalent(a.clipPath(), b.clipPath());
     case CSSPropertyWebkitColumnCount:
         return a.columnCount() == b.columnCount();
     case CSSPropertyWebkitColumnGap:
@@ -259,11 +254,11 @@
     case CSSPropertyWebkitMaskBoxImageSlice:
         return a.maskBoxImageSlices() == b.maskBoxImageSlices();
     case CSSPropertyWebkitMaskBoxImageSource:
-        return ptrsOrValuesEqual<StyleImage*>(a.maskBoxImageSource(), b.maskBoxImageSource());
+        return dataEquivalent(a.maskBoxImageSource(), b.maskBoxImageSource());
     case CSSPropertyWebkitMaskBoxImageWidth:
         return a.maskBoxImageWidth() == b.maskBoxImageWidth();
     case CSSPropertyWebkitMaskImage:
-        return ptrsOrValuesEqual<StyleImage*>(a.maskImage(), b.maskImage());
+        return dataEquivalent(a.maskImage(), b.maskImage());
     case CSSPropertyWebkitMaskPositionX:
         return fillLayersEqual<CSSPropertyWebkitMaskPositionX>(a.maskLayers(), b.maskLayers());
     case CSSPropertyWebkitMaskPositionY:
diff --git a/Source/core/animation/css/TransitionTimeline.cpp b/Source/core/animation/css/TransitionTimeline.cpp
index 9680f98..0952326 100644
--- a/Source/core/animation/css/TransitionTimeline.cpp
+++ b/Source/core/animation/css/TransitionTimeline.cpp
@@ -45,7 +45,6 @@
     : DocumentTimeline(document, timing)
 {
     setZeroTime(document->animationClock().currentTime());
-    document->animationClock().unfreeze();
 }
 
 } // namespace WebCore
diff --git a/Source/core/core.gyp b/Source/core/core.gyp
index db0e63f..658e5a0 100644
--- a/Source/core/core.gyp
+++ b/Source/core/core.gyp
@@ -33,7 +33,6 @@
     '../build/win/precompile.gypi',
     '../build/features.gypi',
     '../build/scripts/scripts.gypi',
-    '../modules/modules.gypi',
     '../bindings/bindings.gypi',
     'core.gypi',
   ],
@@ -250,7 +249,6 @@
         # These files include all the .cpp files generated from the .idl files
         # in webcore_files.
         '<@(bindings_core_generated_aggregate_files)',
-        '<@(bindings_modules_generated_aggregate_files)',
 
         # Additional .cpp files for HashTools.h
         '<(SHARED_INTERMEDIATE_DIR)/blink/CSSPropertyNames.cpp',
@@ -572,6 +570,11 @@
       'sources': [
         '<@(webcore_svg_files)',
       ],
+      'conditions': [
+        ['OS=="win" and buildtype=="Official"', {
+          'msvs_shard': 5,
+        }],
+      ],
     },
     {
       'target_name': 'webcore_rendering',
diff --git a/Source/core/core.gypi b/Source/core/core.gypi
index 1936f4b..dcdba91 100644
--- a/Source/core/core.gypi
+++ b/Source/core/core.gypi
@@ -184,6 +184,7 @@
             'html/HTMLOutputElement.idl',
             'html/HTMLParagraphElement.idl',
             'html/HTMLParamElement.idl',
+            'html/HTMLPictureElement.idl',
             'html/HTMLPreElement.idl',
             'html/HTMLProgressElement.idl',
             'html/HTMLQuoteElement.idl',
@@ -275,9 +276,6 @@
             'plugins/MimeTypeArray.idl',
             'plugins/Plugin.idl',
             'plugins/PluginArray.idl',
-            'speech/SpeechInputEvent.idl',
-            'speech/SpeechInputResult.idl',
-            'speech/SpeechInputResultList.idl',
             'storage/Storage.idl',
             'storage/StorageEvent.idl',
             'svg/SVGAElement.idl',
@@ -510,7 +508,6 @@
             'html/MediaKeyEvent.idl',
             'html/canvas/WebGLContextEvent.idl',
             'html/track/TrackEvent.idl',
-            'speech/SpeechInputEvent.idl',
             'storage/StorageEvent.idl',
             'svg/SVGZoomEvent.idl',
             'xml/XMLHttpRequestProgressEvent.idl',
@@ -1140,6 +1137,8 @@
             'frame/DeviceSensorEventController.h',
             'frame/DeviceSensorEventDispatcher.cpp',
             'frame/DeviceSensorEventDispatcher.h',
+            'frame/EventHandlerRegistry.cpp',
+            'frame/EventHandlerRegistry.h',
             'frame/Frame.cpp',
             'frame/Frame.h',
             'frame/FrameConsole.cpp',
@@ -1531,8 +1530,6 @@
             'rendering/RenderImageResourceStyleImage.cpp',
             'rendering/RenderInline.cpp',
             'rendering/RenderInline.h',
-            'rendering/RenderInputSpeech.cpp',
-            'rendering/RenderInputSpeech.h',
             'rendering/RenderLayer.cpp',
             'rendering/RenderLayerBlendInfo.cpp',
             'rendering/RenderLayerClipper.cpp',
@@ -1575,8 +1572,6 @@
             'rendering/RenderQuote.h',
             'rendering/RenderRegion.cpp',
             'rendering/RenderRegion.h',
-            'rendering/RenderRegionSet.cpp',
-            'rendering/RenderRegionSet.h',
             'rendering/RenderReplaced.cpp',
             'rendering/RenderReplica.cpp',
             'rendering/RenderReplica.h',
@@ -1657,6 +1652,8 @@
             'rendering/compositing/CompositedLayerMapping.cpp',
             'rendering/compositing/CompositedLayerMapping.h',
             'rendering/compositing/CompositedLayerMappingPtr.h',
+            'rendering/compositing/CompositingLayerAssigner.cpp',
+            'rendering/compositing/CompositingLayerAssigner.h',
             'rendering/compositing/CompositingPropertyUpdater.cpp',
             'rendering/compositing/CompositingPropertyUpdater.h',
             'rendering/compositing/CompositingReasonFinder.cpp',
@@ -1773,16 +1770,6 @@
             'rendering/svg/SVGTextQuery.h',
             'rendering/svg/SVGTextRunRenderingContext.cpp',
             'rendering/svg/SVGTextRunRenderingContext.h',
-            'speech/SpeechInput.cpp',
-            'speech/SpeechInput.h',
-            'speech/SpeechInputClient.h',
-            'speech/SpeechInputEvent.cpp',
-            'speech/SpeechInputEvent.h',
-            'speech/SpeechInputListener.h',
-            'speech/SpeechInputResult.cpp',
-            'speech/SpeechInputResult.h',
-            'speech/SpeechInputResultList.cpp',
-            'speech/SpeechInputResultList.h',
             'storage/Storage.cpp',
             'storage/Storage.h',
             'storage/StorageArea.cpp',
@@ -2006,8 +1993,6 @@
             'dom/ElementTraversal.h',
             'dom/EmptyNodeList.cpp',
             'dom/EmptyNodeList.h',
-            'dom/EventHandlerRegistry.cpp',
-            'dom/EventHandlerRegistry.h',
             'dom/ExecutionContext.cpp',
             'dom/ExecutionContext.h',
             'dom/ExecutionContextTask.h',
@@ -2400,6 +2385,7 @@
             'html/HTMLParagraphElement.h',
             'html/HTMLParamElement.cpp',
             'html/HTMLParamElement.h',
+            'html/HTMLPictureElement.cpp',
             'html/HTMLPlugInElement.cpp',
             'html/HTMLPlugInElement.h',
             'html/HTMLPreElement.cpp',
@@ -2465,6 +2451,8 @@
             'html/LabelableElement.cpp',
             'html/LabelsNodeList.cpp',
             'html/LabelsNodeList.h',
+            'html/LinkManifest.cpp',
+            'html/LinkManifest.h',
             'html/LinkRelAttribute.cpp',
             'html/LinkRelAttribute.h',
             'html/LinkResource.cpp',
@@ -2977,8 +2965,6 @@
             'svg/SVGDescElement.h',
             'svg/SVGDiscardElement.cpp',
             'svg/SVGDiscardElement.h',
-            'svg/SVGDocument.cpp',
-            'svg/SVGDocument.h',
             'svg/SVGDocumentExtensions.cpp',
             'svg/SVGElement.cpp',
             'svg/SVGElementInstance.cpp',
diff --git a/Source/core/css/CSSComputedStyleDeclaration.cpp b/Source/core/css/CSSComputedStyleDeclaration.cpp
index 8a3c133..09a0869 100644
--- a/Source/core/css/CSSComputedStyleDeclaration.cpp
+++ b/Source/core/css/CSSComputedStyleDeclaration.cpp
@@ -1111,7 +1111,9 @@
 CSSComputedStyleDeclaration::CSSComputedStyleDeclaration(PassRefPtr<Node> n, bool allowVisitedStyle, const String& pseudoElementName)
     : m_node(n)
     , m_allowVisitedStyle(allowVisitedStyle)
+#if !ENABLE(OILPAN)
     , m_refCount(1)
+#endif
 {
     unsigned nameWithoutColonsStart = pseudoElementName[0] == ':' ? (pseudoElementName[1] == ':' ? 2 : 1) : 0;
     m_pseudoElementSpecifier = CSSSelector::pseudoId(CSSSelector::parsePseudoType(
@@ -1122,6 +1124,7 @@
 {
 }
 
+#if !ENABLE(OILPAN)
 void CSSComputedStyleDeclaration::ref()
 {
     ++m_refCount;
@@ -1133,6 +1136,7 @@
     if (!--m_refCount)
         delete this;
 }
+#endif
 
 String CSSComputedStyleDeclaration::cssText() const
 {
diff --git a/Source/core/css/CSSComputedStyleDeclaration.h b/Source/core/css/CSSComputedStyleDeclaration.h
index 5c9dc09..06aecf6 100644
--- a/Source/core/css/CSSComputedStyleDeclaration.h
+++ b/Source/core/css/CSSComputedStyleDeclaration.h
@@ -49,14 +49,16 @@
 
 class CSSComputedStyleDeclaration FINAL : public CSSStyleDeclaration {
 public:
-    static PassRefPtr<CSSComputedStyleDeclaration> create(PassRefPtr<Node> node, bool allowVisitedStyle = false, const String& pseudoElementName = String())
+    static PassRefPtrWillBeRawPtr<CSSComputedStyleDeclaration> create(PassRefPtr<Node> node, bool allowVisitedStyle = false, const String& pseudoElementName = String())
     {
-        return adoptRef(new CSSComputedStyleDeclaration(node, allowVisitedStyle, pseudoElementName));
+        return adoptRefWillBeNoop(new CSSComputedStyleDeclaration(node, allowVisitedStyle, pseudoElementName));
     }
     virtual ~CSSComputedStyleDeclaration();
 
+#if !ENABLE(OILPAN)
     virtual void ref() OVERRIDE;
     virtual void deref() OVERRIDE;
+#endif
 
     PassRefPtrWillBeRawPtr<CSSValue> getPropertyCSSValue(CSSPropertyID) const;
     String getPropertyValue(CSSPropertyID) const;
@@ -71,6 +73,8 @@
 
     PassRefPtrWillBeRawPtr<MutableStylePropertySet> copyPropertiesInSet(const Vector<CSSPropertyID>&) const;
 
+    virtual void trace(Visitor* visitor) { CSSStyleDeclaration::trace(visitor); }
+
 private:
     CSSComputedStyleDeclaration(PassRefPtr<Node>, bool allowVisitedStyle, const String&);
 
@@ -116,7 +120,9 @@
     RefPtr<Node> m_node;
     PseudoId m_pseudoElementSpecifier;
     bool m_allowVisitedStyle;
+#if !ENABLE(OILPAN)
     unsigned m_refCount;
+#endif
 };
 
 } // namespace WebCore
diff --git a/Source/core/css/CSSFilterRule.cpp b/Source/core/css/CSSFilterRule.cpp
index f533a51..90b3390 100644
--- a/Source/core/css/CSSFilterRule.cpp
+++ b/Source/core/css/CSSFilterRule.cpp
@@ -45,8 +45,10 @@
 
 CSSFilterRule::~CSSFilterRule()
 {
+#if !ENABLE(OILPAN)
     if (m_propertiesCSSOMWrapper)
         m_propertiesCSSOMWrapper->clearParentRule();
+#endif
 }
 
 CSSStyleDeclaration* CSSFilterRule::style() const
@@ -85,6 +87,7 @@
 void CSSFilterRule::trace(Visitor* visitor)
 {
     visitor->trace(m_filterRule);
+    visitor->trace(m_propertiesCSSOMWrapper);
     CSSRule::trace(visitor);
 }
 
diff --git a/Source/core/css/CSSFilterRule.h b/Source/core/css/CSSFilterRule.h
index 55d0415..bd3be8d 100644
--- a/Source/core/css/CSSFilterRule.h
+++ b/Source/core/css/CSSFilterRule.h
@@ -60,7 +60,7 @@
     CSSFilterRule(StyleRuleFilter*, CSSStyleSheet* parent);
 
     RefPtrWillBeMember<StyleRuleFilter> m_filterRule;
-    mutable RefPtr<StyleRuleCSSStyleDeclaration> m_propertiesCSSOMWrapper;
+    mutable RefPtrWillBeMember<StyleRuleCSSStyleDeclaration> m_propertiesCSSOMWrapper;
 };
 
 DEFINE_CSS_RULE_TYPE_CASTS(CSSFilterRule, WEBKIT_FILTER_RULE);
diff --git a/Source/core/css/CSSFontFaceRule.cpp b/Source/core/css/CSSFontFaceRule.cpp
index c4f6e60..276ffbf 100644
--- a/Source/core/css/CSSFontFaceRule.cpp
+++ b/Source/core/css/CSSFontFaceRule.cpp
@@ -37,8 +37,10 @@
 
 CSSFontFaceRule::~CSSFontFaceRule()
 {
+#if !ENABLE(OILPAN)
     if (m_propertiesCSSOMWrapper)
         m_propertiesCSSOMWrapper->clearParentRule();
+#endif
 }
 
 CSSStyleDeclaration* CSSFontFaceRule::style() const
@@ -71,6 +73,7 @@
 void CSSFontFaceRule::trace(Visitor* visitor)
 {
     visitor->trace(m_fontFaceRule);
+    visitor->trace(m_propertiesCSSOMWrapper);
     CSSRule::trace(visitor);
 }
 
diff --git a/Source/core/css/CSSFontFaceRule.h b/Source/core/css/CSSFontFaceRule.h
index cfbf365..8663898 100644
--- a/Source/core/css/CSSFontFaceRule.h
+++ b/Source/core/css/CSSFontFaceRule.h
@@ -54,7 +54,7 @@
     CSSFontFaceRule(StyleRuleFontFace*, CSSStyleSheet* parent);
 
     RefPtrWillBeMember<StyleRuleFontFace> m_fontFaceRule;
-    mutable RefPtr<StyleRuleCSSStyleDeclaration> m_propertiesCSSOMWrapper;
+    mutable RefPtrWillBeMember<StyleRuleCSSStyleDeclaration> m_propertiesCSSOMWrapper;
 };
 
 DEFINE_CSS_RULE_TYPE_CASTS(CSSFontFaceRule, FONT_FACE_RULE);
diff --git a/Source/core/css/CSSFontSelector.cpp b/Source/core/css/CSSFontSelector.cpp
index 4fea17c..f4fb67d 100644
--- a/Source/core/css/CSSFontSelector.cpp
+++ b/Source/core/css/CSSFontSelector.cpp
@@ -52,17 +52,28 @@
 {
 }
 
+FontLoader::~FontLoader()
+{
+#if ENABLE(OILPAN)
+    if (!m_resourceFetcher) {
+        ASSERT(m_fontsToBeginLoading.isEmpty());
+        return;
+    }
+    m_beginLoadingTimer.stop();
+
+    // When the m_fontsToBeginLoading vector is destroyed it will decrement the
+    // request counts on the ResourceFetcher for all the fonts that were pending
+    // at the time the FontLoader dies.
+#endif
+}
+
 void FontLoader::addFontToBeginLoading(FontResource* fontResource)
 {
     if (!m_resourceFetcher || !fontResource->stillNeedsLoad())
         return;
 
-    m_fontsToBeginLoading.append(fontResource);
-    // FIXME: Use RequestCountTracker??!!
-    // Increment the request count now, in order to prevent didFinishLoad from being dispatched
-    // after this font has been requested but before it began loading. Balanced by
-    // decrementRequestCount() in beginLoadTimerFired() and in clearDocument().
-    m_resourceFetcher->incrementRequestCount(fontResource);
+    m_fontsToBeginLoading.append(
+        std::make_pair(fontResource, ResourceLoader::RequestCountTracker(m_resourceFetcher, fontResource)));
     m_beginLoadingTimer.startOneShot(0, FROM_HERE);
 }
 
@@ -75,16 +86,19 @@
 {
     ASSERT(m_resourceFetcher);
 
-    Vector<ResourcePtr<FontResource> > fontsToBeginLoading;
+    FontsToLoadVector fontsToBeginLoading;
     fontsToBeginLoading.swap(m_fontsToBeginLoading);
-
-    for (size_t i = 0; i < fontsToBeginLoading.size(); ++i) {
-        fontsToBeginLoading[i]->beginLoadIfNeeded(m_resourceFetcher);
-        // Balances incrementRequestCount() in beginLoadingFontSoon().
-        m_resourceFetcher->decrementRequestCount(fontsToBeginLoading[i].get());
+    for (FontsToLoadVector::iterator it = fontsToBeginLoading.begin(); it != fontsToBeginLoading.end(); ++it) {
+        FontResource* fontResource = it->first.get();
+        fontResource->beginLoadIfNeeded(m_resourceFetcher);
     }
+
+    // When the local fontsToBeginLoading vector goes out of scope it will
+    // decrement the request counts on the ResourceFetcher for all the fonts
+    // that were just loaded.
 }
 
+#if !ENABLE(OILPAN)
 void FontLoader::clearResourceFetcher()
 {
     if (!m_resourceFetcher) {
@@ -93,14 +107,14 @@
     }
 
     m_beginLoadingTimer.stop();
-
-    for (size_t i = 0; i < m_fontsToBeginLoading.size(); ++i) {
-        // Balances incrementRequestCount() in beginLoadingFontSoon().
-        m_resourceFetcher->decrementRequestCount(m_fontsToBeginLoading[i].get());
-    }
-
     m_fontsToBeginLoading.clear();
-    m_resourceFetcher = 0;
+    m_resourceFetcher = nullptr;
+}
+#endif
+
+void FontLoader::trace(Visitor* visitor)
+{
+    visitor->trace(m_resourceFetcher);
 }
 
 CSSFontSelector::CSSFontSelector(Document* document)
@@ -120,8 +134,8 @@
 
 CSSFontSelector::~CSSFontSelector()
 {
-    clearDocument();
 #if !ENABLE(OILPAN)
+    clearDocument();
     FontCache::fontCache()->removeClient(this);
 #endif
 }
@@ -207,11 +221,13 @@
         face->willUseFontData(fontDescription, character);
 }
 
+#if !ENABLE(OILPAN)
 void CSSFontSelector::clearDocument()
 {
     m_fontLoader.clearResourceFetcher();
-    m_document = 0;
+    m_document = nullptr;
 }
+#endif
 
 void CSSFontSelector::beginLoadingFontSoon(FontResource* font)
 {
@@ -231,9 +247,11 @@
 
 void CSSFontSelector::trace(Visitor* visitor)
 {
+    visitor->trace(m_document);
     visitor->trace(m_fontFaceCache);
     visitor->trace(m_clients);
     visitor->trace(m_fontLoader);
+    FontSelector::trace(visitor);
 }
 
 }
diff --git a/Source/core/css/CSSFontSelector.h b/Source/core/css/CSSFontSelector.h
index d8d48f4..298364d 100644
--- a/Source/core/css/CSSFontSelector.h
+++ b/Source/core/css/CSSFontSelector.h
@@ -27,6 +27,7 @@
 #define CSSFontSelector_h
 
 #include "core/css/FontFaceCache.h"
+#include "core/fetch/ResourceLoader.h"
 #include "core/fetch/ResourcePtr.h"
 #include "platform/Timer.h"
 #include "platform/fonts/FontSelector.h"
@@ -42,29 +43,34 @@
 class CSSFontFaceRule;
 class CSSFontSelectorClient;
 class CSSSegmentedFontFace;
-class FontResource;
 class Document;
 class FontDescription;
+class FontResource;
 class StyleRuleFontFace;
 
 class FontLoader {
     DISALLOW_ALLOCATION();
 public:
     explicit FontLoader(ResourceFetcher*);
+    ~FontLoader();
 
     void addFontToBeginLoading(FontResource*);
     void loadPendingFonts();
 
+#if !ENABLE(OILPAN)
     void clearResourceFetcher();
+#endif
 
-    void trace(Visitor*) { }
+    void trace(Visitor*);
 
 private:
     void beginLoadTimerFired(Timer<FontLoader>*);
 
     Timer<FontLoader> m_beginLoadingTimer;
-    Vector<ResourcePtr<FontResource> > m_fontsToBeginLoading;
-    ResourceFetcher* m_resourceFetcher;
+
+    typedef Vector<std::pair<ResourcePtr<FontResource>, ResourceLoader::RequestCountTracker> > FontsToLoadVector;
+    FontsToLoadVector m_fontsToBeginLoading;
+    RawPtrWillBeMember<ResourceFetcher> m_resourceFetcher;
 };
 
 class CSSFontSelector FINAL : public FontSelector {
@@ -80,7 +86,9 @@
     virtual PassRefPtr<FontData> getFontData(const FontDescription&, const AtomicString&) OVERRIDE;
     virtual void willUseFontData(const FontDescription&, const AtomicString& family, UChar32) OVERRIDE;
 
+#if !ENABLE(OILPAN)
     void clearDocument();
+#endif
 
     void fontLoaded();
 
@@ -108,7 +116,7 @@
 
     void dispatchInvalidationCallbacks();
 
-    Document* m_document;
+    RawPtrWillBeMember<Document> m_document;
     // FIXME: Move to Document or StyleEngine.
     FontFaceCache m_fontFaceCache;
     WillBeHeapHashSet<RawPtrWillBeWeakMember<CSSFontSelectorClient> > m_clients;
diff --git a/Source/core/css/CSSFontSelectorClient.h b/Source/core/css/CSSFontSelectorClient.h
index 6cc30f6..b9096f6 100644
--- a/Source/core/css/CSSFontSelectorClient.h
+++ b/Source/core/css/CSSFontSelectorClient.h
@@ -41,7 +41,7 @@
 
     virtual void fontsNeedUpdate(CSSFontSelector*) = 0;
 
-    virtual void trace(Visitor*) = 0;
+    virtual void trace(Visitor*) { }
 };
 
 } // namespace WebCore
diff --git a/Source/core/css/CSSKeyframeRule.cpp b/Source/core/css/CSSKeyframeRule.cpp
index 7e63a6b..34e3956 100644
--- a/Source/core/css/CSSKeyframeRule.cpp
+++ b/Source/core/css/CSSKeyframeRule.cpp
@@ -146,8 +146,10 @@
 
 CSSKeyframeRule::~CSSKeyframeRule()
 {
+#if !ENABLE(OILPAN)
     if (m_propertiesCSSOMWrapper)
         m_propertiesCSSOMWrapper->clearParentRule();
+#endif
 }
 
 CSSStyleDeclaration* CSSKeyframeRule::style() const
@@ -166,6 +168,7 @@
 void CSSKeyframeRule::trace(Visitor* visitor)
 {
     visitor->trace(m_keyframe);
+    visitor->trace(m_propertiesCSSOMWrapper);
     CSSRule::trace(visitor);
 }
 
diff --git a/Source/core/css/CSSKeyframeRule.h b/Source/core/css/CSSKeyframeRule.h
index 34aff4e..48f1bfa 100644
--- a/Source/core/css/CSSKeyframeRule.h
+++ b/Source/core/css/CSSKeyframeRule.h
@@ -93,7 +93,7 @@
     CSSKeyframeRule(StyleKeyframe*, CSSKeyframesRule* parent);
 
     RefPtrWillBeMember<StyleKeyframe> m_keyframe;
-    mutable RefPtr<StyleRuleCSSStyleDeclaration> m_propertiesCSSOMWrapper;
+    mutable RefPtrWillBeMember<StyleRuleCSSStyleDeclaration> m_propertiesCSSOMWrapper;
 
     friend class CSSKeyframesRule;
 };
diff --git a/Source/core/css/CSSPageRule.cpp b/Source/core/css/CSSPageRule.cpp
index 46ab342..20237e6 100644
--- a/Source/core/css/CSSPageRule.cpp
+++ b/Source/core/css/CSSPageRule.cpp
@@ -40,8 +40,10 @@
 
 CSSPageRule::~CSSPageRule()
 {
+#if !ENABLE(OILPAN)
     if (m_propertiesCSSOMWrapper)
         m_propertiesCSSOMWrapper->clearParentRule();
+#endif
 }
 
 CSSStyleDeclaration* CSSPageRule::style() const
@@ -104,6 +106,7 @@
 void CSSPageRule::trace(Visitor* visitor)
 {
     visitor->trace(m_pageRule);
+    visitor->trace(m_propertiesCSSOMWrapper);
     CSSRule::trace(visitor);
 }
 
diff --git a/Source/core/css/CSSPageRule.h b/Source/core/css/CSSPageRule.h
index b16b635..4fc9b1b 100644
--- a/Source/core/css/CSSPageRule.h
+++ b/Source/core/css/CSSPageRule.h
@@ -56,7 +56,7 @@
     CSSPageRule(StyleRulePage*, CSSStyleSheet*);
 
     RefPtrWillBeMember<StyleRulePage> m_pageRule;
-    mutable RefPtr<StyleRuleCSSStyleDeclaration> m_propertiesCSSOMWrapper;
+    mutable RefPtrWillBeMember<StyleRuleCSSStyleDeclaration> m_propertiesCSSOMWrapper;
 };
 
 DEFINE_CSS_RULE_TYPE_CASTS(CSSPageRule, PAGE_RULE);
diff --git a/Source/core/css/CSSParserValues.cpp b/Source/core/css/CSSParserValues.cpp
index 484272d..86caffe 100644
--- a/Source/core/css/CSSParserValues.cpp
+++ b/Source/core/css/CSSParserValues.cpp
@@ -29,15 +29,26 @@
 
 using namespace WTF;
 
+static void destroy(Vector<CSSParserValue, 4>& values)
+{
+    size_t numValues = values.size();
+    for (size_t i = 0; i < numValues; i++) {
+        if (values[i].unit == CSSParserValue::Function)
+            delete values[i].function;
+        else if (values[i].unit == CSSParserValue::ValueList)
+            delete values[i].valueList;
+    }
+}
+
+void CSSParserValueList::destroyAndClear()
+{
+    destroy(m_values);
+    clearAndLeakValues();
+}
+
 CSSParserValueList::~CSSParserValueList()
 {
-    size_t numValues = m_values.size();
-    for (size_t i = 0; i < numValues; i++) {
-        if (m_values[i].unit == CSSParserValue::Function)
-            delete m_values[i].function;
-        else if (m_values[i].unit == CSSParserValue::ValueList)
-            delete m_values[i].valueList;
-    }
+    destroy(m_values);
 }
 
 void CSSParserValueList::addValue(const CSSParserValue& v)
@@ -54,7 +65,7 @@
 {
     for (unsigned i = 0; i < valueList.size(); ++i)
         m_values.append(*(valueList.valueAt(i)));
-    valueList.clear();
+    valueList.clearAndLeakValues();
 }
 
 PassRefPtrWillBeRawPtr<CSSValue> CSSParserValue::createCSSValue()
diff --git a/Source/core/css/CSSParserValues.h b/Source/core/css/CSSParserValues.h
index 0c1960a..c8926ee 100644
--- a/Source/core/css/CSSParserValues.h
+++ b/Source/core/css/CSSParserValues.h
@@ -195,7 +195,8 @@
 
     CSSParserValue* valueAt(unsigned i) { return i < m_values.size() ? &m_values[i] : 0; }
 
-    void clear() { m_values.clear(); m_current = 0;}
+    void clearAndLeakValues() { m_values.clear(); m_current = 0;}
+    void destroyAndClear();
 
 private:
     unsigned m_current;
diff --git a/Source/core/css/CSSParserValuesTest.cpp b/Source/core/css/CSSParserValuesTest.cpp
index 7e43411..5e7bd92 100644
--- a/Source/core/css/CSSParserValuesTest.cpp
+++ b/Source/core/css/CSSParserValuesTest.cpp
@@ -92,7 +92,7 @@
         value.setFromNumber(3);
         list.addValue(value);
     }
-    list.clear();
+    list.clearAndLeakValues();
     ASSERT_FALSE(list.size());
     ASSERT_FALSE(list.currentIndex());
 }
diff --git a/Source/core/css/CSSPrimitiveValue.cpp b/Source/core/css/CSSPrimitiveValue.cpp
index 34fe4b6..2bcc42b 100644
--- a/Source/core/css/CSSPrimitiveValue.cpp
+++ b/Source/core/css/CSSPrimitiveValue.cpp
@@ -935,7 +935,6 @@
         return CSSPrimitiveValue::CSS_VMIN;
     case UnitTypeViewportMax:
         return CSSPrimitiveValue::CSS_VMAX;
-    case UnitTypeCalc:
     case LengthUnitTypeCount:
         break;
     }
diff --git a/Source/core/css/CSSPrimitiveValue.h b/Source/core/css/CSSPrimitiveValue.h
index 139fb65..d52b054 100644
--- a/Source/core/css/CSSPrimitiveValue.h
+++ b/Source/core/css/CSSPrimitiveValue.h
@@ -154,10 +154,6 @@
 
         // This value must come after the last length unit type to enable iteration over the length unit types.
         LengthUnitTypeCount,
-
-        // FIXME: This is used by AnimatableLength to represent calc objects and is not a type of length value.
-        //        Remove this once we no longer need the distinction.
-        UnitTypeCalc,
     };
 
     typedef Vector<double, CSSPrimitiveValue::LengthUnitTypeCount> CSSLengthArray;
diff --git a/Source/core/css/CSSPrimitiveValueMappings.h b/Source/core/css/CSSPrimitiveValueMappings.h
index 0fc39c2..95885c9 100644
--- a/Source/core/css/CSSPrimitiveValueMappings.h
+++ b/Source/core/css/CSSPrimitiveValueMappings.h
@@ -551,11 +551,6 @@
     case CapsLockIndicatorPart:
         m_value.valueID = CSSValueCapsLockIndicator;
         break;
-    case InputSpeechButtonPart:
-#if ENABLE(INPUT_SPEECH)
-        m_value.valueID = CSSValueWebkitInputSpeechButton;
-#endif
-        break;
     }
 }
 
diff --git a/Source/core/css/CSSProperties.in b/Source/core/css/CSSProperties.in
index f678f78..7397288 100644
--- a/Source/core/css/CSSProperties.in
+++ b/Source/core/css/CSSProperties.in
@@ -1,5 +1,7 @@
 // FIXME: When we have all the properties using the new StyleBuilder, we
 //   should use this for make_css_property_names.py
+// Note that type_name is currently only used for non-custom value application
+// and when explicitly referred to in generated applicators.
 // Note: Mandatory blank line to skip parameter parsing phase
 
 align-content
@@ -63,6 +65,15 @@
 font-variant-ligatures custom_all
 font-weight custom_all
 grid-auto-flow type_name=GridAutoFlow
+grid-auto-columns converter=convertGridTrackSize
+grid-auto-rows converter=convertGridTrackSize
+grid-column-start converter=convertGridPosition
+grid-column-end converter=convertGridPosition
+grid-row-start converter=convertGridPosition
+grid-row-end converter=convertGridPosition
+grid-template-columns custom_all
+grid-template-rows custom_all
+grid-template-areas custom_all
 height type_name=Length, initial=initialSize, converter=convertLengthSizing
 justify-content
 image-rendering
@@ -185,6 +196,7 @@
 -webkit-column-rule-width type_name=unsigned short, converter=convertLineWidth<unsigned short>
 -webkit-column-span type_name=ColumnSpan
 -webkit-column-width type_name=float, custom_all
+-webkit-filter custom_value
 -webkit-font-smoothing font, type_name=FontSmoothingMode
 -webkit-highlight type_name=AtomicString, converter=convertString<CSSValueNone>
 -webkit-hyphenate-character type_name=AtomicString, name_for_methods=HyphenationString, converter=convertString<CSSValueAuto>
@@ -220,6 +232,7 @@
 -webkit-print-color-adjust type_name=PrintColorAdjust
 -webkit-rtl-ordering type_name=Order, getter=rtlOrdering, setter=setRTLOrdering, initial=initialRTLOrdering
 -webkit-ruby-position type_name=RubyPosition
+-webkit-tap-highlight-color custom_value
 -webkit-text-combine type_name=TextCombine
 -webkit-text-emphasis-color custom_all
 -webkit-text-emphasis-position type_name=TextEmphasisPosition
@@ -228,6 +241,8 @@
 -webkit-text-security
 -webkit-text-stroke-color custom_all
 text-underline-position custom_value
+transform custom_value
+-webkit-transform use_handlers_for=CSSPropertyTransform
 transform-origin custom_all
 -webkit-transform-origin-x type_name=Length, converter=convertLength
 -webkit-transform-origin-y type_name=Length, converter=convertLength
@@ -255,14 +270,21 @@
 fill-opacity svg, type_name=float, converter=convertNumberOrPercentage
 fill-rule svg, type_name=WindRule
 filter svg, type_name=String, name_for_methods=FilterResource, converter=convertFragmentIdentifier
+flood-color svg, converter=convertSVGColor
 flood-opacity svg, type_name=float, converter=convertNumberOrPercentage
+glyph-orientation-horizontal svg, converter=convertGlyphOrientation
+glyph-orientation-vertical svg, custom_value
+lighting-color svg, converter=convertSVGColor
 marker-start svg, type_name=String, name_for_methods=MarkerStartResource, converter=convertFragmentIdentifier
 marker-mid svg, type_name=String, name_for_methods=MarkerMidResource, converter=convertFragmentIdentifier
 marker-end svg, type_name=String, name_for_methods=MarkerEndResource, converter=convertFragmentIdentifier
 mask svg, type_name=String, name_for_methods=MaskerResource, converter=convertFragmentIdentifier
 mask-type svg
+paint-order svg, converter=convertPaintOrder
 shape-rendering svg
+stop-color svg, converter=convertSVGColor
 stop-opacity svg, type_name=float, converter=convertNumberOrPercentage
+stroke-dasharray svg, name_for_methods=StrokeDashArray, converter=convertStrokeDasharray
 stroke-dashoffset svg, type_name=SVGLength, name_for_methods=StrokeDashOffset, converter=convertSVGLength
 stroke-linecap svg, type_name=LineCap, name_for_methods=CapStyle
 stroke-linejoin svg, type_name=LineJoin, name_for_methods=JoinStyle
diff --git a/Source/core/css/CSSRuleList.cpp b/Source/core/css/CSSRuleList.cpp
index 21bf906..bfdf30c 100644
--- a/Source/core/css/CSSRuleList.cpp
+++ b/Source/core/css/CSSRuleList.cpp
@@ -57,6 +57,7 @@
 void StaticCSSRuleList::trace(Visitor* visitor)
 {
     visitor->trace(m_rules);
+    CSSRuleList::trace(visitor);
 }
 
 
diff --git a/Source/core/css/CSSRuleList.h b/Source/core/css/CSSRuleList.h
index 07e22f0..81b0fcf 100644
--- a/Source/core/css/CSSRuleList.h
+++ b/Source/core/css/CSSRuleList.h
@@ -48,7 +48,7 @@
 
     virtual CSSStyleSheet* styleSheet() const = 0;
 
-    virtual void trace(Visitor*) = 0;
+    virtual void trace(Visitor*) { }
 
 protected:
     CSSRuleList();
@@ -101,6 +101,7 @@
     virtual void trace(Visitor* visitor) OVERRIDE
     {
         visitor->trace(m_rule);
+        CSSRuleList::trace(visitor);
     }
 
 private:
diff --git a/Source/core/css/CSSSelector.cpp b/Source/core/css/CSSSelector.cpp
index 94238d4..b06280e 100644
--- a/Source/core/css/CSSSelector.cpp
+++ b/Source/core/css/CSSSelector.cpp
@@ -34,7 +34,6 @@
 #include "wtf/HashMap.h"
 #include "wtf/StdLibExtras.h"
 #include "wtf/text/StringBuilder.h"
-#include "wtf/text/StringHash.h"
 
 #ifndef NDEBUG
 #include <stdio.h>
@@ -276,106 +275,117 @@
     unsigned type:8;
 };
 
+// This table should be kept sorted.
 const static NameToPseudoStruct pseudoTypeMap[] = {
-{"active",                        CSSSelector::PseudoActive},
-{"after",                         CSSSelector::PseudoAfter},
 {"-webkit-any(",                  CSSSelector::PseudoAny},
 {"-webkit-any-link",              CSSSelector::PseudoAnyLink},
 {"-webkit-autofill",              CSSSelector::PseudoAutofill},
-{"backdrop",                      CSSSelector::PseudoBackdrop},
-{"before",                        CSSSelector::PseudoBefore},
-{"checked",                       CSSSelector::PseudoChecked},
-{"default",                       CSSSelector::PseudoDefault},
-{"disabled",                      CSSSelector::PseudoDisabled},
-{"read-only",                     CSSSelector::PseudoReadOnly},
-{"read-write",                    CSSSelector::PseudoReadWrite},
-{"valid",                         CSSSelector::PseudoValid},
-{"invalid",                       CSSSelector::PseudoInvalid},
 {"-webkit-drag",                  CSSSelector::PseudoDrag},
-{"empty",                         CSSSelector::PseudoEmpty},
-{"enabled",                       CSSSelector::PseudoEnabled},
-{"first-child",                   CSSSelector::PseudoFirstChild},
-{"first-letter",                  CSSSelector::PseudoFirstLetter},
-{"first-line",                    CSSSelector::PseudoFirstLine},
-{"first-of-type",                 CSSSelector::PseudoFirstOfType},
 {"-webkit-full-page-media",       CSSSelector::PseudoFullPageMedia},
-{"nth-child(",                    CSSSelector::PseudoNthChild},
-{"nth-of-type(",                  CSSSelector::PseudoNthOfType},
-{"nth-last-child(",               CSSSelector::PseudoNthLastChild},
-{"nth-last-of-type(",             CSSSelector::PseudoNthLastOfType},
-{"focus",                         CSSSelector::PseudoFocus},
-{"hover",                         CSSSelector::PseudoHover},
-{"indeterminate",                 CSSSelector::PseudoIndeterminate},
-{"last-child",                    CSSSelector::PseudoLastChild},
-{"last-of-type",                  CSSSelector::PseudoLastOfType},
-{"link",                          CSSSelector::PseudoLink},
-{"lang(",                         CSSSelector::PseudoLang},
-{"not(",                          CSSSelector::PseudoNot},
-{"only-child",                    CSSSelector::PseudoOnlyChild},
-{"only-of-type",                  CSSSelector::PseudoOnlyOfType},
-{"optional",                      CSSSelector::PseudoOptional},
-{"required",                      CSSSelector::PseudoRequired},
+{"-webkit-full-screen",           CSSSelector::PseudoFullScreen},
+{"-webkit-full-screen-ancestor",  CSSSelector::PseudoFullScreenAncestor},
+{"-webkit-full-screen-document",  CSSSelector::PseudoFullScreenDocument},
 {"-webkit-resizer",               CSSSelector::PseudoResizer},
-{"root",                          CSSSelector::PseudoRoot},
 {"-webkit-scrollbar",             CSSSelector::PseudoScrollbar},
 {"-webkit-scrollbar-button",      CSSSelector::PseudoScrollbarButton},
 {"-webkit-scrollbar-corner",      CSSSelector::PseudoScrollbarCorner},
 {"-webkit-scrollbar-thumb",       CSSSelector::PseudoScrollbarThumb},
 {"-webkit-scrollbar-track",       CSSSelector::PseudoScrollbarTrack},
 {"-webkit-scrollbar-track-piece", CSSSelector::PseudoScrollbarTrackPiece},
-{"selection",                     CSSSelector::PseudoSelection},
-{"target",                        CSSSelector::PseudoTarget},
-{"visited",                       CSSSelector::PseudoVisited},
-{"window-inactive",               CSSSelector::PseudoWindowInactive},
-{"decrement",                     CSSSelector::PseudoDecrement},
-{"increment",                     CSSSelector::PseudoIncrement},
-{"start",                         CSSSelector::PseudoStart},
-{"end",                           CSSSelector::PseudoEnd},
-{"horizontal",                    CSSSelector::PseudoHorizontal},
-{"vertical",                      CSSSelector::PseudoVertical},
-{"double-button",                 CSSSelector::PseudoDoubleButton},
-{"single-button",                 CSSSelector::PseudoSingleButton},
-{"no-button",                     CSSSelector::PseudoNoButton},
+{"active",                        CSSSelector::PseudoActive},
+{"after",                         CSSSelector::PseudoAfter},
+{"backdrop",                      CSSSelector::PseudoBackdrop},
+{"before",                        CSSSelector::PseudoBefore},
+{"checked",                       CSSSelector::PseudoChecked},
+{"content",                       CSSSelector::PseudoContent},
 {"corner-present",                CSSSelector::PseudoCornerPresent},
-{"first",                         CSSSelector::PseudoFirstPage},
-{"left",                          CSSSelector::PseudoLeftPage},
-{"right",                         CSSSelector::PseudoRightPage},
-{"-webkit-full-screen",           CSSSelector::PseudoFullScreen},
-{"-webkit-full-screen-document",  CSSSelector::PseudoFullScreenDocument},
-{"-webkit-full-screen-ancestor",  CSSSelector::PseudoFullScreenAncestor},
-{"cue(",                          CSSSelector::PseudoCue},
 {"cue",                           CSSSelector::PseudoWebKitCustomElement},
+{"cue(",                          CSSSelector::PseudoCue},
+{"decrement",                     CSSSelector::PseudoDecrement},
+{"default",                       CSSSelector::PseudoDefault},
+{"disabled",                      CSSSelector::PseudoDisabled},
+{"double-button",                 CSSSelector::PseudoDoubleButton},
+{"empty",                         CSSSelector::PseudoEmpty},
+{"enabled",                       CSSSelector::PseudoEnabled},
+{"end",                           CSSSelector::PseudoEnd},
+{"first",                         CSSSelector::PseudoFirstPage},
+{"first-child",                   CSSSelector::PseudoFirstChild},
+{"first-letter",                  CSSSelector::PseudoFirstLetter},
+{"first-line",                    CSSSelector::PseudoFirstLine},
+{"first-of-type",                 CSSSelector::PseudoFirstOfType},
+{"focus",                         CSSSelector::PseudoFocus},
 {"future",                        CSSSelector::PseudoFutureCue},
-{"past",                          CSSSelector::PseudoPastCue},
-{"in-range",                      CSSSelector::PseudoInRange},
-{"out-of-range",                  CSSSelector::PseudoOutOfRange},
-{"scope",                         CSSSelector::PseudoScope},
-{"unresolved",                    CSSSelector::PseudoUnresolved},
+{"horizontal",                    CSSSelector::PseudoHorizontal},
 {"host",                          CSSSelector::PseudoHost},
 {"host(",                         CSSSelector::PseudoHost},
 {"host-context(",                 CSSSelector::PseudoHostContext},
-{"content",                       CSSSelector::PseudoContent},
+{"hover",                         CSSSelector::PseudoHover},
+{"in-range",                      CSSSelector::PseudoInRange},
+{"increment",                     CSSSelector::PseudoIncrement},
+{"indeterminate",                 CSSSelector::PseudoIndeterminate},
+{"invalid",                       CSSSelector::PseudoInvalid},
+{"lang(",                         CSSSelector::PseudoLang},
+{"last-child",                    CSSSelector::PseudoLastChild},
+{"last-of-type",                  CSSSelector::PseudoLastOfType},
+{"left",                          CSSSelector::PseudoLeftPage},
+{"link",                          CSSSelector::PseudoLink},
+{"no-button",                     CSSSelector::PseudoNoButton},
+{"not(",                          CSSSelector::PseudoNot},
+{"nth-child(",                    CSSSelector::PseudoNthChild},
+{"nth-last-child(",               CSSSelector::PseudoNthLastChild},
+{"nth-last-of-type(",             CSSSelector::PseudoNthLastOfType},
+{"nth-of-type(",                  CSSSelector::PseudoNthOfType},
+{"only-child",                    CSSSelector::PseudoOnlyChild},
+{"only-of-type",                  CSSSelector::PseudoOnlyOfType},
+{"optional",                      CSSSelector::PseudoOptional},
+{"out-of-range",                  CSSSelector::PseudoOutOfRange},
+{"past",                          CSSSelector::PseudoPastCue},
+{"read-only",                     CSSSelector::PseudoReadOnly},
+{"read-write",                    CSSSelector::PseudoReadWrite},
+{"required",                      CSSSelector::PseudoRequired},
+{"right",                         CSSSelector::PseudoRightPage},
+{"root",                          CSSSelector::PseudoRoot},
+{"scope",                         CSSSelector::PseudoScope},
+{"selection",                     CSSSelector::PseudoSelection},
 {"shadow",                        CSSSelector::PseudoShadow},
+{"single-button",                 CSSSelector::PseudoSingleButton},
+{"start",                         CSSSelector::PseudoStart},
+{"target",                        CSSSelector::PseudoTarget},
+{"unresolved",                    CSSSelector::PseudoUnresolved},
+{"valid",                         CSSSelector::PseudoValid},
+{"vertical",                      CSSSelector::PseudoVertical},
+{"visited",                       CSSSelector::PseudoVisited},
+{"window-inactive",               CSSSelector::PseudoWindowInactive},
 };
 
-static HashMap<StringImpl*, CSSSelector::PseudoType>* nameToPseudoTypeMap()
-{
-    static HashMap<StringImpl*, CSSSelector::PseudoType>* nameToPseudoType = 0;
-    if (!nameToPseudoType) {
-        nameToPseudoType = new HashMap<StringImpl*, CSSSelector::PseudoType>;
+class NameToPseudoCompare {
+public:
+    NameToPseudoCompare(const AtomicString& key) : m_key(key) { ASSERT(m_key.is8Bit()); }
 
-        size_t pseudoCount = WTF_ARRAY_LENGTH(pseudoTypeMap);
-        for (size_t i = 0; i < pseudoCount; i++) {
-            const char* str = pseudoTypeMap[i].string;
-            CSSSelector::PseudoType type;
-            type = static_cast<CSSSelector::PseudoType>(pseudoTypeMap[i].type);
-            // This is a one-time leak.
-            AtomicString* name = new AtomicString(str, strlen(str), AtomicString::ConstructFromLiteral);
-            nameToPseudoType->set(name->impl(), type);
-        }
+    bool operator()(const NameToPseudoStruct& entry, const NameToPseudoStruct&)
+    {
+        ASSERT(entry.string);
+        const char* key = reinterpret_cast<const char*>(m_key.characters8());
+        // If strncmp returns 0, then either the keys are equal, or |m_key| sorts before |entry|.
+        return strncmp(entry.string, key, m_key.length()) < 0;
     }
 
-    return nameToPseudoType;
+private:
+    const AtomicString& m_key;
+};
+
+static CSSSelector::PseudoType nameToPseudoType(const AtomicString& name)
+{
+    if (name.isNull() || !name.is8Bit())
+        return CSSSelector::PseudoUnknown;
+
+    const NameToPseudoStruct* pseudoTypeMapEnd = pseudoTypeMap + WTF_ARRAY_LENGTH(pseudoTypeMap);
+    NameToPseudoStruct dummyKey = { 0, CSSSelector::PseudoUnknown };
+    const NameToPseudoStruct* match = std::lower_bound(pseudoTypeMap, pseudoTypeMapEnd, dummyKey, NameToPseudoCompare(name));
+    if (match == pseudoTypeMapEnd || match->string != name.string())
+        return CSSSelector::PseudoUnknown;
+
+    return static_cast<CSSSelector::PseudoType>(match->type);
 }
 
 #ifndef NDEBUG
@@ -412,13 +422,9 @@
 
 CSSSelector::PseudoType CSSSelector::parsePseudoType(const AtomicString& name)
 {
-    if (name.isNull())
-        return PseudoUnknown;
-    HashMap<StringImpl*, CSSSelector::PseudoType>* nameToPseudoType = nameToPseudoTypeMap();
-    HashMap<StringImpl*, CSSSelector::PseudoType>::iterator slot = nameToPseudoType->find(name.impl());
-
-    if (slot != nameToPseudoType->end())
-        return slot->value;
+    CSSSelector::PseudoType pseudoType = nameToPseudoType(name);
+    if (pseudoType != PseudoUnknown)
+        return pseudoType;
 
     if (name.startsWith("-webkit-"))
         return PseudoWebKitCustomElement;
diff --git a/Source/core/css/CSSStyleDeclaration.h b/Source/core/css/CSSStyleDeclaration.h
index 36035ce..78f4816 100644
--- a/Source/core/css/CSSStyleDeclaration.h
+++ b/Source/core/css/CSSStyleDeclaration.h
@@ -35,13 +35,15 @@
 class ExceptionState;
 class MutableStylePropertySet;
 
-class CSSStyleDeclaration : public ScriptWrappable {
-    WTF_MAKE_NONCOPYABLE(CSSStyleDeclaration); WTF_MAKE_FAST_ALLOCATED;
+class CSSStyleDeclaration : public NoBaseWillBeGarbageCollectedFinalized<CSSStyleDeclaration>, public ScriptWrappable {
+    WTF_MAKE_NONCOPYABLE(CSSStyleDeclaration); WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED;
 public:
     virtual ~CSSStyleDeclaration() { }
 
+#if !ENABLE(OILPAN)
     virtual void ref() = 0;
     virtual void deref() = 0;
+#endif
 
     virtual CSSRule* parentRule() const = 0;
     virtual String cssText() const = 0;
@@ -68,6 +70,8 @@
     virtual bool cssPropertyMatches(CSSPropertyID, const CSSValue*) const = 0;
     virtual CSSStyleSheet* parentStyleSheet() const { return 0; }
 
+    virtual void trace(Visitor*) { }
+
 protected:
     CSSStyleDeclaration()
     {
diff --git a/Source/core/css/CSSStyleDeclaration.idl b/Source/core/css/CSSStyleDeclaration.idl
index ccc3be7..96cc639 100644
--- a/Source/core/css/CSSStyleDeclaration.idl
+++ b/Source/core/css/CSSStyleDeclaration.idl
@@ -20,7 +20,8 @@
 
 // Introduced in DOM Level 2:
 [
-    DependentLifetime
+    DependentLifetime,
+    WillBeGarbageCollected
 ] interface CSSStyleDeclaration {
              [TreatReturnedNullStringAs=Null, TreatNullAs=NullString, RaisesException=Setter] attribute DOMString        cssText;
 
diff --git a/Source/core/css/CSSStyleRule.cpp b/Source/core/css/CSSStyleRule.cpp
index 8317440..775583f 100644
--- a/Source/core/css/CSSStyleRule.cpp
+++ b/Source/core/css/CSSStyleRule.cpp
@@ -47,9 +47,10 @@
 
 CSSStyleRule::~CSSStyleRule()
 {
+#if !ENABLE(OILPAN)
     if (m_propertiesCSSOMWrapper)
         m_propertiesCSSOMWrapper->clearParentRule();
-
+#endif
     if (hasCachedSelectorText()) {
         selectorTextCache().remove(this);
         setHasCachedSelectorText(false);
@@ -132,6 +133,7 @@
 void CSSStyleRule::trace(Visitor* visitor)
 {
     visitor->trace(m_styleRule);
+    visitor->trace(m_propertiesCSSOMWrapper);
     CSSRule::trace(visitor);
 }
 
diff --git a/Source/core/css/CSSStyleRule.h b/Source/core/css/CSSStyleRule.h
index 3667ce9..e1258bf 100644
--- a/Source/core/css/CSSStyleRule.h
+++ b/Source/core/css/CSSStyleRule.h
@@ -60,7 +60,7 @@
     String generateSelectorText() const;
 
     RefPtrWillBeMember<StyleRule> m_styleRule;
-    mutable RefPtr<StyleRuleCSSStyleDeclaration> m_propertiesCSSOMWrapper;
+    mutable RefPtrWillBeMember<StyleRuleCSSStyleDeclaration> m_propertiesCSSOMWrapper;
 };
 
 DEFINE_CSS_RULE_TYPE_CASTS(CSSStyleRule, STYLE_RULE);
diff --git a/Source/core/css/CSSStyleSheet.cpp b/Source/core/css/CSSStyleSheet.cpp
index 1d0336a..73c2151 100644
--- a/Source/core/css/CSSStyleSheet.cpp
+++ b/Source/core/css/CSSStyleSheet.cpp
@@ -24,6 +24,7 @@
 #include "HTMLNames.h"
 #include "SVGNames.h"
 #include "bindings/v8/ExceptionState.h"
+#include "bindings/v8/V8Binding.h"
 #include "bindings/v8/V8PerIsolateData.h"
 #include "core/css/CSSCharsetRule.h"
 #include "core/css/CSSImportRule.h"
@@ -54,6 +55,7 @@
     virtual void trace(Visitor* visitor) OVERRIDE
     {
         visitor->trace(m_styleSheet);
+        CSSRuleList::trace(visitor);
     }
 
 private:
@@ -75,7 +77,11 @@
 #if !ASSERT_DISABLED
 static bool isAcceptableCSSStyleSheetParent(Node* parentNode)
 {
-    // Only these nodes can be parents of StyleSheets, and they need to call clearOwnerNode() when moved out of document.
+    // Only these nodes can be parents of StyleSheets, and they need to call
+    // clearOwnerNode() when moved out of document.
+    // Destruction of the style sheet counts as being "moved out of the
+    // document", but only in the non-oilpan version of blink. I.e. don't call
+    // clearOwnerNode() in the owner's destructor in oilpan.
     return !parentNode
         || parentNode->isDocumentNode()
         || isHTMLLinkElement(*parentNode)
@@ -112,7 +118,7 @@
     : m_contents(contents)
     , m_isInlineStylesheet(false)
     , m_isDisabled(false)
-    , m_ownerNode(0)
+    , m_ownerNode(nullptr)
     , m_ownerRule(ownerRule)
     , m_startPosition(TextPosition::minimumPosition())
     , m_loadCompleted(false)
@@ -261,7 +267,7 @@
     didMutate(EntireStyleSheetUpdate);
     if (m_ownerNode)
         m_contents->unregisterClient(this);
-    m_ownerNode = 0;
+    m_ownerNode = nullptr;
 }
 
 bool CSSStyleSheet::canAccessRules() const
@@ -452,10 +458,12 @@
 {
     visitor->trace(m_contents);
     visitor->trace(m_mediaQueries);
+    visitor->trace(m_ownerNode);
     visitor->trace(m_ownerRule);
     visitor->trace(m_mediaCSSOMWrapper);
     visitor->trace(m_childRuleCSSOMWrappers);
     visitor->trace(m_ruleListCSSOMWrapper);
+    StyleSheet::trace(visitor);
 }
 
 }
diff --git a/Source/core/css/CSSStyleSheet.h b/Source/core/css/CSSStyleSheet.h
index 7c82ee0..18d68d5 100644
--- a/Source/core/css/CSSStyleSheet.h
+++ b/Source/core/css/CSSStyleSheet.h
@@ -139,7 +139,7 @@
     String m_title;
     RefPtrWillBeMember<MediaQuerySet> m_mediaQueries;
 
-    Node* m_ownerNode;
+    RawPtrWillBeMember<Node> m_ownerNode;
     RawPtrWillBeMember<CSSRule> m_ownerRule;
 
     TextPosition m_startPosition;
diff --git a/Source/core/css/CSSValueKeywords.in b/Source/core/css/CSSValueKeywords.in
index 406cbca..1dab6a9 100644
--- a/Source/core/css/CSSValueKeywords.in
+++ b/Source/core/css/CSSValueKeywords.in
@@ -655,7 +655,6 @@
 button
 button-bevel
 inner-spin-button
--webkit-input-speech-button
 listbox
 listitem
 media-enter-fullscreen-button
@@ -836,13 +835,6 @@
 economy
 exact
 
-// (-webkit-view-mode:) media feature:
-floating
-fullscreen
-maximized
-minimized
-windowed
-
 // -webkit-hyphenate-limit-lines
 no-limit
 
diff --git a/Source/core/css/CSSViewportRule.cpp b/Source/core/css/CSSViewportRule.cpp
index 2565022..9c56ee4 100644
--- a/Source/core/css/CSSViewportRule.cpp
+++ b/Source/core/css/CSSViewportRule.cpp
@@ -46,8 +46,10 @@
 
 CSSViewportRule::~CSSViewportRule()
 {
+#if !ENABLE(OILPAN)
     if (m_propertiesCSSOMWrapper)
         m_propertiesCSSOMWrapper->clearParentRule();
+#endif
 }
 
 CSSStyleDeclaration* CSSViewportRule::style() const
@@ -84,6 +86,7 @@
 void CSSViewportRule::trace(Visitor* visitor)
 {
     visitor->trace(m_viewportRule);
+    visitor->trace(m_propertiesCSSOMWrapper);
     CSSRule::trace(visitor);
 }
 
diff --git a/Source/core/css/CSSViewportRule.h b/Source/core/css/CSSViewportRule.h
index 101f189..20a84b5 100644
--- a/Source/core/css/CSSViewportRule.h
+++ b/Source/core/css/CSSViewportRule.h
@@ -60,7 +60,7 @@
     CSSViewportRule(StyleRuleViewport*, CSSStyleSheet*);
 
     RefPtrWillBeMember<StyleRuleViewport> m_viewportRule;
-    mutable RefPtr<StyleRuleCSSStyleDeclaration> m_propertiesCSSOMWrapper;
+    mutable RefPtrWillBeMember<StyleRuleCSSStyleDeclaration> m_propertiesCSSOMWrapper;
 };
 
 DEFINE_CSS_RULE_TYPE_CASTS(CSSViewportRule, VIEWPORT_RULE);
diff --git a/Source/core/css/DocumentFontFaceSet.cpp b/Source/core/css/DocumentFontFaceSet.cpp
index a5952c6..2df6c3e 100644
--- a/Source/core/css/DocumentFontFaceSet.cpp
+++ b/Source/core/css/DocumentFontFaceSet.cpp
@@ -30,7 +30,7 @@
 
 namespace WebCore {
 
-PassRefPtr<FontFaceSet> DocumentFontFaceSet::fonts(Document& document)
+PassRefPtrWillBeRawPtr<FontFaceSet> DocumentFontFaceSet::fonts(Document& document)
 {
     return FontFaceSet::from(document);
 }
diff --git a/Source/core/css/DocumentFontFaceSet.h b/Source/core/css/DocumentFontFaceSet.h
index 2aa2d22..b1ecf42 100644
--- a/Source/core/css/DocumentFontFaceSet.h
+++ b/Source/core/css/DocumentFontFaceSet.h
@@ -26,6 +26,7 @@
 #ifndef DocumentFontFaceSet_h
 #define DocumentFontFaceSet_h
 
+#include "platform/heap/Handle.h"
 #include "wtf/PassRefPtr.h"
 
 namespace WebCore {
@@ -35,7 +36,7 @@
 
 class DocumentFontFaceSet {
 public:
-    static PassRefPtr<FontFaceSet> fonts(Document&);
+    static PassRefPtrWillBeRawPtr<FontFaceSet> fonts(Document&);
 };
 
 } // namespace WebCore
diff --git a/Source/core/css/FontFace.cpp b/Source/core/css/FontFace.cpp
index 0f2d58d..4396f4b 100644
--- a/Source/core/css/FontFace.cpp
+++ b/Source/core/css/FontFace.cpp
@@ -379,7 +379,7 @@
     if (m_status == Loaded || m_status == Error) {
         resolveReadyPromises();
 
-        Vector<RefPtr<LoadFontCallback> > callbacks;
+        WillBeHeapVector<RefPtrWillBeMember<LoadFontCallback> > callbacks;
         m_callbacks.swap(callbacks);
         for (size_t i = 0; i < callbacks.size(); ++i) {
             if (m_status == Loaded)
@@ -403,7 +403,7 @@
     return promise;
 }
 
-void FontFace::loadWithCallback(PassRefPtr<LoadFontCallback> callback, ExecutionContext* context)
+void FontFace::loadWithCallback(PassRefPtrWillBeRawPtr<LoadFontCallback> callback, ExecutionContext* context)
 {
     loadInternal(context);
     if (m_status == Loaded)
@@ -627,6 +627,7 @@
     visitor->trace(m_featureSettings);
     visitor->trace(m_error);
     visitor->trace(m_cssFontFace);
+    visitor->trace(m_callbacks);
 }
 
 bool FontFace::hadBlankText() const
diff --git a/Source/core/css/FontFace.h b/Source/core/css/FontFace.h
index a4f466c..8259e31 100644
--- a/Source/core/css/FontFace.h
+++ b/Source/core/css/FontFace.h
@@ -93,13 +93,14 @@
 
     bool hadBlankText() const;
 
-    class LoadFontCallback : public RefCounted<LoadFontCallback> {
+    class LoadFontCallback : public RefCountedWillBeGarbageCollectedFinalized<LoadFontCallback> {
     public:
         virtual ~LoadFontCallback() { }
         virtual void notifyLoaded(FontFace*) = 0;
         virtual void notifyError(FontFace*) = 0;
+        virtual void trace(Visitor*) { }
     };
-    void loadWithCallback(PassRefPtr<LoadFontCallback>, ExecutionContext*);
+    void loadWithCallback(PassRefPtrWillBeRawPtr<LoadFontCallback>, ExecutionContext*);
 
 private:
     FontFace();
@@ -126,7 +127,7 @@
 
     Vector<OwnPtr<FontFaceReadyPromiseResolver> > m_readyResolvers;
     OwnPtrWillBeMember<CSSFontFace> m_cssFontFace;
-    Vector<RefPtr<LoadFontCallback> > m_callbacks;
+    WillBeHeapVector<RefPtrWillBeMember<LoadFontCallback> > m_callbacks;
 };
 
 typedef WillBeHeapVector<RefPtrWillBeMember<FontFace> > FontFaceArray;
diff --git a/Source/core/css/FontFaceSet.cpp b/Source/core/css/FontFaceSet.cpp
index 4b36a8e..8621037 100644
--- a/Source/core/css/FontFaceSet.cpp
+++ b/Source/core/css/FontFaceSet.cpp
@@ -48,11 +48,11 @@
 static const int defaultFontSize = 10;
 static const char defaultFontFamily[] = "sans-serif";
 
-class LoadFontPromiseResolver : public FontFace::LoadFontCallback {
+class LoadFontPromiseResolver FINAL : public FontFace::LoadFontCallback {
 public:
-    static PassRefPtr<LoadFontPromiseResolver> create(FontFaceArray faces, ExecutionContext* context)
+    static PassRefPtrWillBeRawPtr<LoadFontPromiseResolver> create(FontFaceArray faces, ExecutionContext* context)
     {
-        return adoptRef(new LoadFontPromiseResolver(faces, context));
+        return adoptRefWillBeNoop(new LoadFontPromiseResolver(faces, context));
     }
 
     void loadFonts(ExecutionContext*);
@@ -61,6 +61,8 @@
     virtual void notifyLoaded(FontFace*) OVERRIDE;
     virtual void notifyError(FontFace*) OVERRIDE;
 
+    virtual void trace(Visitor*) OVERRIDE;
+
 private:
     LoadFontPromiseResolver(FontFaceArray faces, ExecutionContext* context)
         : m_numLoading(faces.size())
@@ -70,7 +72,7 @@
         m_fontFaces.swap(faces);
     }
 
-    WillBePersistentHeapVector<RefPtrWillBeMember<FontFace> > m_fontFaces;
+    WillBeHeapVector<RefPtrWillBeMember<FontFace> > m_fontFaces;
     int m_numLoading;
     bool m_errorOccured;
     RefPtr<ScriptPromiseResolverWithContext> m_resolver;
@@ -105,14 +107,20 @@
     }
 }
 
+void LoadFontPromiseResolver::trace(Visitor* visitor)
+{
+    visitor->trace(m_fontFaces);
+    LoadFontCallback::trace(visitor);
+}
+
 class FontsReadyPromiseResolver {
 public:
-    static PassOwnPtr<FontsReadyPromiseResolver> create(ExecutionContext* context)
+    static PassOwnPtr<FontsReadyPromiseResolver> create(ScriptState* scriptState)
     {
-        return adoptPtr(new FontsReadyPromiseResolver(context));
+        return adoptPtr(new FontsReadyPromiseResolver(scriptState));
     }
 
-    void resolve(PassRefPtr<FontFaceSet> fontFaceSet)
+    void resolve(PassRefPtrWillBeRawPtr<FontFaceSet> fontFaceSet)
     {
         m_resolver->resolve(fontFaceSet);
     }
@@ -120,8 +128,8 @@
     ScriptPromise promise() { return m_resolver->promise(); }
 
 private:
-    FontsReadyPromiseResolver(ExecutionContext* context)
-        : m_resolver(ScriptPromiseResolverWithContext::create(ScriptState::current(toIsolate(context))))
+    explicit FontsReadyPromiseResolver(ScriptState* scriptState)
+        : m_resolver(ScriptPromiseResolverWithContext::create(scriptState))
     {
     }
 
@@ -259,11 +267,11 @@
         handlePendingEventsAndPromisesSoon();
 }
 
-ScriptPromise FontFaceSet::ready()
+ScriptPromise FontFaceSet::ready(ScriptState* scriptState)
 {
     if (!inActiveDocumentContext())
         return ScriptPromise();
-    OwnPtr<FontsReadyPromiseResolver> resolver = FontsReadyPromiseResolver::create(executionContext());
+    OwnPtr<FontsReadyPromiseResolver> resolver = FontsReadyPromiseResolver::create(scriptState);
     ScriptPromise promise = resolver->promise();
     m_readyResolvers.append(resolver.release());
     handlePendingEventsAndPromisesSoon();
@@ -428,14 +436,14 @@
     return s.isNull() ? space : s;
 }
 
-ScriptPromise FontFaceSet::load(const String& fontString, const String& text)
+ScriptPromise FontFaceSet::load(ScriptState* scriptState, const String& fontString, const String& text)
 {
     if (!inActiveDocumentContext())
         return ScriptPromise();
 
     Font font;
     if (!resolveFontStyle(fontString, font)) {
-        RefPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::create(executionContext());
+        RefPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::create(scriptState);
         ScriptPromise promise = resolver->promise();
         resolver->reject(DOMError::create(SyntaxError, "Could not resolve '" + fontString + "' as a font."));
         return promise;
@@ -449,7 +457,7 @@
             segmentedFontFace->match(nullToSpace(text), faces);
     }
 
-    RefPtr<LoadFontPromiseResolver> resolver = LoadFontPromiseResolver::create(faces, executionContext());
+    RefPtrWillBeRawPtr<LoadFontPromiseResolver> resolver = LoadFontPromiseResolver::create(faces, executionContext());
     ScriptPromise promise = resolver->promise();
     resolver->loadFonts(executionContext()); // After this, resolver->promise() may return null.
     return promise;
@@ -572,6 +580,7 @@
     visitor->trace(m_loadedFonts);
     visitor->trace(m_failedFonts);
     visitor->trace(m_nonCSSConnectedFaces);
+    DocumentSupplement::trace(visitor);
 }
 #endif
 
diff --git a/Source/core/css/FontFaceSet.h b/Source/core/css/FontFaceSet.h
index 175f3df..774afab 100644
--- a/Source/core/css/FontFaceSet.h
+++ b/Source/core/css/FontFaceSet.h
@@ -75,8 +75,8 @@
     DEFINE_ATTRIBUTE_EVENT_LISTENER(loadingerror);
 
     bool check(const String& font, const String& text, ExceptionState&);
-    ScriptPromise load(const String& font, const String& text);
-    ScriptPromise ready();
+    ScriptPromise load(ScriptState*, const String& font, const String& text);
+    ScriptPromise ready(ScriptState*);
 
     void add(FontFace*, ExceptionState&);
     void clear();
diff --git a/Source/core/css/FontFaceSet.idl b/Source/core/css/FontFaceSet.idl
index b17e7fc..c051b27 100644
--- a/Source/core/css/FontFaceSet.idl
+++ b/Source/core/css/FontFaceSet.idl
@@ -42,8 +42,8 @@
     attribute EventHandler onloadingerror;
 
     [RaisesException] boolean check(DOMString font, [Default=NullString] optional DOMString text);
-    Promise load(DOMString font, [Default=NullString] optional DOMString text);
-    Promise ready();
+    [CallWith=ScriptState] Promise load(DOMString font, [Default=NullString] optional DOMString text);
+    [CallWith=ScriptState] Promise ready();
 
     [RaisesException] void add(FontFace fontFace);
     void clear();
diff --git a/Source/core/css/MediaFeatureNames.in b/Source/core/css/MediaFeatureNames.in
index 4b10342..f94bd9b 100644
--- a/Source/core/css/MediaFeatureNames.in
+++ b/Source/core/css/MediaFeatureNames.in
@@ -38,8 +38,5 @@
 min-resolution
 pointer
 resolution
--webkit-transform-2d
 -webkit-transform-3d
 scan
--webkit-animation
--webkit-view-mode
diff --git a/Source/core/css/MediaQueryEvaluator.cpp b/Source/core/css/MediaQueryEvaluator.cpp
index 389a5c2..bc87d44 100644
--- a/Source/core/css/MediaQueryEvaluator.cpp
+++ b/Source/core/css/MediaQueryEvaluator.cpp
@@ -503,28 +503,6 @@
     return resolutionMediaFeatureEval(value, MaxPrefix, mediaValues);
 }
 
-static bool animationMediaFeatureEval(const MediaQueryExpValue& value, MediaFeaturePrefix op, const MediaValues& mediaValues)
-{
-    UseCounter::count(mediaValues.document(), UseCounter::PrefixedAnimationMediaFeature);
-
-    if (value.isValid()) {
-        float number;
-        return numberValue(value, number) && compareValue(1, static_cast<int>(number), op);
-    }
-    return true;
-}
-
-static bool transform2dMediaFeatureEval(const MediaQueryExpValue& value, MediaFeaturePrefix op, const MediaValues& mediaValues)
-{
-    UseCounter::count(mediaValues.document(), UseCounter::PrefixedTransform2dMediaFeature);
-
-    if (value.isValid()) {
-        float number;
-        return numberValue(value, number) && compareValue(1, static_cast<int>(number), op);
-    }
-    return true;
-}
-
 static bool transform3dMediaFeatureEval(const MediaQueryExpValue& value, MediaFeaturePrefix op, const MediaValues& mediaValues)
 {
     UseCounter::count(mediaValues.document(), UseCounter::PrefixedTransform3dMediaFeature);
@@ -544,18 +522,6 @@
     return returnValueIfNoParameter;
 }
 
-static bool viewModeMediaFeatureEval(const MediaQueryExpValue& value, MediaFeaturePrefix, const MediaValues& mediaValues)
-{
-    UseCounter::count(mediaValues.document(), UseCounter::PrefixedViewModeMediaFeature);
-
-    if (!value.isValid())
-        return true;
-
-    ASSERT(value.isID);
-
-    return value.id == CSSValueWindowed;
-}
-
 static bool hoverMediaFeatureEval(const MediaQueryExpValue& value, MediaFeaturePrefix, const MediaValues& mediaValues)
 {
     MediaValues::PointerDeviceType pointer = mediaValues.pointer();
diff --git a/Source/core/css/MediaQueryExp.cpp b/Source/core/css/MediaQueryExp.cpp
index 335c58f..334f596 100644
--- a/Source/core/css/MediaQueryExp.cpp
+++ b/Source/core/css/MediaQueryExp.cpp
@@ -48,7 +48,6 @@
         return false;
 
     return mediaFeature == orientationMediaFeature
-        || mediaFeature == viewModeMediaFeature
         || mediaFeature == pointerMediaFeature
         || mediaFeature == scanMediaFeature;
 }
@@ -58,19 +57,6 @@
     if (mediaFeature == orientationMediaFeature)
         return ident == CSSValuePortrait || ident == CSSValueLandscape;
 
-    if (mediaFeature == viewModeMediaFeature) {
-        switch (ident) {
-        case CSSValueWindowed:
-        case CSSValueFloating:
-        case CSSValueFullscreen:
-        case CSSValueMaximized:
-        case CSSValueMinimized:
-            return true;
-        default:
-            return false;
-        }
-    }
-
     if (mediaFeature == pointerMediaFeature)
         return ident == CSSValueNone || ident == CSSValueCoarse || ident == CSSValueFine;
 
@@ -132,9 +118,7 @@
     if (value->unit != CSSPrimitiveValue::CSS_NUMBER || value->fValue < 0)
         return false;
 
-    return mediaFeature == transform2dMediaFeature
-        || mediaFeature == transform3dMediaFeature
-        || mediaFeature == animationMediaFeature
+    return mediaFeature == transform3dMediaFeature
         || mediaFeature == devicePixelRatioMediaFeature
         || mediaFeature == maxDevicePixelRatioMediaFeature
         || mediaFeature == minDevicePixelRatioMediaFeature;
@@ -174,10 +158,7 @@
         || mediaFeature == aspectRatioMediaFeature
         || mediaFeature == deviceAspectRatioMediaFeature
         || mediaFeature == hoverMediaFeature
-        || mediaFeature == transform2dMediaFeature
         || mediaFeature == transform3dMediaFeature
-        || mediaFeature == animationMediaFeature
-        || mediaFeature == viewModeMediaFeature
         || mediaFeature == pointerMediaFeature
         || mediaFeature == devicePixelRatioMediaFeature
         || mediaFeature == resolutionMediaFeature
diff --git a/Source/core/css/MediaValues.cpp b/Source/core/css/MediaValues.cpp
index 5ae52fc..89ae894 100644
--- a/Source/core/css/MediaValues.cpp
+++ b/Source/core/css/MediaValues.cpp
@@ -118,7 +118,7 @@
     ASSERT(frame && frame->contentRenderer() && frame->contentRenderer()->compositor());
     bool threeDEnabled = false;
     if (RenderView* view = frame->contentRenderer())
-        threeDEnabled = view->compositor()->canRender3DTransforms();
+        threeDEnabled = view->compositor()->hasAcceleratedCompositing();
     return threeDEnabled;
 }
 
@@ -196,10 +196,9 @@
         return false;
     }
 
+    ASSERT(factor > 0);
     result = value * factor;
     return true;
-
-    ASSERT(factor > 0);
 }
 
 } // namespace
diff --git a/Source/core/css/MediaValuesCached.cpp b/Source/core/css/MediaValuesCached.cpp
index 60caa50..01e6742 100644
--- a/Source/core/css/MediaValuesCached.cpp
+++ b/Source/core/css/MediaValuesCached.cpp
@@ -34,7 +34,8 @@
 {
     // FIXME - Added an assert here so we can better understand when a frame is present without its view().
     ASSERT(!frame || frame->view());
-    if (!frame || !frame->view())
+    // FIXME - Because of crbug.com/371084, document()->renderView() may be null here.
+    if (!frame || !frame->view() || !frame->document() || !frame->document()->renderView())
         return adoptRef(new MediaValuesCached());
     return adoptRef(new MediaValuesCached(frame));
 }
diff --git a/Source/core/css/PropertySetCSSStyleDeclaration.cpp b/Source/core/css/PropertySetCSSStyleDeclaration.cpp
index 9c1b6d8..af3fbc3 100644
--- a/Source/core/css/PropertySetCSSStyleDeclaration.cpp
+++ b/Source/core/css/PropertySetCSSStyleDeclaration.cpp
@@ -126,6 +126,7 @@
 
 } // namespace
 
+#if !ENABLE(OILPAN)
 void PropertySetCSSStyleDeclaration::ref()
 {
     m_propertySet->ref();
@@ -135,6 +136,13 @@
 {
     m_propertySet->deref();
 }
+#endif
+
+void PropertySetCSSStyleDeclaration::trace(Visitor* visitor)
+{
+    visitor->trace(m_propertySet);
+    AbstractPropertySetCSSStyleDeclaration::trace(visitor);
+}
 
 unsigned AbstractPropertySetCSSStyleDeclaration::length() const
 {
@@ -272,7 +280,7 @@
     // The map is here to maintain the object identity of the CSSValues over multiple invocations.
     // FIXME: It is likely that the identity is not important for web compatibility and this code should be removed.
     if (!m_cssomCSSValueClones)
-        m_cssomCSSValueClones = adoptPtrWillBeNoop(new WillBeHeapHashMap<CSSValue*, RefPtrWillBeMember<CSSValue> >);
+        m_cssomCSSValueClones = adoptPtrWillBeNoop(new WillBeHeapHashMap<RawPtrWillBeMember<CSSValue>, RefPtrWillBeMember<CSSValue> >);
 
     RefPtrWillBeMember<CSSValue>& clonedValue = m_cssomCSSValueClones->add(internalValue, RefPtrWillBeMember<CSSValue>()).storedValue->value;
     if (!clonedValue)
@@ -296,19 +304,34 @@
     return propertySet().propertyMatches(propertyID, propertyValue);
 }
 
+void AbstractPropertySetCSSStyleDeclaration::trace(Visitor* visitor)
+{
+#if ENABLE(OILPAN)
+    visitor->trace(m_cssomCSSValueClones);
+#endif
+    CSSStyleDeclaration::trace(visitor);
+}
+
 StyleRuleCSSStyleDeclaration::StyleRuleCSSStyleDeclaration(MutableStylePropertySet& propertySetArg, CSSRule* parentRule)
     : PropertySetCSSStyleDeclaration(propertySetArg)
+#if !ENABLE(OILPAN)
     , m_refCount(1)
+#endif
     , m_parentRule(parentRule)
 {
+#if !ENABLE(OILPAN)
     m_propertySet->ref();
+#endif
 }
 
 StyleRuleCSSStyleDeclaration::~StyleRuleCSSStyleDeclaration()
 {
+#if !ENABLE(OILPAN)
     m_propertySet->deref();
+#endif
 }
 
+#if !ENABLE(OILPAN)
 void StyleRuleCSSStyleDeclaration::ref()
 {
     ++m_refCount;
@@ -320,6 +343,7 @@
     if (!--m_refCount)
         delete this;
 }
+#endif
 
 void StyleRuleCSSStyleDeclaration::willMutate()
 {
@@ -344,9 +368,19 @@
 
 void StyleRuleCSSStyleDeclaration::reattach(MutableStylePropertySet& propertySet)
 {
+#if !ENABLE(OILPAN)
     m_propertySet->deref();
+#endif
     m_propertySet = &propertySet;
+#if !ENABLE(OILPAN)
     m_propertySet->ref();
+#endif
+}
+
+void StyleRuleCSSStyleDeclaration::trace(Visitor* visitor)
+{
+    visitor->trace(m_parentRule);
+    PropertySetCSSStyleDeclaration::trace(visitor);
 }
 
 MutableStylePropertySet& InlineCSSStyleDeclaration::propertySet() const
@@ -375,6 +409,7 @@
     return m_parentElement ? &m_parentElement->document().elementSheet() : 0;
 }
 
+#if !ENABLE(OILPAN)
 void InlineCSSStyleDeclaration::ref()
 {
     m_parentElement->ref();
@@ -384,5 +419,12 @@
 {
     m_parentElement->deref();
 }
+#endif
+
+void InlineCSSStyleDeclaration::trace(Visitor* visitor)
+{
+    visitor->trace(m_parentElement);
+    AbstractPropertySetCSSStyleDeclaration::trace(visitor);
+}
 
 } // namespace WebCore
diff --git a/Source/core/css/PropertySetCSSStyleDeclaration.h b/Source/core/css/PropertySetCSSStyleDeclaration.h
index ad87376..e38bd45 100644
--- a/Source/core/css/PropertySetCSSStyleDeclaration.h
+++ b/Source/core/css/PropertySetCSSStyleDeclaration.h
@@ -43,9 +43,10 @@
 class AbstractPropertySetCSSStyleDeclaration : public CSSStyleDeclaration {
 public:
     virtual Element* parentElement() const { return 0; }
-    virtual void clearParentElement() { ASSERT_NOT_REACHED(); }
     StyleSheetContents* contextStyleSheet() const;
 
+    virtual void trace(Visitor*) OVERRIDE;
+
 private:
     virtual CSSRule* parentRule() const OVERRIDE { return 0; }
     virtual unsigned length() const OVERRIDE FINAL;
@@ -74,37 +75,45 @@
     virtual void didMutate(MutationType) { }
     virtual MutableStylePropertySet& propertySet() const = 0;
 
-    OwnPtrWillBePersistent<WillBeHeapHashMap<CSSValue*, RefPtrWillBeMember<CSSValue> > > m_cssomCSSValueClones;
+    OwnPtrWillBeMember<WillBeHeapHashMap<RawPtrWillBeMember<CSSValue>, RefPtrWillBeMember<CSSValue> > > m_cssomCSSValueClones;
 };
 
 class PropertySetCSSStyleDeclaration : public AbstractPropertySetCSSStyleDeclaration {
 public:
     PropertySetCSSStyleDeclaration(MutableStylePropertySet& propertySet) : m_propertySet(&propertySet) { }
 
+#if !ENABLE(OILPAN)
     virtual void ref() OVERRIDE;
     virtual void deref() OVERRIDE;
+#endif
+
+    virtual void trace(Visitor*) OVERRIDE;
 
 protected:
     virtual MutableStylePropertySet& propertySet() const OVERRIDE FINAL { ASSERT(m_propertySet); return *m_propertySet; }
 
-    MutableStylePropertySet* m_propertySet; // Cannot be null
+    RawPtrWillBeMember<MutableStylePropertySet> m_propertySet; // Cannot be null
 };
 
 class StyleRuleCSSStyleDeclaration FINAL : public PropertySetCSSStyleDeclaration
 {
 public:
-    static PassRefPtr<StyleRuleCSSStyleDeclaration> create(MutableStylePropertySet& propertySet, CSSRule* parentRule)
+    static PassRefPtrWillBeRawPtr<StyleRuleCSSStyleDeclaration> create(MutableStylePropertySet& propertySet, CSSRule* parentRule)
     {
-        return adoptRef(new StyleRuleCSSStyleDeclaration(propertySet, parentRule));
+        return adoptRefWillBeNoop(new StyleRuleCSSStyleDeclaration(propertySet, parentRule));
     }
 
-    void clearParentRule() { m_parentRule = 0; }
+#if !ENABLE(OILPAN)
+    void clearParentRule() { m_parentRule = nullptr; }
 
     virtual void ref() OVERRIDE;
     virtual void deref() OVERRIDE;
+#endif
 
     void reattach(MutableStylePropertySet&);
 
+    virtual void trace(Visitor*) OVERRIDE;
+
 private:
     StyleRuleCSSStyleDeclaration(MutableStylePropertySet&, CSSRule*);
     virtual ~StyleRuleCSSStyleDeclaration();
@@ -116,8 +125,10 @@
     virtual void willMutate() OVERRIDE;
     virtual void didMutate(MutationType) OVERRIDE;
 
+#if !ENABLE(OILPAN)
     unsigned m_refCount;
-    CSSRule* m_parentRule;
+#endif
+    RawPtrWillBeMember<CSSRule> m_parentRule;
 };
 
 class InlineCSSStyleDeclaration FINAL : public AbstractPropertySetCSSStyleDeclaration
@@ -128,17 +139,20 @@
     {
     }
 
+    virtual void trace(Visitor*) OVERRIDE;
+
 private:
     virtual MutableStylePropertySet& propertySet() const OVERRIDE;
+#if !ENABLE(OILPAN)
     virtual void ref() OVERRIDE;
     virtual void deref() OVERRIDE;
+#endif
     virtual CSSStyleSheet* parentStyleSheet() const OVERRIDE;
     virtual Element* parentElement() const OVERRIDE { return m_parentElement; }
-    virtual void clearParentElement() OVERRIDE { m_parentElement = 0; }
 
     virtual void didMutate(MutationType) OVERRIDE;
 
-    Element* m_parentElement;
+    RawPtrWillBeMember<Element> m_parentElement;
 };
 
 } // namespace WebCore
diff --git a/Source/core/css/RuleSet.cpp b/Source/core/css/RuleSet.cpp
index e7e3211..889fc55 100644
--- a/Source/core/css/RuleSet.cpp
+++ b/Source/core/css/RuleSet.cpp
@@ -117,6 +117,8 @@
     for (const CSSSelector* component = &selector; component; component = component->tagHistory()) {
         if (component->pseudoType() == CSSSelector::PseudoCue || (component->m_match == CSSSelector::PseudoElement && component->value() == TextTrackCue::cueShadowPseudoId()))
             return PropertyWhitelistCue;
+        if (component->pseudoType() == CSSSelector::PseudoFirstLetter)
+            return PropertyWhitelistFirstLetter;
     }
     return PropertyWhitelistNone;
 }
diff --git a/Source/core/css/RuleSet.h b/Source/core/css/RuleSet.h
index b73e649..e7538f5 100644
--- a/Source/core/css/RuleSet.h
+++ b/Source/core/css/RuleSet.h
@@ -44,7 +44,8 @@
 
 enum PropertyWhitelistType {
     PropertyWhitelistNone   = 0,
-    PropertyWhitelistCue
+    PropertyWhitelistCue,
+    PropertyWhitelistFirstLetter,
 };
 
 class CSSSelector;
diff --git a/Source/core/css/SelectorChecker.cpp b/Source/core/css/SelectorChecker.cpp
index 8b93541..cc023da 100644
--- a/Source/core/css/SelectorChecker.cpp
+++ b/Source/core/css/SelectorChecker.cpp
@@ -84,7 +84,7 @@
         return context.element->parentOrShadowHostElement();
 
     // If context.scope is a shadow host, we should walk up from a shadow root to its shadow host.
-    if (context.behaviorAtBoundary & SelectorChecker::ScopeIsShadowHost)
+    if ((context.behaviorAtBoundary & SelectorChecker::ScopeIsShadowHost) && context.scope == context.element->shadowHost())
         return context.element->parentOrShadowHostElement();
 
     if ((context.behaviorAtBoundary & SelectorChecker::BoundaryBehaviorMask) != SelectorChecker::StaysWithinTreeScope)
@@ -154,8 +154,8 @@
             if (!context.element->isInShadowTree() || !context.element->isInsertionPoint())
                 return SelectorFailsLocally;
         } else if (context.selector->isShadowPseudoElement()) {
-            if (!context.element->isInShadowTree())
-                return SelectorFailsLocally;
+            if (!context.element->isInShadowTree() || !context.previousElement)
+                return SelectorFailsCompletely;
         } else {
             if ((!context.elementStyle && m_mode == ResolvingStyle) || m_mode == QueryingRules)
                 return SelectorFailsLocally;
@@ -305,6 +305,10 @@
             return match(nextContext, siblingTraversalStrategy, result);
         }
     case CSSSelector::DirectAdjacent:
+        // Shadow roots can't have sibling elements
+        if (selectorMatchesShadowRoot(nextContext.selector))
+            return SelectorFailsCompletely;
+
         if (m_mode == ResolvingStyle) {
             if (ContainerNode* parent = context.element->parentElementOrShadowRoot())
                 parent->setChildrenAffectedByDirectAdjacentRules();
@@ -317,6 +321,10 @@
         return match(nextContext, siblingTraversalStrategy, result);
 
     case CSSSelector::IndirectAdjacent:
+        // Shadow roots can't have sibling elements
+        if (selectorMatchesShadowRoot(nextContext.selector))
+            return SelectorFailsCompletely;
+
         if (m_mode == ResolvingStyle) {
             if (ContainerNode* parent = context.element->parentElementOrShadowRoot())
                 parent->setChildrenAffectedByIndirectAdjacentRules();
diff --git a/Source/core/css/StylePropertySet.cpp b/Source/core/css/StylePropertySet.cpp
index b667894..1237fcb 100644
--- a/Source/core/css/StylePropertySet.cpp
+++ b/Source/core/css/StylePropertySet.cpp
@@ -544,7 +544,7 @@
         ASSERT(!m_cssomWrapper->parentElement());
         return m_cssomWrapper.get();
     }
-    m_cssomWrapper = adoptPtr(new PropertySetCSSStyleDeclaration(*this));
+    m_cssomWrapper = adoptPtrWillBeNoop(new PropertySetCSSStyleDeclaration(*this));
     return m_cssomWrapper.get();
 }
 
@@ -567,6 +567,7 @@
 
 void MutableStylePropertySet::traceAfterDispatch(Visitor* visitor)
 {
+    visitor->trace(m_cssomWrapper);
     visitor->trace(m_propertyVector);
     StylePropertySet::traceAfterDispatch(visitor);
 }
diff --git a/Source/core/css/StylePropertySet.h b/Source/core/css/StylePropertySet.h
index c7bb81a..a09ceab 100644
--- a/Source/core/css/StylePropertySet.h
+++ b/Source/core/css/StylePropertySet.h
@@ -238,7 +238,7 @@
 
     bool removeShorthandProperty(CSSPropertyID);
     CSSProperty* findCSSPropertyWithID(CSSPropertyID);
-    OwnPtr<PropertySetCSSStyleDeclaration> m_cssomWrapper;
+    OwnPtrWillBeMember<PropertySetCSSStyleDeclaration> m_cssomWrapper;
 
     friend class StylePropertySet;
 
diff --git a/Source/core/css/StyleSheet.h b/Source/core/css/StyleSheet.h
index ef790d5..136fa1d 100644
--- a/Source/core/css/StyleSheet.h
+++ b/Source/core/css/StyleSheet.h
@@ -53,7 +53,7 @@
     virtual bool isLoading() const = 0;
     virtual bool isCSSStyleSheet() const { return false; }
 
-    virtual void trace(Visitor*) = 0;
+    virtual void trace(Visitor*) { }
 };
 
 } // namespace
diff --git a/Source/core/css/html.css b/Source/core/css/html.css
index 0535953..887ad7b 100644
--- a/Source/core/css/html.css
+++ b/Source/core/css/html.css
@@ -616,18 +616,6 @@
     pointer-events: auto;
 }
 
-#if defined(ENABLE_INPUT_SPEECH) && ENABLE_INPUT_SPEECH
-input::-webkit-input-speech-button {
-    -webkit-appearance: -webkit-input-speech-button;
-    display: block;
-    vertical-align: top;
-    flex: none;
-    -webkit-user-modify: read-only !important;
-    -webkit-align-self: flex-start;
-    margin: auto 0;
-}
-#endif
-
 keygen, select {
     border-radius: 5px;
 }
diff --git a/Source/core/css/invalidation/StyleInvalidator.cpp b/Source/core/css/invalidation/StyleInvalidator.cpp
index 4b9a24c..530b8bf 100644
--- a/Source/core/css/invalidation/StyleInvalidator.cpp
+++ b/Source/core/css/invalidation/StyleInvalidator.cpp
@@ -28,6 +28,8 @@
 
 void StyleInvalidator::scheduleInvalidation(PassRefPtr<DescendantInvalidationSet> invalidationSet, Element& element)
 {
+    ASSERT(element.inActiveDocument());
+    ASSERT(element.styleChangeType() < SubtreeStyleChange);
     InvalidationList& list = ensurePendingInvalidationList(element);
     // If we're already going to invalidate the whole subtree we don't need to store any new sets.
     if (!list.isEmpty() && list.last()->wholeSubtreeInvalid())
@@ -51,8 +53,6 @@
 {
     if (node.isElementNode() && node.needsStyleInvalidation())
         m_pendingInvalidationMap.remove(toElement(&node));
-    node.clearChildNeedsStyleInvalidation();
-    node.clearNeedsStyleInvalidation();
 }
 
 void StyleInvalidator::clearPendingInvalidations()
diff --git a/Source/core/css/parser/BisonCSSParser-in.cpp b/Source/core/css/parser/BisonCSSParser-in.cpp
index c089a7b..c5d3995 100644
--- a/Source/core/css/parser/BisonCSSParser-in.cpp
+++ b/Source/core/css/parser/BisonCSSParser-in.cpp
@@ -1075,10 +1075,10 @@
     if (string.isEmpty())
         return nullptr;
     RefPtrWillBeRawPtr<MutableStylePropertySet> style = MutableStylePropertySet::create();
-    if (!parseValue(style.get(), CSSPropertyAnimationTimingFunction, string, false, HTMLStandardMode, 0))
+    if (!parseValue(style.get(), CSSPropertyTransitionTimingFunction, string, false, HTMLStandardMode, 0))
         return nullptr;
 
-    return style->getPropertyCSSValue(CSSPropertyAnimationTimingFunction);
+    return style->getPropertyCSSValue(CSSPropertyTransitionTimingFunction);
 }
 
 bool BisonCSSParser::parseValue(MutableStylePropertySet* declaration, CSSPropertyID propertyID, const String& string, bool important, const Document& document)
diff --git a/Source/core/css/parser/CSSPropertyParser.cpp b/Source/core/css/parser/CSSPropertyParser.cpp
index 253cc9d..ad74ad4 100644
--- a/Source/core/css/parser/CSSPropertyParser.cpp
+++ b/Source/core/css/parser/CSSPropertyParser.cpp
@@ -423,7 +423,7 @@
     const StylePropertyShorthand& shorthand = shorthandForProperty(propId);
     unsigned shorthandLength = shorthand.length();
     if (!shorthandLength) {
-        addProperty(propId, prpValue, important);
+        addPropertyWithPrefixingVariant(propId, prpValue, important);
         return;
     }
 
@@ -431,7 +431,7 @@
     ShorthandScope scope(this, propId);
     const CSSPropertyID* longhands = shorthand.properties();
     for (unsigned i = 0; i < shorthandLength; ++i)
-        addProperty(longhands[i], value, important);
+        addPropertyWithPrefixingVariant(longhands[i], value, important);
 }
 
 bool CSSPropertyParser::parseValue(CSSPropertyID propId, bool important)
diff --git a/Source/core/css/parser/MediaQueryParser.cpp b/Source/core/css/parser/MediaQueryParser.cpp
index 24df565..ec3bfe0 100644
--- a/Source/core/css/parser/MediaQueryParser.cpp
+++ b/Source/core/css/parser/MediaQueryParser.cpp
@@ -214,7 +214,7 @@
     m_mediaType = MediaTypeNames::all;
     m_mediaTypeSet = false;
     m_mediaFeature = String();
-    m_valueList.clear();
+    m_valueList.destroyAndClear();
     m_expressions = adoptPtrWillBeNoop(new ExpressionHeapVector);
 }
 
@@ -230,7 +230,7 @@
     OwnPtrWillBeRawPtr<MediaQueryExp> expression = MediaQueryExp::createIfValid(m_mediaFeature, &m_valueList);
     bool isValid = !!expression;
     m_expressions->append(expression.release());
-    m_valueList.clear();
+    m_valueList.destroyAndClear();
     return isValid;
 }
 
diff --git a/Source/core/css/resolver/AnimatedStyleBuilder.cpp b/Source/core/css/resolver/AnimatedStyleBuilder.cpp
index e8f3950..9b16962 100644
--- a/Source/core/css/resolver/AnimatedStyleBuilder.cpp
+++ b/Source/core/css/resolver/AnimatedStyleBuilder.cpp
@@ -64,10 +64,10 @@
 
 namespace {
 
-Length animatableValueToLength(const AnimatableValue* value, const StyleResolverState& state, NumberRange range = AllValues)
+Length animatableValueToLength(const AnimatableValue* value, const StyleResolverState& state, ValueRange range = ValueRangeAll)
 {
     if (value->isLength())
-        return toAnimatableLength(value)->toLength(state.cssToLengthConversionData(), range);
+        return toAnimatableLength(value)->length(state.style()->effectiveZoom(), range);
     RefPtrWillBeRawPtr<CSSValue> cssValue = toAnimatableUnknown(value)->toCSSValue();
     CSSPrimitiveValue* cssPrimitiveValue = toCSSPrimitiveValue(cssValue.get());
     return cssPrimitiveValue->convertToLength<AnyConversion>(state.cssToLengthConversionData());
@@ -76,7 +76,7 @@
 BorderImageLength animatableValueToBorderImageLength(const AnimatableValue* value, const StyleResolverState& state)
 {
     if (value->isLength())
-        return BorderImageLength(toAnimatableLength(value)->toLength(state.cssToLengthConversionData(), NonNegativeValues));
+        return BorderImageLength(toAnimatableLength(value)->length(state.style()->effectiveZoom(), ValueRangeNonNegative));
     if (value->isDouble())
         return BorderImageLength(clampTo<double>(toAnimatableDouble(value)->toDouble(), 0));
     RefPtrWillBeRawPtr<CSSValue> cssValue = toAnimatableUnknown(value)->toCSSValue();
@@ -90,7 +90,7 @@
     return clampTo<T>(round(toAnimatableDouble(value)->toDouble()), min, max);
 }
 
-LengthBox animatableValueToLengthBox(const AnimatableValue* value, const StyleResolverState& state, NumberRange range = AllValues)
+LengthBox animatableValueToLengthBox(const AnimatableValue* value, const StyleResolverState& state, ValueRange range = ValueRangeAll)
 {
     const AnimatableLengthBox* animatableLengthBox = toAnimatableLengthBox(value);
     return LengthBox(
@@ -110,7 +110,7 @@
         animatableValueToBorderImageLength(animatableLengthBox->left(), state));
 }
 
-LengthPoint animatableValueToLengthPoint(const AnimatableValue* value, const StyleResolverState& state, NumberRange range = AllValues)
+LengthPoint animatableValueToLengthPoint(const AnimatableValue* value, const StyleResolverState& state, ValueRange range = ValueRangeAll)
 {
     const AnimatableLengthPoint* animatableLengthPoint = toAnimatableLengthPoint(value);
     return LengthPoint(
@@ -118,7 +118,7 @@
         animatableValueToLength(animatableLengthPoint->y(), state, range));
 }
 
-LengthSize animatableValueToLengthSize(const AnimatableValue* value, const StyleResolverState& state, NumberRange range)
+LengthSize animatableValueToLengthSize(const AnimatableValue* value, const StyleResolverState& state, ValueRange range)
 {
     const AnimatableLengthSize* animatableLengthSize = toAnimatableLengthSize(value);
     return LengthSize(
@@ -130,7 +130,7 @@
 void setFillSize(FillLayer* fillLayer, const AnimatableValue* value, const StyleResolverState& state)
 {
     if (value->isLengthSize())
-        fillLayer->setSize(FillSize(SizeLength, animatableValueToLengthSize(value, state, NonNegativeValues)));
+        fillLayer->setSize(FillSize(SizeLength, animatableValueToLengthSize(value, state, ValueRangeNonNegative)));
     else
         state.styleMap().mapFillSize(property, fillLayer, toAnimatableUnknown(value)->toCSSValue().get());
 }
@@ -283,10 +283,10 @@
         style->setVisitedLinkBorderBottomColor(toAnimatableColor(value)->visitedLinkColor());
         return;
     case CSSPropertyBorderBottomLeftRadius:
-        style->setBorderBottomLeftRadius(animatableValueToLengthSize(value, state, NonNegativeValues));
+        style->setBorderBottomLeftRadius(animatableValueToLengthSize(value, state, ValueRangeNonNegative));
         return;
     case CSSPropertyBorderBottomRightRadius:
-        style->setBorderBottomRightRadius(animatableValueToLengthSize(value, state, NonNegativeValues));
+        style->setBorderBottomRightRadius(animatableValueToLengthSize(value, state, ValueRangeNonNegative));
         return;
     case CSSPropertyBorderBottomWidth:
         style->setBorderBottomWidth(animatableValueRoundClampTo<unsigned>(value));
@@ -295,7 +295,7 @@
         style->setBorderImageOutset(animatableValueToBorderImageLengthBox(value, state));
         return;
     case CSSPropertyBorderImageSlice:
-        style->setBorderImageSlices(animatableValueToLengthBox(value, state, NonNegativeValues));
+        style->setBorderImageSlices(animatableValueToLengthBox(value, state, ValueRangeNonNegative));
         return;
     case CSSPropertyBorderImageSource:
         style->setBorderImageSource(state.styleImage(property, toAnimatableImage(value)->toCSSValue()));
@@ -322,10 +322,10 @@
         style->setVisitedLinkBorderTopColor(toAnimatableColor(value)->visitedLinkColor());
         return;
     case CSSPropertyBorderTopLeftRadius:
-        style->setBorderTopLeftRadius(animatableValueToLengthSize(value, state, NonNegativeValues));
+        style->setBorderTopLeftRadius(animatableValueToLengthSize(value, state, ValueRangeNonNegative));
         return;
     case CSSPropertyBorderTopRightRadius:
-        style->setBorderTopRightRadius(animatableValueToLengthSize(value, state, NonNegativeValues));
+        style->setBorderTopRightRadius(animatableValueToLengthSize(value, state, ValueRangeNonNegative));
         return;
     case CSSPropertyBorderTopWidth:
         style->setBorderTopWidth(animatableValueRoundClampTo<unsigned>(value));
@@ -361,7 +361,7 @@
         style->setFlexShrink(clampTo<float>(toAnimatableDouble(value)->toDouble(), 0));
         return;
     case CSSPropertyFlexBasis:
-        style->setFlexBasis(animatableValueToLength(value, state, NonNegativeValues));
+        style->setFlexBasis(animatableValueToLength(value, state, ValueRangeNonNegative));
         return;
     case CSSPropertyFloodColor:
         style->setFloodColor(toAnimatableColor(value)->color());
@@ -376,7 +376,7 @@
         style->setFontWeight(animatableValueToFontWeight(value));
         return;
     case CSSPropertyHeight:
-        style->setHeight(animatableValueToLength(value, state, NonNegativeValues));
+        style->setHeight(animatableValueToLength(value, state, ValueRangeNonNegative));
         return;
     case CSSPropertyLeft:
         style->setLeft(animatableValueToLength(value, state));
@@ -386,7 +386,7 @@
         return;
     case CSSPropertyLineHeight:
         if (value->isLength())
-            style->setLineHeight(animatableValueToLength(value, state, NonNegativeValues));
+            style->setLineHeight(animatableValueToLength(value, state, ValueRangeNonNegative));
         else
             style->setLineHeight(Length(clampTo<float>(toAnimatableDouble(value)->toDouble(), 0), Percent));
         return;
@@ -409,16 +409,16 @@
         style->setMarginTop(animatableValueToLength(value, state));
         return;
     case CSSPropertyMaxHeight:
-        style->setMaxHeight(animatableValueToLength(value, state, NonNegativeValues));
+        style->setMaxHeight(animatableValueToLength(value, state, ValueRangeNonNegative));
         return;
     case CSSPropertyMaxWidth:
-        style->setMaxWidth(animatableValueToLength(value, state, NonNegativeValues));
+        style->setMaxWidth(animatableValueToLength(value, state, ValueRangeNonNegative));
         return;
     case CSSPropertyMinHeight:
-        style->setMinHeight(animatableValueToLength(value, state, NonNegativeValues));
+        style->setMinHeight(animatableValueToLength(value, state, ValueRangeNonNegative));
         return;
     case CSSPropertyMinWidth:
-        style->setMinWidth(animatableValueToLength(value, state, NonNegativeValues));
+        style->setMinWidth(animatableValueToLength(value, state, ValueRangeNonNegative));
         return;
     case CSSPropertyObjectPosition:
         style->setObjectPosition(animatableValueToLengthPoint(value, state));
@@ -441,16 +441,16 @@
         style->setOutlineWidth(animatableValueRoundClampTo<unsigned short>(value));
         return;
     case CSSPropertyPaddingBottom:
-        style->setPaddingBottom(animatableValueToLength(value, state, NonNegativeValues));
+        style->setPaddingBottom(animatableValueToLength(value, state, ValueRangeNonNegative));
         return;
     case CSSPropertyPaddingLeft:
-        style->setPaddingLeft(animatableValueToLength(value, state, NonNegativeValues));
+        style->setPaddingLeft(animatableValueToLength(value, state, ValueRangeNonNegative));
         return;
     case CSSPropertyPaddingRight:
-        style->setPaddingRight(animatableValueToLength(value, state, NonNegativeValues));
+        style->setPaddingRight(animatableValueToLength(value, state, ValueRangeNonNegative));
         return;
     case CSSPropertyPaddingTop:
-        style->setPaddingTop(animatableValueToLength(value, state, NonNegativeValues));
+        style->setPaddingTop(animatableValueToLength(value, state, ValueRangeNonNegative));
         return;
     case CSSPropertyRight:
         style->setRight(animatableValueToLength(value, state));
@@ -530,7 +530,7 @@
         style->setMaskBoxImageOutset(animatableValueToBorderImageLengthBox(value, state));
         return;
     case CSSPropertyWebkitMaskBoxImageSlice:
-        style->setMaskBoxImageSlices(animatableValueToLengthBox(toAnimatableLengthBoxAndBool(value)->box(), state, NonNegativeValues));
+        style->setMaskBoxImageSlices(animatableValueToLengthBox(toAnimatableLengthBoxAndBool(value)->box(), state, ValueRangeNonNegative));
         style->setMaskBoxImageSlicesFill(toAnimatableLengthBoxAndBool(value)->flag());
         return;
     case CSSPropertyWebkitMaskBoxImageSource:
@@ -573,7 +573,7 @@
         style->setShapeOutside(toAnimatableShapeValue(value)->shapeValue());
         return;
     case CSSPropertyShapeMargin:
-        style->setShapeMargin(animatableValueToLength(value, state, NonNegativeValues));
+        style->setShapeMargin(animatableValueToLength(value, state, ValueRangeNonNegative));
         return;
     case CSSPropertyShapeImageThreshold:
         style->setShapeImageThreshold(clampTo<float>(toAnimatableDouble(value)->toDouble(), 0, 1));
@@ -612,7 +612,7 @@
         style->setWidows(animatableValueRoundClampTo<unsigned short>(value, 1));
         return;
     case CSSPropertyWidth:
-        style->setWidth(animatableValueToLength(value, state, NonNegativeValues));
+        style->setWidth(animatableValueToLength(value, state, ValueRangeNonNegative));
         return;
     case CSSPropertyWordSpacing:
         style->setWordSpacing(clampTo<float>(toAnimatableDouble(value)->toDouble()));
diff --git a/Source/core/css/resolver/ElementResolveContext.h b/Source/core/css/resolver/ElementResolveContext.h
index 0b3996e..f6c77bd 100644
--- a/Source/core/css/resolver/ElementResolveContext.h
+++ b/Source/core/css/resolver/ElementResolveContext.h
@@ -37,8 +37,8 @@
     STACK_ALLOCATED();
 public:
     ElementResolveContext()
-        : m_element(0)
-        , m_parentNode(0)
+        : m_element(nullptr)
+        , m_parentNode(nullptr)
         , m_rootElementStyle(0)
         , m_elementLinkState(NotInsideLink)
         , m_distributedToInsertionPoint(false)
@@ -54,8 +54,8 @@
     bool distributedToInsertionPoint() const { return m_distributedToInsertionPoint; }
 
 private:
-    Element* m_element;
-    ContainerNode* m_parentNode;
+    RawPtrWillBeMember<Element> m_element;
+    RawPtrWillBeMember<ContainerNode> m_parentNode;
     RenderStyle* m_rootElementStyle;
     EInsideLink m_elementLinkState;
     bool m_distributedToInsertionPoint;
diff --git a/Source/core/css/resolver/MatchRequest.h b/Source/core/css/resolver/MatchRequest.h
index 242a204..04c587e 100644
--- a/Source/core/css/resolver/MatchRequest.h
+++ b/Source/core/css/resolver/MatchRequest.h
@@ -48,7 +48,7 @@
 
     RawPtrWillBeMember<const RuleSet> ruleSet;
     const bool includeEmptyRules;
-    const ContainerNode* scope;
+    RawPtrWillBeMember<const ContainerNode> scope;
     RawPtrWillBeMember<const CSSStyleSheet> styleSheet;
     const bool elementApplyAuthorStyles;
     const unsigned styleSheetIndex;
diff --git a/Source/core/css/resolver/StyleAdjuster.cpp b/Source/core/css/resolver/StyleAdjuster.cpp
index c364b0d..8f41339 100644
--- a/Source/core/css/resolver/StyleAdjuster.cpp
+++ b/Source/core/css/resolver/StyleAdjuster.cpp
@@ -162,7 +162,7 @@
     return isDisplayFlexibleBox(parentStyle->display()) || isDisplayGridBox(parentStyle->display());
 }
 
-static bool hasWillChangeThatCreatesStackingContext(const RenderStyle* style, Element* e)
+static bool hasWillChangeThatCreatesStackingContext(const RenderStyle* style)
 {
     for (size_t i = 0; i < style->willChangeProperties().size(); ++i) {
         switch (style->willChangeProperties()[i]) {
@@ -234,7 +234,7 @@
         || style->position() == StickyPosition
         || style->position() == FixedPosition
         || isInTopLayer(e, style)
-        || hasWillChangeThatCreatesStackingContext(style, e)))
+        || hasWillChangeThatCreatesStackingContext(style)))
         style->setZIndex(0);
 
     // will-change:transform should result in the same rendering behavior as having a transform,
@@ -250,7 +250,7 @@
         style->addToTextDecorationsInEffect(style->textDecoration());
 
     if (style->overflowX() != OVISIBLE || style->overflowY() != OVISIBLE)
-        adjustOverflow(style, e);
+        adjustOverflow(style);
 
     // Cull out any useless layers and also repeat patterns into additional layers.
     style->adjustBackgroundLayers();
@@ -378,7 +378,7 @@
     }
 }
 
-void StyleAdjuster::adjustOverflow(RenderStyle* style, Element* element)
+void StyleAdjuster::adjustOverflow(RenderStyle* style)
 {
     ASSERT(style->overflowX() != OVISIBLE || style->overflowY() != OVISIBLE);
 
diff --git a/Source/core/css/resolver/StyleAdjuster.h b/Source/core/css/resolver/StyleAdjuster.h
index 591f245..218f0fa 100644
--- a/Source/core/css/resolver/StyleAdjuster.h
+++ b/Source/core/css/resolver/StyleAdjuster.h
@@ -46,7 +46,7 @@
 private:
     void adjustStyleForDisplay(RenderStyle* styleToAdjust, RenderStyle* parentStyle);
     void adjustStyleForTagName(RenderStyle* styleToAdjust, RenderStyle* parentStyle, Element&);
-    void adjustOverflow(RenderStyle* styleToAdjust, Element*);
+    void adjustOverflow(RenderStyle* styleToAdjust);
 
     const CachedUAStyle& m_cachedUAStyle;
     bool m_useQuirksModeStyles;
diff --git a/Source/core/css/resolver/StyleBuilderConverter.cpp b/Source/core/css/resolver/StyleBuilderConverter.cpp
index d022f6b..2d41d69 100644
--- a/Source/core/css/resolver/StyleBuilderConverter.cpp
+++ b/Source/core/css/resolver/StyleBuilderConverter.cpp
@@ -27,6 +27,8 @@
 #include "config.h"
 #include "core/css/resolver/StyleBuilderConverter.h"
 
+#include "core/css/CSSFunctionValue.h"
+#include "core/css/CSSGridLineNamesValue.h"
 #include "core/css/CSSPrimitiveValueMappings.h"
 #include "core/css/CSSShadowValue.h"
 #include "core/css/Pair.h"
@@ -34,6 +36,25 @@
 
 namespace WebCore {
 
+namespace {
+
+static GridLength convertGridTrackBreadth(const StyleResolverState& state, CSSPrimitiveValue* primitiveValue)
+{
+    if (primitiveValue->getValueID() == CSSValueMinContent)
+        return Length(MinContent);
+
+    if (primitiveValue->getValueID() == CSSValueMaxContent)
+        return Length(MaxContent);
+
+    // Fractional unit.
+    if (primitiveValue->isFlex())
+        return GridLength(primitiveValue->getDoubleValue());
+
+    return primitiveValue->convertToLength<FixedConversion | PercentConversion | AutoConversion>(state.cssToLengthConversionData());
+}
+
+} // namespace
+
 AtomicString StyleBuilderConverter::convertFragmentIdentifier(StyleResolverState& state, CSSValue* value)
 {
     CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
@@ -42,6 +63,132 @@
     return nullAtom;
 }
 
+EGlyphOrientation StyleBuilderConverter::convertGlyphOrientation(StyleResolverState&, CSSValue* value)
+{
+    if (!value->isPrimitiveValue())
+        return GO_0DEG;
+
+    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
+    if (primitiveValue->primitiveType() != CSSPrimitiveValue::CSS_DEG)
+        return GO_0DEG;
+
+    float angle = fabsf(fmodf(primitiveValue->getFloatValue(), 360.0f));
+
+    if (angle <= 45.0f || angle > 315.0f)
+        return GO_0DEG;
+    if (angle > 45.0f && angle <= 135.0f)
+        return GO_90DEG;
+    if (angle > 135.0f && angle <= 225.0f)
+        return GO_180DEG;
+    return GO_270DEG;
+}
+
+
+GridPosition StyleBuilderConverter::convertGridPosition(StyleResolverState&, CSSValue* value)
+{
+    // We accept the specification's grammar:
+    // 'auto' | [ <integer> || <string> ] | [ span && [ <integer> || string ] ] | <ident>
+
+    GridPosition position;
+
+    if (value->isPrimitiveValue()) {
+        CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
+        // We translate <ident> to <string> during parsing as it
+        // makes handling it more simple.
+        if (primitiveValue->isString()) {
+            position.setNamedGridArea(primitiveValue->getStringValue());
+            return position;
+        }
+
+        ASSERT(primitiveValue->getValueID() == CSSValueAuto);
+        return position;
+    }
+
+    CSSValueList* values = toCSSValueList(value);
+    ASSERT(values->length());
+
+    bool isSpanPosition = false;
+    // The specification makes the <integer> optional, in which case it default to '1'.
+    int gridLineNumber = 1;
+    String gridLineName;
+
+    CSSValueListIterator it = values;
+    CSSPrimitiveValue* currentValue = toCSSPrimitiveValue(it.value());
+    if (currentValue->getValueID() == CSSValueSpan) {
+        isSpanPosition = true;
+        it.advance();
+        currentValue = it.hasMore() ? toCSSPrimitiveValue(it.value()) : 0;
+    }
+
+    if (currentValue && currentValue->isNumber()) {
+        gridLineNumber = currentValue->getIntValue();
+        it.advance();
+        currentValue = it.hasMore() ? toCSSPrimitiveValue(it.value()) : 0;
+    }
+
+    if (currentValue && currentValue->isString()) {
+        gridLineName = currentValue->getStringValue();
+        it.advance();
+    }
+
+    ASSERT(!it.hasMore());
+    if (isSpanPosition)
+        position.setSpanPosition(gridLineNumber, gridLineName);
+    else
+        position.setExplicitPosition(gridLineNumber, gridLineName);
+
+    return position;
+}
+
+GridTrackSize StyleBuilderConverter::convertGridTrackSize(StyleResolverState& state, CSSValue* value)
+{
+    if (value->isPrimitiveValue())
+        return GridTrackSize(convertGridTrackBreadth(state, toCSSPrimitiveValue(value)));
+
+    CSSFunctionValue* minmaxFunction = toCSSFunctionValue(value);
+    CSSValueList* arguments = minmaxFunction->arguments();
+    ASSERT_WITH_SECURITY_IMPLICATION(arguments->length() == 2);
+    GridLength minTrackBreadth(convertGridTrackBreadth(state, toCSSPrimitiveValue(arguments->itemWithoutBoundsCheck(0))));
+    GridLength maxTrackBreadth(convertGridTrackBreadth(state, toCSSPrimitiveValue(arguments->itemWithoutBoundsCheck(1))));
+    return GridTrackSize(minTrackBreadth, maxTrackBreadth);
+}
+
+bool StyleBuilderConverter::convertGridTrackList(CSSValue* value, Vector<GridTrackSize>& trackSizes, NamedGridLinesMap& namedGridLines, OrderedNamedGridLines& orderedNamedGridLines, StyleResolverState& state)
+{
+    // Handle 'none'.
+    if (value->isPrimitiveValue()) {
+        CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
+        return primitiveValue->getValueID() == CSSValueNone;
+    }
+
+    if (!value->isValueList())
+        return false;
+
+    size_t currentNamedGridLine = 0;
+    for (CSSValueListIterator i = value; i.hasMore(); i.advance()) {
+        CSSValue* currValue = i.value();
+        if (currValue->isGridLineNamesValue()) {
+            CSSGridLineNamesValue* lineNamesValue = toCSSGridLineNamesValue(currValue);
+            for (CSSValueListIterator j = lineNamesValue; j.hasMore(); j.advance()) {
+                String namedGridLine = toCSSPrimitiveValue(j.value())->getStringValue();
+                NamedGridLinesMap::AddResult result = namedGridLines.add(namedGridLine, Vector<size_t>());
+                result.storedValue->value.append(currentNamedGridLine);
+                OrderedNamedGridLines::AddResult orderedInsertionResult = orderedNamedGridLines.add(currentNamedGridLine, Vector<String>());
+                orderedInsertionResult.storedValue->value.append(namedGridLine);
+            }
+            continue;
+        }
+
+        ++currentNamedGridLine;
+        trackSizes.append(convertGridTrackSize(state, currValue));
+    }
+
+    // The parser should have rejected any <track-list> without any <track-size> as
+    // this is not conformant to the syntax.
+    ASSERT(!trackSizes.isEmpty());
+    return true;
+}
+
 Length StyleBuilderConverter::convertLength(StyleResolverState& state, CSSValue* value)
 {
     CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
@@ -110,6 +257,38 @@
     return primitiveValue->getFloatValue() / 100.0f;
 }
 
+EPaintOrder StyleBuilderConverter::convertPaintOrder(StyleResolverState&, CSSValue* cssPaintOrder)
+{
+    if (cssPaintOrder->isValueList()) {
+        int paintOrder = 0;
+        CSSValueListInspector iter(cssPaintOrder);
+        for (size_t i = 0; i < iter.length(); i++) {
+            CSSPrimitiveValue* value = toCSSPrimitiveValue(iter.item(i));
+
+            EPaintOrderType paintOrderType = PT_NONE;
+            switch (value->getValueID()) {
+            case CSSValueFill:
+                paintOrderType = PT_FILL;
+                break;
+            case CSSValueStroke:
+                paintOrderType = PT_STROKE;
+                break;
+            case CSSValueMarkers:
+                paintOrderType = PT_MARKERS;
+                break;
+            default:
+                ASSERT_NOT_REACHED();
+                break;
+            }
+
+            paintOrder |= (paintOrderType << kPaintOrderBitwidth*i);
+        }
+        return (EPaintOrder)paintOrder;
+    }
+
+    return PO_NORMAL;
+}
+
 LengthSize StyleBuilderConverter::convertRadius(StyleResolverState& state, CSSValue* value)
 {
     CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
@@ -161,6 +340,37 @@
     return primitiveValue->computeLength<float>(state.cssToLengthConversionData());
 }
 
+PassRefPtr<SVGLengthList> StyleBuilderConverter::convertStrokeDasharray(StyleResolverState&, CSSValue* value)
+{
+    if (!value->isValueList()) {
+        return SVGRenderStyle::initialStrokeDashArray();
+    }
+
+    CSSValueList* dashes = toCSSValueList(value);
+
+    RefPtr<SVGLengthList> array = SVGLengthList::create();
+    size_t length = dashes->length();
+    for (size_t i = 0; i < length; ++i) {
+        CSSValue* currValue = dashes->itemWithoutBoundsCheck(i);
+        if (!currValue->isPrimitiveValue())
+            continue;
+
+        CSSPrimitiveValue* dash = toCSSPrimitiveValue(dashes->itemWithoutBoundsCheck(i));
+        array->append(SVGLength::fromCSSPrimitiveValue(dash));
+    }
+
+    return array.release();
+}
+
+Color StyleBuilderConverter::convertSVGColor(StyleResolverState& state, CSSValue* value)
+{
+    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
+    if (primitiveValue->isRGBColor())
+        return primitiveValue->getRGBA32Value();
+    ASSERT(primitiveValue->getValueID() == CSSValueCurrentcolor);
+    return state.style()->color();
+}
+
 PassRefPtr<SVGLength> StyleBuilderConverter::convertSVGLength(StyleResolverState&, CSSValue* value)
 {
     return SVGLength::fromCSSPrimitiveValue(toCSSPrimitiveValue(value));
diff --git a/Source/core/css/resolver/StyleBuilderConverter.h b/Source/core/css/resolver/StyleBuilderConverter.h
index 1d97e6b..d224341 100644
--- a/Source/core/css/resolver/StyleBuilderConverter.h
+++ b/Source/core/css/resolver/StyleBuilderConverter.h
@@ -42,6 +42,9 @@
 public:
     static AtomicString convertFragmentIdentifier(StyleResolverState&, CSSValue*);
     template <typename T> static T convertComputedLength(StyleResolverState&, CSSValue*);
+    static EGlyphOrientation convertGlyphOrientation(StyleResolverState&, CSSValue*);
+    static GridPosition convertGridPosition(StyleResolverState&, CSSValue*);
+    static GridTrackSize convertGridTrackSize(StyleResolverState&, CSSValue*);
     template <typename T> static T convertLineWidth(StyleResolverState&, CSSValue*);
     static Length convertLength(StyleResolverState&, CSSValue*);
     static Length convertLengthOrAuto(StyleResolverState&, CSSValue*);
@@ -50,10 +53,15 @@
     static LengthPoint convertLengthPoint(StyleResolverState&, CSSValue*);
     static float convertNumberOrPercentage(StyleResolverState&, CSSValue*);
     static LengthSize convertRadius(StyleResolverState&, CSSValue*);
+    static EPaintOrder convertPaintOrder(StyleResolverState&, CSSValue*);
     static PassRefPtr<ShadowList> convertShadow(StyleResolverState&, CSSValue*);
     static float convertSpacing(StyleResolverState&, CSSValue*);
     template <CSSValueID IdForNone> static AtomicString convertString(StyleResolverState&, CSSValue*);
+    static PassRefPtr<SVGLengthList> convertStrokeDasharray(StyleResolverState&, CSSValue*);
+    static Color convertSVGColor(StyleResolverState&, CSSValue*);
     static PassRefPtr<SVGLength> convertSVGLength(StyleResolverState&, CSSValue*);
+
+    static bool convertGridTrackList(CSSValue*, Vector<GridTrackSize>&, NamedGridLinesMap&, OrderedNamedGridLines&, StyleResolverState&);
 };
 
 template <typename T>
diff --git a/Source/core/css/resolver/StyleBuilderCustom.cpp b/Source/core/css/resolver/StyleBuilderCustom.cpp
index d859c5e..ef60df8 100644
--- a/Source/core/css/resolver/StyleBuilderCustom.cpp
+++ b/Source/core/css/resolver/StyleBuilderCustom.cpp
@@ -46,9 +46,7 @@
 #include "core/css/CSSAspectRatioValue.h"
 #include "core/css/CSSCursorImageValue.h"
 #include "core/css/CSSFontValue.h"
-#include "core/css/CSSFunctionValue.h"
 #include "core/css/CSSGradientValue.h"
-#include "core/css/CSSGridLineNamesValue.h"
 #include "core/css/CSSGridTemplateAreasValue.h"
 #include "core/css/CSSHelper.h"
 #include "core/css/CSSImageSetValue.h"
@@ -295,6 +293,42 @@
     }
 }
 
+void StyleBuilderFunctions::applyValueCSSPropertyGlyphOrientationVertical(StyleResolverState& state, CSSValue* value)
+{
+    if (value->isPrimitiveValue() && toCSSPrimitiveValue(value)->getValueID() == CSSValueAuto)
+        state.style()->accessSVGStyle()->setGlyphOrientationVertical(GO_AUTO);
+    else
+        state.style()->accessSVGStyle()->setGlyphOrientationVertical(StyleBuilderConverter::convertGlyphOrientation(state, value));
+}
+
+void StyleBuilderFunctions::applyInitialCSSPropertyGridTemplateAreas(StyleResolverState& state)
+{
+    state.style()->setNamedGridArea(RenderStyle::initialNamedGridArea());
+    state.style()->setNamedGridAreaRowCount(RenderStyle::initialNamedGridAreaCount());
+    state.style()->setNamedGridAreaColumnCount(RenderStyle::initialNamedGridAreaCount());
+}
+
+void StyleBuilderFunctions::applyInheritCSSPropertyGridTemplateAreas(StyleResolverState& state)
+{
+    state.style()->setNamedGridArea(state.parentStyle()->namedGridArea());
+    state.style()->setNamedGridAreaRowCount(state.parentStyle()->namedGridAreaRowCount());
+    state.style()->setNamedGridAreaColumnCount(state.parentStyle()->namedGridAreaColumnCount());
+}
+
+void StyleBuilderFunctions::applyValueCSSPropertyGridTemplateAreas(StyleResolverState& state, CSSValue* value)
+{
+    if (value->isPrimitiveValue()) {
+        // FIXME: Shouldn't we clear the grid-area values
+        ASSERT(toCSSPrimitiveValue(value)->getValueID() == CSSValueNone);
+        return;
+    }
+
+    CSSGridTemplateAreasValue* gridTemplateAreasValue = toCSSGridTemplateAreasValue(value);
+    state.style()->setNamedGridArea(gridTemplateAreasValue->gridAreaMap());
+    state.style()->setNamedGridAreaRowCount(gridTemplateAreasValue->rowCount());
+    state.style()->setNamedGridAreaColumnCount(gridTemplateAreasValue->columnCount());
+}
+
 void StyleBuilderFunctions::applyValueCSSPropertyLineHeight(StyleResolverState& state, CSSValue* value)
 {
     if (!value->isPrimitiveValue())
@@ -587,6 +621,13 @@
     state.style()->setTextIndentType(textIndentTypeValue);
 }
 
+void StyleBuilderFunctions::applyValueCSSPropertyTransform(StyleResolverState& state, CSSValue* value)
+{
+    TransformOperations operations;
+    TransformBuilder::createTransformOperations(value, state.cssToLengthConversionData(), operations);
+    state.style()->setTransform(operations);
+}
+
 void StyleBuilderFunctions::applyInitialCSSPropertyTransformOrigin(StyleResolverState& state)
 {
     applyInitialCSSPropertyWebkitTransformOriginX(state);
@@ -820,6 +861,13 @@
     }
 }
 
+void StyleBuilderFunctions::applyValueCSSPropertyWebkitFilter(StyleResolverState& state, CSSValue* value)
+{
+    FilterOperations operations;
+    if (FilterOperationResolver::createFilterOperations(value, state.cssToLengthConversionData(), operations, state))
+        state.style()->setFilter(operations);
+}
+
 void StyleBuilderFunctions::applyInitialCSSPropertyFontVariantLigatures(StyleResolverState& state)
 {
     state.fontBuilder().setFontVariantLigaturesInitial();
@@ -907,6 +955,14 @@
     ASSERT_NOT_REACHED();
 }
 
+void StyleBuilderFunctions::applyValueCSSPropertyWebkitTapHighlightColor(StyleResolverState& state, CSSValue* value)
+{
+    if (!value->isPrimitiveValue())
+        return;
+    Color color = state.document().textLinkColors().colorFromPrimitiveValue(toCSSPrimitiveValue(value), state.style()->color());
+    state.style()->setTapHighlightColor(color);
+}
+
 void StyleBuilderFunctions::applyInitialCSSPropertyWebkitTextEmphasisStyle(StyleResolverState& state)
 {
     state.style()->setTextEmphasisFill(RenderStyle::initialTextEmphasisFill());
@@ -1049,150 +1105,6 @@
     return; \
 }
 
-static GridLength createGridTrackBreadth(CSSPrimitiveValue* primitiveValue, const StyleResolverState& state)
-{
-    if (primitiveValue->getValueID() == CSSValueMinContent)
-        return Length(MinContent);
-
-    if (primitiveValue->getValueID() == CSSValueMaxContent)
-        return Length(MaxContent);
-
-    // Fractional unit.
-    if (primitiveValue->isFlex())
-        return GridLength(primitiveValue->getDoubleValue());
-
-    return primitiveValue->convertToLength<FixedConversion | PercentConversion | AutoConversion>(state.cssToLengthConversionData());
-}
-
-static GridTrackSize createGridTrackSize(CSSValue* value, const StyleResolverState& state)
-{
-    if (value->isPrimitiveValue())
-        return GridTrackSize(createGridTrackBreadth(toCSSPrimitiveValue(value), state));
-
-    CSSFunctionValue* minmaxFunction = toCSSFunctionValue(value);
-    CSSValueList* arguments = minmaxFunction->arguments();
-    ASSERT_WITH_SECURITY_IMPLICATION(arguments->length() == 2);
-    GridLength minTrackBreadth(createGridTrackBreadth(toCSSPrimitiveValue(arguments->itemWithoutBoundsCheck(0)), state));
-    GridLength maxTrackBreadth(createGridTrackBreadth(toCSSPrimitiveValue(arguments->itemWithoutBoundsCheck(1)), state));
-    return GridTrackSize(minTrackBreadth, maxTrackBreadth);
-}
-
-static bool createGridTrackList(CSSValue* value, Vector<GridTrackSize>& trackSizes, NamedGridLinesMap& namedGridLines, OrderedNamedGridLines& orderedNamedGridLines, const StyleResolverState& state)
-{
-    // Handle 'none'.
-    if (value->isPrimitiveValue()) {
-        CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
-        return primitiveValue->getValueID() == CSSValueNone;
-    }
-
-    if (!value->isValueList())
-        return false;
-
-    size_t currentNamedGridLine = 0;
-    for (CSSValueListIterator i = value; i.hasMore(); i.advance()) {
-        CSSValue* currValue = i.value();
-        if (currValue->isGridLineNamesValue()) {
-            CSSGridLineNamesValue* lineNamesValue = toCSSGridLineNamesValue(currValue);
-            for (CSSValueListIterator j = lineNamesValue; j.hasMore(); j.advance()) {
-                String namedGridLine = toCSSPrimitiveValue(j.value())->getStringValue();
-                NamedGridLinesMap::AddResult result = namedGridLines.add(namedGridLine, Vector<size_t>());
-                result.storedValue->value.append(currentNamedGridLine);
-                OrderedNamedGridLines::AddResult orderedInsertionResult = orderedNamedGridLines.add(currentNamedGridLine, Vector<String>());
-                orderedInsertionResult.storedValue->value.append(namedGridLine);
-            }
-            continue;
-        }
-
-        ++currentNamedGridLine;
-        trackSizes.append(createGridTrackSize(currValue, state));
-    }
-
-    // The parser should have rejected any <track-list> without any <track-size> as
-    // this is not conformant to the syntax.
-    ASSERT(!trackSizes.isEmpty());
-    return true;
-}
-
-static bool createGridPosition(CSSValue* value, GridPosition& position)
-{
-    // We accept the specification's grammar:
-    // 'auto' | [ <integer> || <string> ] | [ span && [ <integer> || string ] ] | <ident>
-
-    if (value->isPrimitiveValue()) {
-        CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
-        // We translate <ident> to <string> during parsing as it
-        // makes handling it more simple.
-        if (primitiveValue->isString()) {
-            position.setNamedGridArea(primitiveValue->getStringValue());
-            return true;
-        }
-
-        ASSERT(primitiveValue->getValueID() == CSSValueAuto);
-        return true;
-    }
-
-    CSSValueList* values = toCSSValueList(value);
-    ASSERT(values->length());
-
-    bool isSpanPosition = false;
-    // The specification makes the <integer> optional, in which case it default to '1'.
-    int gridLineNumber = 1;
-    String gridLineName;
-
-    CSSValueListIterator it = values;
-    CSSPrimitiveValue* currentValue = toCSSPrimitiveValue(it.value());
-    if (currentValue->getValueID() == CSSValueSpan) {
-        isSpanPosition = true;
-        it.advance();
-        currentValue = it.hasMore() ? toCSSPrimitiveValue(it.value()) : 0;
-    }
-
-    if (currentValue && currentValue->isNumber()) {
-        gridLineNumber = currentValue->getIntValue();
-        it.advance();
-        currentValue = it.hasMore() ? toCSSPrimitiveValue(it.value()) : 0;
-    }
-
-    if (currentValue && currentValue->isString()) {
-        gridLineName = currentValue->getStringValue();
-        it.advance();
-    }
-
-    ASSERT(!it.hasMore());
-    if (isSpanPosition)
-        position.setSpanPosition(gridLineNumber, gridLineName);
-    else
-        position.setExplicitPosition(gridLineNumber, gridLineName);
-
-    return true;
-}
-
-static bool degreeToGlyphOrientation(CSSPrimitiveValue* primitiveValue, EGlyphOrientation& orientation)
-{
-    if (!primitiveValue)
-        return false;
-
-    if (primitiveValue->primitiveType() != CSSPrimitiveValue::CSS_DEG)
-        return false;
-
-    float angle = fabsf(fmodf(primitiveValue->getFloatValue(), 360.0f));
-
-    if (angle <= 45.0f || angle > 315.0f) {
-        orientation = GO_0DEG;
-        return true;
-    }
-    if (angle > 45.0f && angle <= 135.0f) {
-        orientation = GO_90DEG;
-        return true;
-    }
-    if (angle > 135.0f && angle <= 225.0f) {
-        orientation = GO_180DEG;
-        return true;
-    }
-    orientation = GO_270DEG;
-    return true;
-}
-
 static Color colorFromSVGPaintCSSValue(SVGPaint* svgPaint, const Color& fgColor)
 {
     Color color;
@@ -1204,38 +1116,6 @@
     return color;
 }
 
-static EPaintOrder paintOrderFlattened(CSSValue* cssPaintOrder)
-{
-    if (cssPaintOrder->isValueList()) {
-        int paintOrder = 0;
-        CSSValueListInspector iter(cssPaintOrder);
-        for (size_t i = 0; i < iter.length(); i++) {
-            CSSPrimitiveValue* value = toCSSPrimitiveValue(iter.item(i));
-
-            EPaintOrderType paintOrderType = PT_NONE;
-            switch (value->getValueID()) {
-            case CSSValueFill:
-                paintOrderType = PT_FILL;
-                break;
-            case CSSValueStroke:
-                paintOrderType = PT_STROKE;
-                break;
-            case CSSValueMarkers:
-                paintOrderType = PT_MARKERS;
-                break;
-            default:
-                ASSERT_NOT_REACHED();
-                break;
-            }
-
-            paintOrder |= (paintOrderType << kPaintOrderBitwidth*i);
-        }
-        return (EPaintOrder)paintOrder;
-    }
-
-    return PO_NORMAL;
-}
-
 static inline bool isValidVisitedLinkProperty(CSSPropertyID id)
 {
     switch (id) {
@@ -1544,14 +1424,6 @@
         state.style()->setTextStrokeWidth(width);
         return;
     }
-    case CSSPropertyTransform:
-    case CSSPropertyWebkitTransform: {
-        HANDLE_INHERIT_AND_INITIAL(transform, Transform);
-        TransformOperations operations;
-        TransformBuilder::createTransformOperations(value, state.cssToLengthConversionData(), operations);
-        state.style()->setTransform(operations);
-        return;
-    }
     case CSSPropertyPerspective:
     case CSSPropertyWebkitPerspective: {
         HANDLE_INHERIT_AND_INITIAL(perspective, Perspective)
@@ -1578,15 +1450,6 @@
             state.style()->setPerspective(perspectiveValue);
         return;
     }
-    case CSSPropertyWebkitTapHighlightColor: {
-        HANDLE_INHERIT_AND_INITIAL(tapHighlightColor, TapHighlightColor);
-        if (!primitiveValue)
-            break;
-
-        Color col = state.document().textLinkColors().colorFromPrimitiveValue(primitiveValue, state.style()->color());
-        state.style()->setTapHighlightColor(col);
-        return;
-    }
     case CSSPropertyInternalCallback: {
         if (isInherit || isInitial)
             return;
@@ -1702,132 +1565,6 @@
         return;
     }
 
-    case CSSPropertyWebkitFilter: {
-        HANDLE_INHERIT_AND_INITIAL(filter, Filter);
-        FilterOperations operations;
-        if (FilterOperationResolver::createFilterOperations(value, state.cssToLengthConversionData(), operations, state))
-            state.style()->setFilter(operations);
-        return;
-    }
-    case CSSPropertyGridAutoColumns: {
-        HANDLE_INHERIT_AND_INITIAL(gridAutoColumns, GridAutoColumns);
-        state.style()->setGridAutoColumns(createGridTrackSize(value, state));
-        return;
-    }
-    case CSSPropertyGridAutoRows: {
-        HANDLE_INHERIT_AND_INITIAL(gridAutoRows, GridAutoRows);
-        state.style()->setGridAutoRows(createGridTrackSize(value, state));
-        return;
-    }
-    case CSSPropertyGridTemplateColumns: {
-        if (isInherit) {
-            state.style()->setGridTemplateColumns(state.parentStyle()->gridTemplateColumns());
-            state.style()->setNamedGridColumnLines(state.parentStyle()->namedGridColumnLines());
-            state.style()->setOrderedNamedGridColumnLines(state.parentStyle()->orderedNamedGridColumnLines());
-            return;
-        }
-        if (isInitial) {
-            state.style()->setGridTemplateColumns(RenderStyle::initialGridTemplateColumns());
-            state.style()->setNamedGridColumnLines(RenderStyle::initialNamedGridColumnLines());
-            state.style()->setOrderedNamedGridColumnLines(RenderStyle::initialOrderedNamedGridColumnLines());
-            return;
-        }
-
-        Vector<GridTrackSize> trackSizes;
-        NamedGridLinesMap namedGridLines;
-        OrderedNamedGridLines orderedNamedGridLines;
-        if (!createGridTrackList(value, trackSizes, namedGridLines, orderedNamedGridLines, state))
-            return;
-        state.style()->setGridTemplateColumns(trackSizes);
-        state.style()->setNamedGridColumnLines(namedGridLines);
-        state.style()->setOrderedNamedGridColumnLines(orderedNamedGridLines);
-        return;
-    }
-    case CSSPropertyGridTemplateRows: {
-        if (isInherit) {
-            state.style()->setGridTemplateRows(state.parentStyle()->gridTemplateRows());
-            state.style()->setNamedGridRowLines(state.parentStyle()->namedGridRowLines());
-            state.style()->setOrderedNamedGridRowLines(state.parentStyle()->orderedNamedGridRowLines());
-            return;
-        }
-        if (isInitial) {
-            state.style()->setGridTemplateRows(RenderStyle::initialGridTemplateRows());
-            state.style()->setNamedGridRowLines(RenderStyle::initialNamedGridRowLines());
-            state.style()->setOrderedNamedGridRowLines(RenderStyle::initialOrderedNamedGridRowLines());
-            return;
-        }
-
-        Vector<GridTrackSize> trackSizes;
-        NamedGridLinesMap namedGridLines;
-        OrderedNamedGridLines orderedNamedGridLines;
-        if (!createGridTrackList(value, trackSizes, namedGridLines, orderedNamedGridLines, state))
-            return;
-        state.style()->setGridTemplateRows(trackSizes);
-        state.style()->setNamedGridRowLines(namedGridLines);
-        state.style()->setOrderedNamedGridRowLines(orderedNamedGridLines);
-        return;
-    }
-
-    case CSSPropertyGridColumnStart: {
-        HANDLE_INHERIT_AND_INITIAL(gridColumnStart, GridColumnStart);
-        GridPosition startPosition;
-        if (!createGridPosition(value, startPosition))
-            return;
-        state.style()->setGridColumnStart(startPosition);
-        return;
-    }
-    case CSSPropertyGridColumnEnd: {
-        HANDLE_INHERIT_AND_INITIAL(gridColumnEnd, GridColumnEnd);
-        GridPosition endPosition;
-        if (!createGridPosition(value, endPosition))
-            return;
-        state.style()->setGridColumnEnd(endPosition);
-        return;
-    }
-
-    case CSSPropertyGridRowStart: {
-        HANDLE_INHERIT_AND_INITIAL(gridRowStart, GridRowStart);
-        GridPosition beforePosition;
-        if (!createGridPosition(value, beforePosition))
-            return;
-        state.style()->setGridRowStart(beforePosition);
-        return;
-    }
-    case CSSPropertyGridRowEnd: {
-        HANDLE_INHERIT_AND_INITIAL(gridRowEnd, GridRowEnd);
-        GridPosition afterPosition;
-        if (!createGridPosition(value, afterPosition))
-            return;
-        state.style()->setGridRowEnd(afterPosition);
-        return;
-    }
-
-    case CSSPropertyGridTemplateAreas: {
-        if (isInherit) {
-            state.style()->setNamedGridArea(state.parentStyle()->namedGridArea());
-            state.style()->setNamedGridAreaRowCount(state.parentStyle()->namedGridAreaRowCount());
-            state.style()->setNamedGridAreaColumnCount(state.parentStyle()->namedGridAreaColumnCount());
-            return;
-        }
-        if (isInitial) {
-            state.style()->setNamedGridArea(RenderStyle::initialNamedGridArea());
-            state.style()->setNamedGridAreaRowCount(RenderStyle::initialNamedGridAreaCount());
-            state.style()->setNamedGridAreaColumnCount(RenderStyle::initialNamedGridAreaCount());
-            return;
-        }
-
-        if (value->isPrimitiveValue()) {
-            ASSERT(toCSSPrimitiveValue(value)->getValueID() == CSSValueNone);
-            return;
-        }
-
-        CSSGridTemplateAreasValue* gridTemplateAreasValue = toCSSGridTemplateAreasValue(value);
-        state.style()->setNamedGridArea(gridTemplateAreasValue->gridAreaMap());
-        state.style()->setNamedGridAreaRowCount(gridTemplateAreasValue->rowCount());
-        state.style()->setNamedGridAreaColumnCount(gridTemplateAreasValue->columnCount());
-        return;
-    }
-
     case CSSPropertyJustifySelf: {
         HANDLE_INHERIT_AND_INITIAL(justifySelf, JustifySelf);
         CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
@@ -1932,6 +1669,15 @@
     case CSSPropertyFontVariant:
     case CSSPropertyFontVariantLigatures:
     case CSSPropertyFontWeight:
+    case CSSPropertyGridAutoColumns:
+    case CSSPropertyGridAutoRows:
+    case CSSPropertyGridColumnStart:
+    case CSSPropertyGridColumnEnd:
+    case CSSPropertyGridRowStart:
+    case CSSPropertyGridRowEnd:
+    case CSSPropertyGridTemplateAreas:
+    case CSSPropertyGridTemplateColumns:
+    case CSSPropertyGridTemplateRows:
     case CSSPropertyHeight:
     case CSSPropertyImageRendering:
     case CSSPropertyIsolation:
@@ -2043,6 +1789,7 @@
     case CSSPropertyFlexWrap:
     case CSSPropertyJustifyContent:
     case CSSPropertyOrder:
+    case CSSPropertyWebkitFilter:
     case CSSPropertyWebkitFontSmoothing:
     case CSSPropertyWebkitHighlight:
     case CSSPropertyWebkitHyphenateCharacter:
@@ -2083,6 +1830,8 @@
     case CSSPropertyWebkitTextFillColor:
     case CSSPropertyWebkitTextSecurity:
     case CSSPropertyWebkitTextStrokeColor:
+    case CSSPropertyTransform:
+    case CSSPropertyWebkitTransform:
     case CSSPropertyWebkitTransformOriginX:
     case CSSPropertyWebkitTransformOriginY:
     case CSSPropertyWebkitTransformOriginZ:
@@ -2143,6 +1892,14 @@
     case CSSPropertyStrokeMiterlimit:
     case CSSPropertyStrokeOpacity:
     case CSSPropertyStrokeWidth:
+    case CSSPropertyStopColor:
+    case CSSPropertyLightingColor:
+    case CSSPropertyFloodColor:
+    case CSSPropertyWebkitTapHighlightColor:
+    case CSSPropertyPaintOrder:
+    case CSSPropertyStrokeDasharray:
+    case CSSPropertyGlyphOrientationHorizontal:
+    case CSSPropertyGlyphOrientationVertical:
         ASSERT_NOT_REACHED();
         return;
     // Only used in @viewport rules
@@ -2217,83 +1974,6 @@
         }
         break;
     }
-    case CSSPropertyStrokeDasharray:
-    {
-        HANDLE_SVG_INHERIT_AND_INITIAL(strokeDashArray, StrokeDashArray)
-        if (!value->isValueList()) {
-            state.style()->accessSVGStyle()->setStrokeDashArray(SVGRenderStyle::initialStrokeDashArray());
-            break;
-        }
-
-        CSSValueList* dashes = toCSSValueList(value);
-
-        RefPtr<SVGLengthList> array = SVGLengthList::create();
-        size_t length = dashes->length();
-        for (size_t i = 0; i < length; ++i) {
-            CSSValue* currValue = dashes->itemWithoutBoundsCheck(i);
-            if (!currValue->isPrimitiveValue())
-                continue;
-
-            CSSPrimitiveValue* dash = toCSSPrimitiveValue(dashes->itemWithoutBoundsCheck(i));
-            array->append(SVGLength::fromCSSPrimitiveValue(dash));
-        }
-
-        state.style()->accessSVGStyle()->setStrokeDashArray(array.release());
-        break;
-    }
-    case CSSPropertyStopColor:
-    {
-        HANDLE_SVG_INHERIT_AND_INITIAL(stopColor, StopColor);
-        if (primitiveValue->isRGBColor())
-            state.style()->accessSVGStyle()->setStopColor(primitiveValue->getRGBA32Value());
-        else if (primitiveValue->getValueID() == CSSValueCurrentcolor)
-            state.style()->accessSVGStyle()->setStopColor(state.style()->color());
-        break;
-    }
-    case CSSPropertyLightingColor:
-    {
-        HANDLE_SVG_INHERIT_AND_INITIAL(lightingColor, LightingColor);
-        if (primitiveValue->isRGBColor())
-            state.style()->accessSVGStyle()->setLightingColor(primitiveValue->getRGBA32Value());
-        else if (primitiveValue->getValueID() == CSSValueCurrentcolor)
-            state.style()->accessSVGStyle()->setLightingColor(state.style()->color());
-        break;
-    }
-    case CSSPropertyFloodColor:
-    {
-        HANDLE_SVG_INHERIT_AND_INITIAL(floodColor, FloodColor);
-        if (primitiveValue->isRGBColor())
-            state.style()->accessSVGStyle()->setFloodColor(primitiveValue->getRGBA32Value());
-        else if (primitiveValue->getValueID() == CSSValueCurrentcolor)
-            state.style()->accessSVGStyle()->setFloodColor(state.style()->color());
-        break;
-    }
-    case CSSPropertyGlyphOrientationHorizontal:
-    {
-        HANDLE_SVG_INHERIT_AND_INITIAL(glyphOrientationHorizontal, GlyphOrientationHorizontal)
-        EGlyphOrientation orientation;
-        if (degreeToGlyphOrientation(primitiveValue, orientation))
-            state.style()->accessSVGStyle()->setGlyphOrientationHorizontal(orientation);
-        break;
-    }
-    case CSSPropertyPaintOrder: {
-        HANDLE_SVG_INHERIT_AND_INITIAL(paintOrder, PaintOrder)
-        if (value->isValueList())
-            state.style()->accessSVGStyle()->setPaintOrder(paintOrderFlattened(value));
-        break;
-    }
-    case CSSPropertyGlyphOrientationVertical:
-    {
-        HANDLE_SVG_INHERIT_AND_INITIAL(glyphOrientationVertical, GlyphOrientationVertical)
-        if (primitiveValue->getValueID() == CSSValueAuto) {
-            state.style()->accessSVGStyle()->setGlyphOrientationVertical(GO_AUTO);
-            break;
-        }
-        EGlyphOrientation orientation;
-        if (degreeToGlyphOrientation(primitiveValue, orientation))
-            state.style()->accessSVGStyle()->setGlyphOrientationVertical(orientation);
-        break;
-    }
     case CSSPropertyEnableBackground:
         // Silently ignoring this property for now
         // http://bugs.webkit.org/show_bug.cgi?id=6022
diff --git a/Source/core/css/resolver/StyleResolver.cpp b/Source/core/css/resolver/StyleResolver.cpp
index 940cc1c..5c412c6 100644
--- a/Source/core/css/resolver/StyleResolver.cpp
+++ b/Source/core/css/resolver/StyleResolver.cpp
@@ -34,7 +34,6 @@
 #include "RuntimeEnabledFeatures.h"
 #include "StylePropertyShorthand.h"
 #include "core/animation/ActiveAnimations.h"
-#include "core/animation/AnimatableLength.h"
 #include "core/animation/AnimatableValue.h"
 #include "core/animation/Animation.h"
 #include "core/animation/DocumentTimeline.h"
@@ -133,6 +132,7 @@
     , m_viewportStyleResolver(ViewportStyleResolver::create(&document))
     , m_needCollectFeatures(false)
     , m_styleResourceLoader(document.fetcher())
+    , m_styleSharingDepth(0)
     , m_styleResolverStatsSequence(0)
     , m_accessCount(0)
 {
@@ -197,7 +197,7 @@
 void StyleResolver::appendPendingAuthorStyleSheets()
 {
     setBuildScopedStyleTreeInDocumentOrder(false);
-    for (ListHashSet<CSSStyleSheet*, 16>::iterator it = m_pendingStyleSheets.begin(); it != m_pendingStyleSheets.end(); ++it)
+    for (WillBeHeapListHashSet<RawPtrWillBeMember<CSSStyleSheet>, 16>::iterator it = m_pendingStyleSheets.begin(); it != m_pendingStyleSheets.end(); ++it)
         appendCSSStyleSheet(*it);
 
     m_pendingStyleSheets.clear();
@@ -318,14 +318,29 @@
     if (!document().inStyleRecalc())
         return;
     INCREMENT_STYLE_STATS_COUNTER(*this, sharedStyleCandidates);
-    if (m_styleSharingList.size() >= styleSharingListSize)
-        m_styleSharingList.remove(--m_styleSharingList.end());
-    m_styleSharingList.prepend(&element);
+    StyleSharingList& list = styleSharingList();
+    if (list.size() >= styleSharingListSize)
+        list.remove(--list.end());
+    list.prepend(&element);
+}
+
+StyleSharingList& StyleResolver::styleSharingList()
+{
+    m_styleSharingLists.resize(styleSharingMaxDepth);
+
+    // We never put things at depth 0 into the list since that's only the <html> element
+    // and it has no siblings or cousins to share with.
+    unsigned depth = std::max(std::min(m_styleSharingDepth, styleSharingMaxDepth), 1u) - 1u;
+    ASSERT(depth >= 0);
+
+    if (!m_styleSharingLists[depth])
+        m_styleSharingLists[depth] = adoptPtr(new StyleSharingList);
+    return *m_styleSharingLists[depth];
 }
 
 void StyleResolver::clearStyleSharingList()
 {
-    m_styleSharingList.clear();
+    m_styleSharingLists.resize(0);
 }
 
 void StyleResolver::fontsNeedUpdate(CSSFontSelector* fontSelector)
@@ -565,6 +580,12 @@
         features.addContentAttr(contentAttrValues[i]);
 }
 
+void StyleResolver::adjustRenderStyle(StyleResolverState& state, Element* element)
+{
+    StyleAdjuster adjuster(state.cachedUAStyle(), m_document.inQuirksMode());
+    adjuster.adjustRenderStyle(state.style(), state.parentStyle(), element);
+}
+
 // Start loading resources referenced by this style.
 void StyleResolver::loadPendingResources(StyleResolverState& state)
 {
@@ -582,7 +603,7 @@
 
     // Once an element has a renderer, we don't try to destroy it, since otherwise the renderer
     // will vanish if a style recalc happens during loading.
-    if (sharingBehavior == AllowStyleSharing && !document().styleEngine()->haveStylesheetsLoaded() && !element->renderer()) {
+    if (sharingBehavior == AllowStyleSharing && !document().isRenderingReady() && !element->renderer()) {
         if (!s_styleNotYetAvailable) {
             s_styleNotYetAvailable = RenderStyle::create().leakRef();
             s_styleNotYetAvailable->setDisplay(NONE);
@@ -650,15 +671,14 @@
 
         addContentAttrValuesToFeatures(state.contentAttrValues(), m_features);
     }
-    {
-        StyleAdjuster adjuster(state.cachedUAStyle(), m_document.inQuirksMode());
-        adjuster.adjustRenderStyle(state.style(), state.parentStyle(), element);
-    }
+
+    adjustRenderStyle(state, element);
 
     // FIXME: The CSSWG wants to specify that the effects of animations are applied before
     // important rules, but this currently happens here as we require adjustment to have happened
     // before deciding which properties to transition.
-    applyAnimatedProperties(state, element);
+    if (applyAnimatedProperties(state, element))
+        adjustRenderStyle(state, element);
 
     // FIXME: Shouldn't this be on RenderBody::styleDidChange?
     if (isHTMLBodyElement(*element))
@@ -824,17 +844,16 @@
 
         addContentAttrValuesToFeatures(state.contentAttrValues(), m_features);
     }
-    {
-        StyleAdjuster adjuster(state.cachedUAStyle(), m_document.inQuirksMode());
-        // FIXME: Passing 0 as the Element* introduces a lot of complexity
-        // in the adjustRenderStyle code.
-        adjuster.adjustRenderStyle(state.style(), state.parentStyle(), 0);
-    }
+
+    // FIXME: Passing 0 as the Element* introduces a lot of complexity
+    // in the adjustRenderStyle code.
+    adjustRenderStyle(state, 0);
 
     // FIXME: The CSSWG wants to specify that the effects of animations are applied before
     // important rules, but this currently happens here as we require adjustment to have happened
     // before deciding which properties to transition.
-    applyAnimatedProperties(state, element.pseudoElement(pseudoStyleRequest.pseudoId));
+    if (applyAnimatedProperties(state, element.pseudoElement(pseudoStyleRequest.pseudoId)))
+        adjustRenderStyle(state, 0);
 
     didAccess();
 
@@ -994,7 +1013,7 @@
 // -------------------------------------------------------------------------------------
 // this is mostly boring stuff on how to apply a certain rule to the renderstyle...
 
-void StyleResolver::applyAnimatedProperties(StyleResolverState& state, Element* animatingElement)
+bool StyleResolver::applyAnimatedProperties(StyleResolverState& state, Element* animatingElement)
 {
     const Element* element = state.element();
     ASSERT(element);
@@ -1007,11 +1026,11 @@
     if (!(animatingElement && animatingElement->hasActiveAnimations())
         && !(state.style()->transitions() && !state.style()->transitions()->isEmpty())
         && !(state.style()->animations() && !state.style()->animations()->isEmpty()))
-        return;
+        return false;
 
     state.setAnimationUpdate(CSSAnimations::calculateUpdate(animatingElement, *element, *state.style(), state.parentStyle(), this));
     if (!state.animationUpdate())
-        return;
+        return false;
 
     const WillBeHeapHashMap<CSSPropertyID, RefPtrWillBeMember<Interpolation> >& activeInterpolationsForAnimations = state.animationUpdate()->activeInterpolationsForAnimations();
     const WillBeHeapHashMap<CSSPropertyID, RefPtrWillBeMember<Interpolation> >& activeInterpolationsForTransitions = state.animationUpdate()->activeInterpolationsForTransitions();
@@ -1020,15 +1039,10 @@
     applyAnimatedProperties<LowPriorityProperties>(state, activeInterpolationsForAnimations);
     applyAnimatedProperties<LowPriorityProperties>(state, activeInterpolationsForTransitions);
 
-    // If the animations/transitions change opacity or transform, we need to update
-    // the style to impose the stacking rules. Note that this is also
-    // done in StyleResolver::adjustRenderStyle().
-    RenderStyle* style = state.style();
-    if (style->hasAutoZIndex() && (style->opacity() < 1.0f || style->hasTransformRelatedProperty()))
-        style->setZIndex(0);
-
     // Start loading resources used by animations.
     loadPendingResources(state);
+
+    return true;
 }
 
 template <StyleResolver::StyleApplicationPass pass>
@@ -1093,6 +1107,127 @@
     return false;
 }
 
+static inline bool isValidFirstLetterStyleProperty(CSSPropertyID id)
+{
+    switch (id) {
+    // Valid ::first-letter properties listed in spec:
+    // http://www.w3.org/TR/css3-selectors/#application-in-css
+    case CSSPropertyBackgroundAttachment:
+    case CSSPropertyBackgroundBlendMode:
+    case CSSPropertyBackgroundClip:
+    case CSSPropertyBackgroundColor:
+    case CSSPropertyBackgroundImage:
+    case CSSPropertyBackgroundOrigin:
+    case CSSPropertyBackgroundPosition:
+    case CSSPropertyBackgroundPositionX:
+    case CSSPropertyBackgroundPositionY:
+    case CSSPropertyBackgroundRepeat:
+    case CSSPropertyBackgroundRepeatX:
+    case CSSPropertyBackgroundRepeatY:
+    case CSSPropertyBackgroundSize:
+    case CSSPropertyBorderBottomColor:
+    case CSSPropertyBorderBottomLeftRadius:
+    case CSSPropertyBorderBottomRightRadius:
+    case CSSPropertyBorderBottomStyle:
+    case CSSPropertyBorderBottomWidth:
+    case CSSPropertyBorderImageOutset:
+    case CSSPropertyBorderImageRepeat:
+    case CSSPropertyBorderImageSlice:
+    case CSSPropertyBorderImageSource:
+    case CSSPropertyBorderImageWidth:
+    case CSSPropertyBorderLeftColor:
+    case CSSPropertyBorderLeftStyle:
+    case CSSPropertyBorderLeftWidth:
+    case CSSPropertyBorderRightColor:
+    case CSSPropertyBorderRightStyle:
+    case CSSPropertyBorderRightWidth:
+    case CSSPropertyBorderTopColor:
+    case CSSPropertyBorderTopLeftRadius:
+    case CSSPropertyBorderTopRightRadius:
+    case CSSPropertyBorderTopStyle:
+    case CSSPropertyBorderTopWidth:
+    case CSSPropertyColor:
+    case CSSPropertyFloat:
+    case CSSPropertyFont:
+    case CSSPropertyFontFamily:
+    case CSSPropertyFontKerning:
+    case CSSPropertyFontSize:
+    case CSSPropertyFontStretch:
+    case CSSPropertyFontStyle:
+    case CSSPropertyFontVariant:
+    case CSSPropertyFontVariantLigatures:
+    case CSSPropertyFontWeight:
+    case CSSPropertyLetterSpacing:
+    case CSSPropertyLineHeight:
+    case CSSPropertyMarginBottom:
+    case CSSPropertyMarginLeft:
+    case CSSPropertyMarginRight:
+    case CSSPropertyMarginTop:
+    case CSSPropertyPaddingBottom:
+    case CSSPropertyPaddingLeft:
+    case CSSPropertyPaddingRight:
+    case CSSPropertyPaddingTop:
+    case CSSPropertyTextTransform:
+    case CSSPropertyVerticalAlign:
+    case CSSPropertyWebkitBackgroundClip:
+    case CSSPropertyWebkitBackgroundComposite:
+    case CSSPropertyWebkitBackgroundOrigin:
+    case CSSPropertyWebkitBackgroundSize:
+    case CSSPropertyWebkitBorderAfter:
+    case CSSPropertyWebkitBorderAfterColor:
+    case CSSPropertyWebkitBorderAfterStyle:
+    case CSSPropertyWebkitBorderAfterWidth:
+    case CSSPropertyWebkitBorderBefore:
+    case CSSPropertyWebkitBorderBeforeColor:
+    case CSSPropertyWebkitBorderBeforeStyle:
+    case CSSPropertyWebkitBorderBeforeWidth:
+    case CSSPropertyWebkitBorderEnd:
+    case CSSPropertyWebkitBorderEndColor:
+    case CSSPropertyWebkitBorderEndStyle:
+    case CSSPropertyWebkitBorderEndWidth:
+    case CSSPropertyWebkitBorderFit:
+    case CSSPropertyWebkitBorderHorizontalSpacing:
+    case CSSPropertyWebkitBorderImage:
+    case CSSPropertyWebkitBorderRadius:
+    case CSSPropertyWebkitBorderStart:
+    case CSSPropertyWebkitBorderStartColor:
+    case CSSPropertyWebkitBorderStartStyle:
+    case CSSPropertyWebkitBorderStartWidth:
+    case CSSPropertyWebkitBorderVerticalSpacing:
+    case CSSPropertyWebkitFontSmoothing:
+    case CSSPropertyWebkitMarginAfter:
+    case CSSPropertyWebkitMarginAfterCollapse:
+    case CSSPropertyWebkitMarginBefore:
+    case CSSPropertyWebkitMarginBeforeCollapse:
+    case CSSPropertyWebkitMarginBottomCollapse:
+    case CSSPropertyWebkitMarginCollapse:
+    case CSSPropertyWebkitMarginEnd:
+    case CSSPropertyWebkitMarginStart:
+    case CSSPropertyWebkitMarginTopCollapse:
+    case CSSPropertyWordSpacing:
+        return true;
+    case CSSPropertyTextDecorationColor:
+    case CSSPropertyTextDecorationLine:
+    case CSSPropertyTextDecorationStyle:
+        return RuntimeEnabledFeatures::css3TextDecorationsEnabled();
+
+    // text-shadow added in text decoration spec:
+    // http://www.w3.org/TR/css-text-decor-3/#text-shadow-property
+    case CSSPropertyTextShadow:
+    // box-shadox added in CSS3 backgrounds spec:
+    // http://www.w3.org/TR/css3-background/#placement
+    case CSSPropertyBoxShadow:
+    case CSSPropertyWebkitBoxShadow:
+    // Properties that we currently support outside of spec.
+    case CSSPropertyWebkitLineBoxContain:
+    case CSSPropertyVisibility:
+        return true;
+
+    default:
+        return false;
+    }
+}
+
 template <StyleResolver::StyleApplicationPass pass>
 bool StyleResolver::isPropertyForPass(CSSPropertyID property)
 {
@@ -1137,6 +1272,8 @@
 
         if (propertyWhitelistType == PropertyWhitelistCue && !isValidCueStyleProperty(property))
             continue;
+        if (propertyWhitelistType == PropertyWhitelistFirstLetter && !isValidFirstLetterStyleProperty(property))
+            continue;
         if (!isPropertyForPass<pass>(property))
             continue;
         if (pass == HighPriorityProperties && property == CSSPropertyLineHeight)
@@ -1364,6 +1501,8 @@
     visitor->trace(m_uncommonAttributeRuleSet);
     visitor->trace(m_watchedSelectorsRules);
     visitor->trace(m_treeBoundaryCrossingRules);
+    visitor->trace(m_pendingStyleSheets);
+    CSSFontSelectorClient::trace(visitor);
 }
 
 } // namespace WebCore
diff --git a/Source/core/css/resolver/StyleResolver.h b/Source/core/css/resolver/StyleResolver.h
index f11108b..cf9e0ab 100644
--- a/Source/core/css/resolver/StyleResolver.h
+++ b/Source/core/css/resolver/StyleResolver.h
@@ -84,7 +84,8 @@
     MatchAllRulesExcludingSMIL
 };
 
-const unsigned styleSharingListSize = 40;
+const unsigned styleSharingListSize = 15;
+const unsigned styleSharingMaxDepth = 32;
 typedef WTF::Deque<Element*, styleSharingListSize> StyleSharingList;
 
 struct CSSPropertyValue {
@@ -206,7 +207,7 @@
         return m_features;
     }
 
-    StyleSharingList& styleSharingList() { return m_styleSharingList; }
+    StyleSharingList& styleSharingList();
 
     bool hasRulesForId(const AtomicString&) const;
 
@@ -223,6 +224,9 @@
     unsigned accessCount() const { return m_accessCount; }
     void didAccess() { ++m_accessCount; }
 
+    void increaseStyleSharingDepth() { ++m_styleSharingDepth; }
+    void decreaseStyleSharingDepth() { --m_styleSharingDepth; }
+
     PassRefPtr<PseudoElement> createPseudoElementIfNeeded(Element& parent, PseudoId);
 
     virtual void trace(Visitor*) OVERRIDE;
@@ -238,6 +242,7 @@
     void updateFont(StyleResolverState&);
 
     void loadPendingResources(StyleResolverState&);
+    void adjustRenderStyle(StyleResolverState&, Element*);
 
     void appendCSSStyleSheet(CSSStyleSheet*);
 
@@ -255,7 +260,7 @@
     bool fastRejectSelector(const RuleData&) const;
 
     void applyMatchedProperties(StyleResolverState&, const MatchResult&);
-    void applyAnimatedProperties(StyleResolverState&, Element* animatingElement);
+    bool applyAnimatedProperties(StyleResolverState&, Element* animatingElement);
 
     enum StyleApplicationPass {
         AnimationProperties,
@@ -300,10 +305,7 @@
 
     OwnPtrWillBeMember<ViewportStyleResolver> m_viewportStyleResolver;
 
-    // FIXME: Oilpan: This should be a WillBeHeapListHashSet.
-    // This is safe for now, but should be updated when we support
-    // heap allocated ListHashSets.
-    ListHashSet<CSSStyleSheet*, 16> m_pendingStyleSheets;
+    WillBeHeapListHashSet<RawPtrWillBeMember<CSSStyleSheet>, 16> m_pendingStyleSheets;
 
     ScopedStyleTree m_styleTree;
 
@@ -321,7 +323,8 @@
 
     StyleResourceLoader m_styleResourceLoader;
 
-    StyleSharingList m_styleSharingList;
+    unsigned m_styleSharingDepth;
+    Vector<OwnPtr<StyleSharingList>, styleSharingMaxDepth> m_styleSharingLists;
 
     OwnPtr<StyleResolverStats> m_styleResolverStats;
     OwnPtr<StyleResolverStats> m_styleResolverStatsTotals;
diff --git a/Source/core/css/resolver/StyleResolverParentScope.h b/Source/core/css/resolver/StyleResolverParentScope.h
index 8972b42..87ca21c 100644
--- a/Source/core/css/resolver/StyleResolverParentScope.h
+++ b/Source/core/css/resolver/StyleResolverParentScope.h
@@ -39,11 +39,13 @@
     ASSERT(m_parent.document().inStyleRecalc());
     ASSERT(parent.isElementNode() || parent.isShadowRoot());
     s_currentScope = this;
+    m_resolver.increaseStyleSharingDepth();
 }
 
 inline StyleResolverParentScope::~StyleResolverParentScope()
 {
     s_currentScope = m_previous;
+    m_resolver.decreaseStyleSharingDepth();
     if (!m_pushed)
         return;
     if (m_parent.isElementNode())
diff --git a/Source/core/debugger_script_source.target.darwin-arm.mk b/Source/core/debugger_script_source.target.darwin-arm.mk
index e73e03b..c24a66e 100644
--- a/Source/core/debugger_script_source.target.darwin-arm.mk
+++ b/Source/core/debugger_script_source.target.darwin-arm.mk
@@ -16,6 +16,7 @@
 
 ### Rules for action "ConvertFileToHeaderWithCharacterArray":
 $(gyp_shared_intermediate_dir)/blink/DebuggerScriptSource.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/DebuggerScriptSource.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/DebuggerScriptSource.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/DebuggerScriptSource.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/DebuggerScriptSource.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/debugger_script_source.target.darwin-arm64.mk b/Source/core/debugger_script_source.target.darwin-arm64.mk
index e73e03b..c24a66e 100644
--- a/Source/core/debugger_script_source.target.darwin-arm64.mk
+++ b/Source/core/debugger_script_source.target.darwin-arm64.mk
@@ -16,6 +16,7 @@
 
 ### Rules for action "ConvertFileToHeaderWithCharacterArray":
 $(gyp_shared_intermediate_dir)/blink/DebuggerScriptSource.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/DebuggerScriptSource.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/DebuggerScriptSource.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/DebuggerScriptSource.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/DebuggerScriptSource.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/debugger_script_source.target.darwin-mips.mk b/Source/core/debugger_script_source.target.darwin-mips.mk
index e73e03b..c24a66e 100644
--- a/Source/core/debugger_script_source.target.darwin-mips.mk
+++ b/Source/core/debugger_script_source.target.darwin-mips.mk
@@ -16,6 +16,7 @@
 
 ### Rules for action "ConvertFileToHeaderWithCharacterArray":
 $(gyp_shared_intermediate_dir)/blink/DebuggerScriptSource.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/DebuggerScriptSource.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/DebuggerScriptSource.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/DebuggerScriptSource.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/DebuggerScriptSource.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/debugger_script_source.target.darwin-x86.mk b/Source/core/debugger_script_source.target.darwin-x86.mk
index e73e03b..c24a66e 100644
--- a/Source/core/debugger_script_source.target.darwin-x86.mk
+++ b/Source/core/debugger_script_source.target.darwin-x86.mk
@@ -16,6 +16,7 @@
 
 ### Rules for action "ConvertFileToHeaderWithCharacterArray":
 $(gyp_shared_intermediate_dir)/blink/DebuggerScriptSource.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/DebuggerScriptSource.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/DebuggerScriptSource.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/DebuggerScriptSource.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/DebuggerScriptSource.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/debugger_script_source.target.darwin-x86_64.mk b/Source/core/debugger_script_source.target.darwin-x86_64.mk
index e73e03b..c24a66e 100644
--- a/Source/core/debugger_script_source.target.darwin-x86_64.mk
+++ b/Source/core/debugger_script_source.target.darwin-x86_64.mk
@@ -16,6 +16,7 @@
 
 ### Rules for action "ConvertFileToHeaderWithCharacterArray":
 $(gyp_shared_intermediate_dir)/blink/DebuggerScriptSource.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/DebuggerScriptSource.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/DebuggerScriptSource.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/DebuggerScriptSource.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/DebuggerScriptSource.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/debugger_script_source.target.linux-arm.mk b/Source/core/debugger_script_source.target.linux-arm.mk
index e73e03b..c24a66e 100644
--- a/Source/core/debugger_script_source.target.linux-arm.mk
+++ b/Source/core/debugger_script_source.target.linux-arm.mk
@@ -16,6 +16,7 @@
 
 ### Rules for action "ConvertFileToHeaderWithCharacterArray":
 $(gyp_shared_intermediate_dir)/blink/DebuggerScriptSource.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/DebuggerScriptSource.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/DebuggerScriptSource.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/DebuggerScriptSource.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/DebuggerScriptSource.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/debugger_script_source.target.linux-arm64.mk b/Source/core/debugger_script_source.target.linux-arm64.mk
index e73e03b..c24a66e 100644
--- a/Source/core/debugger_script_source.target.linux-arm64.mk
+++ b/Source/core/debugger_script_source.target.linux-arm64.mk
@@ -16,6 +16,7 @@
 
 ### Rules for action "ConvertFileToHeaderWithCharacterArray":
 $(gyp_shared_intermediate_dir)/blink/DebuggerScriptSource.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/DebuggerScriptSource.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/DebuggerScriptSource.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/DebuggerScriptSource.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/DebuggerScriptSource.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/debugger_script_source.target.linux-mips.mk b/Source/core/debugger_script_source.target.linux-mips.mk
index e73e03b..c24a66e 100644
--- a/Source/core/debugger_script_source.target.linux-mips.mk
+++ b/Source/core/debugger_script_source.target.linux-mips.mk
@@ -16,6 +16,7 @@
 
 ### Rules for action "ConvertFileToHeaderWithCharacterArray":
 $(gyp_shared_intermediate_dir)/blink/DebuggerScriptSource.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/DebuggerScriptSource.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/DebuggerScriptSource.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/DebuggerScriptSource.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/DebuggerScriptSource.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/debugger_script_source.target.linux-x86.mk b/Source/core/debugger_script_source.target.linux-x86.mk
index e73e03b..c24a66e 100644
--- a/Source/core/debugger_script_source.target.linux-x86.mk
+++ b/Source/core/debugger_script_source.target.linux-x86.mk
@@ -16,6 +16,7 @@
 
 ### Rules for action "ConvertFileToHeaderWithCharacterArray":
 $(gyp_shared_intermediate_dir)/blink/DebuggerScriptSource.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/DebuggerScriptSource.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/DebuggerScriptSource.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/DebuggerScriptSource.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/DebuggerScriptSource.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/debugger_script_source.target.linux-x86_64.mk b/Source/core/debugger_script_source.target.linux-x86_64.mk
index e73e03b..c24a66e 100644
--- a/Source/core/debugger_script_source.target.linux-x86_64.mk
+++ b/Source/core/debugger_script_source.target.linux-x86_64.mk
@@ -16,6 +16,7 @@
 
 ### Rules for action "ConvertFileToHeaderWithCharacterArray":
 $(gyp_shared_intermediate_dir)/blink/DebuggerScriptSource.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/DebuggerScriptSource.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/DebuggerScriptSource.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/DebuggerScriptSource.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/DebuggerScriptSource.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/dom/Attr.cpp b/Source/core/dom/Attr.cpp
index 901e711..a56a2df 100644
--- a/Source/core/dom/Attr.cpp
+++ b/Source/core/dom/Attr.cpp
@@ -75,7 +75,9 @@
 
 void Attr::createTextChild()
 {
+#if !ENABLE(OILPAN)
     ASSERT(refCount());
+#endif
     if (!value().isEmpty()) {
         RefPtr<Text> textNode = document().createTextNode(value().string());
 
diff --git a/Source/core/dom/CSSSelectorWatch.cpp b/Source/core/dom/CSSSelectorWatch.cpp
index 2b10e08..123c036 100644
--- a/Source/core/dom/CSSSelectorWatch.cpp
+++ b/Source/core/dom/CSSSelectorWatch.cpp
@@ -167,6 +167,7 @@
 void CSSSelectorWatch::trace(Visitor* visitor)
 {
     visitor->trace(m_watchedCallbackSelectors);
+    DocumentSupplement::trace(visitor);
 }
 
 } // namespace WebCore
diff --git a/Source/core/dom/ContainerNode.cpp b/Source/core/dom/ContainerNode.cpp
index da93bff..6ca8c75 100644
--- a/Source/core/dom/ContainerNode.cpp
+++ b/Source/core/dom/ContainerNode.cpp
@@ -72,6 +72,7 @@
     toContainerNode(node).removeChildren();
 }
 
+#if !ENABLE(OILPAN)
 void ContainerNode::removeDetachedChildren()
 {
     if (connectedSubframeCount()) {
@@ -81,6 +82,7 @@
     ASSERT(needsAttach());
     removeDetachedChildrenInContainer<Node, ContainerNode>(*this);
 }
+#endif
 
 void ContainerNode::parserTakeAllChildrenFrom(ContainerNode& oldParent)
 {
@@ -93,10 +95,12 @@
 
 ContainerNode::~ContainerNode()
 {
-#if !ENABLE(OILPAN)
+#if ENABLE(OILPAN)
+    ASSERT(needsAttach());
+#else
     willBeDeletedFromDocument();
-#endif
     removeDetachedChildren();
+#endif
 }
 
 bool ContainerNode::isChildTypeAllowed(const Node& child) const
@@ -254,11 +258,11 @@
     ASSERT(m_lastChild != prev);
     nextChild.setPreviousSibling(&newChild);
     if (prev) {
-        ASSERT(m_firstChild != nextChild);
+        ASSERT(firstChild() != nextChild);
         ASSERT(prev->nextSibling() == nextChild);
         prev->setNextSibling(&newChild);
     } else {
-        ASSERT(m_firstChild == nextChild);
+        ASSERT(firstChild() == nextChild);
         m_firstChild = &newChild;
     }
     newChild.setParentOrShadowHostNode(this);
@@ -409,6 +413,13 @@
     ChildFrameDisconnector(*this).disconnect();
 }
 
+void ContainerNode::trace(Visitor* visitor)
+{
+    visitor->trace(m_firstChild);
+    visitor->trace(m_lastChild);
+    Node::trace(visitor);
+}
+
 void ContainerNode::removeChild(Node* oldChild, ExceptionState& exceptionState)
 {
 #if !ENABLE(OILPAN)
@@ -475,9 +486,9 @@
         nextChild->setPreviousSibling(previousChild);
     if (previousChild)
         previousChild->setNextSibling(nextChild);
-    if (m_firstChild == oldChild)
+    if (m_firstChild == &oldChild)
         m_firstChild = nextChild;
-    if (m_lastChild == oldChild)
+    if (m_lastChild == &oldChild)
         m_lastChild = previousChild;
 
     oldChild.setPreviousSibling(0);
@@ -564,9 +575,11 @@
 {
     RefPtr<ContainerNode> protect(this);
 
+#if !ENABLE(OILPAN)
     // Check that this node is not "floating".
     // If it is, it can be deleted as a side effect of sending mutation events.
     ASSERT(refCount() || parentOrShadowHostNode());
+#endif
 
     // Make sure adding the new child is ok
     if (!checkAcceptChild(newChild.get(), 0, exceptionState))
@@ -816,12 +829,14 @@
     if (!renderer())
         return;
 
-    if (renderStyle()->affectedByFocus() && renderStyle()->hasPseudoStyle(FIRST_LETTER))
-        setNeedsStyleRecalc(SubtreeStyleChange);
-    else if (isElementNode() && toElement(this)->childrenAffectedByFocus())
-        document().ensureStyleResolver().ensureUpdatedRuleFeatureSet().scheduleStyleInvalidationForPseudoChange(CSSSelector::PseudoFocus, *toElement(this));
-    else if (renderStyle()->affectedByFocus())
-        setNeedsStyleRecalc(LocalStyleChange);
+    if (styleChangeType() < SubtreeStyleChange) {
+        if (renderStyle()->affectedByFocus() && renderStyle()->hasPseudoStyle(FIRST_LETTER))
+            setNeedsStyleRecalc(SubtreeStyleChange);
+        else if (isElementNode() && toElement(this)->childrenAffectedByFocus())
+            document().ensureStyleResolver().ensureUpdatedRuleFeatureSet().scheduleStyleInvalidationForPseudoChange(CSSSelector::PseudoFocus, *toElement(this));
+        else if (renderStyle()->affectedByFocus())
+            setNeedsStyleRecalc(LocalStyleChange);
+    }
 
     if (renderer() && renderer()->style()->hasAppearance())
         RenderTheme::theme().stateChanged(renderer(), FocusState);
@@ -840,7 +855,7 @@
         return;
 
     // If :focus sets display: none, we lose focus but still need to recalc our style.
-    if (isElementNode() && toElement(this)->childrenAffectedByFocus())
+    if (isElementNode() && toElement(this)->childrenAffectedByFocus() && styleChangeType() < SubtreeStyleChange)
         document().ensureStyleResolver().ensureUpdatedRuleFeatureSet().scheduleStyleInvalidationForPseudoChange(CSSSelector::PseudoFocus, *toElement(this));
     else
         setNeedsStyleRecalc(LocalStyleChange);
@@ -855,12 +870,14 @@
 
     // FIXME: Why does this not need to handle the display: none transition like :hover does?
     if (renderer()) {
-        if (renderStyle()->affectedByActive() && renderStyle()->hasPseudoStyle(FIRST_LETTER))
-            setNeedsStyleRecalc(SubtreeStyleChange);
-        else if (isElementNode() && toElement(this)->childrenAffectedByActive())
-            document().ensureStyleResolver().ensureUpdatedRuleFeatureSet().scheduleStyleInvalidationForPseudoChange(CSSSelector::PseudoActive, *toElement(this));
-        else if (renderStyle()->affectedByActive())
-            setNeedsStyleRecalc(LocalStyleChange);
+        if (styleChangeType() < SubtreeStyleChange) {
+            if (renderStyle()->affectedByActive() && renderStyle()->hasPseudoStyle(FIRST_LETTER))
+                setNeedsStyleRecalc(SubtreeStyleChange);
+            else if (isElementNode() && toElement(this)->childrenAffectedByActive())
+                document().ensureStyleResolver().ensureUpdatedRuleFeatureSet().scheduleStyleInvalidationForPseudoChange(CSSSelector::PseudoActive, *toElement(this));
+            else if (renderStyle()->affectedByActive())
+                setNeedsStyleRecalc(LocalStyleChange);
+        }
 
         if (renderStyle()->hasAppearance())
             RenderTheme::theme().stateChanged(renderer(), PressedState);
@@ -878,19 +895,21 @@
     if (!renderer()) {
         if (over)
             return;
-        if (isElementNode() && toElement(this)->childrenAffectedByHover())
+        if (isElementNode() && toElement(this)->childrenAffectedByHover() && styleChangeType() < SubtreeStyleChange)
             document().ensureStyleResolver().ensureUpdatedRuleFeatureSet().scheduleStyleInvalidationForPseudoChange(CSSSelector::PseudoHover, *toElement(this));
         else
             setNeedsStyleRecalc(LocalStyleChange);
         return;
     }
 
-    if (renderStyle()->affectedByHover() && renderStyle()->hasPseudoStyle(FIRST_LETTER))
-        setNeedsStyleRecalc(SubtreeStyleChange);
-    else if (isElementNode() && toElement(this)->childrenAffectedByHover())
-        document().ensureStyleResolver().ensureUpdatedRuleFeatureSet().scheduleStyleInvalidationForPseudoChange(CSSSelector::PseudoHover, *toElement(this));
-    else if (renderStyle()->affectedByHover())
-        setNeedsStyleRecalc(LocalStyleChange);
+    if (styleChangeType() < SubtreeStyleChange) {
+        if (renderStyle()->affectedByHover() && renderStyle()->hasPseudoStyle(FIRST_LETTER))
+            setNeedsStyleRecalc(SubtreeStyleChange);
+        else if (isElementNode() && toElement(this)->childrenAffectedByHover())
+            document().ensureStyleResolver().ensureUpdatedRuleFeatureSet().scheduleStyleInvalidationForPseudoChange(CSSSelector::PseudoHover, *toElement(this));
+        else if (renderStyle()->affectedByHover())
+            setNeedsStyleRecalc(LocalStyleChange);
+    }
 
     if (renderer()->style()->hasAppearance())
         RenderTheme::theme().stateChanged(renderer(), HoverState);
@@ -995,8 +1014,10 @@
 
 void ContainerNode::updateTreeAfterInsertion(Node& child)
 {
+#if !ENABLE(OILPAN)
     ASSERT(refCount());
     ASSERT(child.refCount());
+#endif
 
     ChildListMutationScope(*this).childAdded(child);
 
diff --git a/Source/core/dom/ContainerNode.h b/Source/core/dom/ContainerNode.h
index e372bff..99543d2 100644
--- a/Source/core/dom/ContainerNode.h
+++ b/Source/core/dom/ContainerNode.h
@@ -190,6 +190,8 @@
 
     void disconnectDescendantFrames();
 
+    virtual void trace(Visitor*) OVERRIDE;
+
 protected:
     ContainerNode(TreeScope*, ConstructionType = CreateContainer);
 
@@ -199,7 +201,10 @@
     template<class GenericNode, class GenericNodeContainer>
     friend void Private::addChildNodesToDeletionQueue(GenericNode*& head, GenericNode*& tail, GenericNodeContainer&);
 
+#if !ENABLE(OILPAN)
     void removeDetachedChildren();
+#endif
+
     void setFirstChild(Node* child) { m_firstChild = child; }
     void setLastChild(Node* child) { m_lastChild = child; }
 
@@ -227,8 +232,8 @@
     bool getUpperLeftCorner(FloatPoint&) const;
     bool getLowerRightCorner(FloatPoint&) const;
 
-    Node* m_firstChild;
-    Node* m_lastChild;
+    RawPtrWillBeMember<Node> m_firstChild;
+    RawPtrWillBeMember<Node> m_lastChild;
 };
 
 #ifndef NDEBUG
@@ -249,8 +254,8 @@
 
 inline ContainerNode::ContainerNode(TreeScope* treeScope, ConstructionType type)
     : Node(treeScope, type)
-    , m_firstChild(0)
-    , m_lastChild(0)
+    , m_firstChild(nullptr)
+    , m_lastChild(nullptr)
 {
 }
 
diff --git a/Source/core/dom/ContainerNodeAlgorithms.h b/Source/core/dom/ContainerNodeAlgorithms.h
index fbac15b..066de60 100644
--- a/Source/core/dom/ContainerNodeAlgorithms.h
+++ b/Source/core/dom/ContainerNodeAlgorithms.h
@@ -73,6 +73,7 @@
 
 }
 
+#if !ENABLE(OILPAN)
 // Helper functions for TreeShared-derived classes, which have a 'Node' style interface
 // This applies to 'ContainerNode' and 'SVGElementInstance'
 template<class GenericNode, class GenericNodeContainer>
@@ -87,9 +88,7 @@
     GenericNode* n;
     GenericNode* next;
     while ((n = head) != 0) {
-#if !ENABLE(OILPAN)
         ASSERT_WITH_SECURITY_IMPLICATION(n->m_deletionHasBegun);
-#endif
 
         next = n->nextSibling();
         n->setNextSibling(0);
@@ -101,11 +100,10 @@
         if (n->hasChildren())
             Private::addChildNodesToDeletionQueue<GenericNode, GenericNodeContainer>(head, tail, static_cast<GenericNodeContainer&>(*n));
 
-#if !ENABLE(OILPAN)
         delete n;
-#endif
     }
 }
+#endif
 
 template<class GenericNode, class GenericNodeContainer>
 inline void appendChildToContainer(GenericNode& child, GenericNodeContainer& container)
@@ -171,28 +169,6 @@
             if (next)
                 next->setPreviousSibling(0);
 
-#if ENABLE(OILPAN)
-            {
-                // Always notify nodes of removal from the document even if they
-                // are going to die. Nodes do not immediately die when their
-                // refcounts reach zero with Oilpan. They die at the next garbage
-                // collection. The notifications when removed from document
-                // allows us to perform cleanup on the nodes when they are removed
-                // instead of when their destructors are called.
-                RefPtr<GenericNode> protect(n); // removedFromDocument may remove all references to this node.
-                NodeRemovalDispatcher<GenericNode, GenericNodeContainer, ShouldDispatchRemovalNotification<GenericNode>::value>::dispatch(*n, container);
-            }
-            if (!n->refCount()) {
-                // Add the node to the list of nodes to be deleted.
-                // Reuse the nextSibling pointer for this purpose.
-                if (tail)
-                    tail->setNextSibling(n);
-                else
-                    head = n;
-
-                tail = n;
-            }
-#else
             if (!n->refCount()) {
 #if SECURITY_ASSERT_ENABLED
                 n->m_deletionHasBegun = true;
@@ -209,7 +185,6 @@
                 RefPtr<GenericNode> protect(n); // removedFromDocument may remove all references to this node.
                 NodeRemovalDispatcher<GenericNode, GenericNodeContainer, ShouldDispatchRemovalNotification<GenericNode>::value>::dispatch(*n, container);
             }
-#endif // ENABLE(OILPAN)
         }
 
         container.setLastChild(0);
diff --git a/Source/core/dom/ContextFeatures.cpp b/Source/core/dom/ContextFeatures.cpp
index addc94a..d8bb039 100644
--- a/Source/core/dom/ContextFeatures.cpp
+++ b/Source/core/dom/ContextFeatures.cpp
@@ -45,7 +45,11 @@
 
 ContextFeatures* ContextFeatures::defaultSwitch()
 {
+#if ENABLE(OILPAN)
+    DEFINE_STATIC_LOCAL(Persistent<ContextFeatures>, instance, (ContextFeatures::create(ContextFeaturesClient::empty())));
+#else
     DEFINE_STATIC_REF(ContextFeatures, instance, (ContextFeatures::create(ContextFeaturesClient::empty())));
+#endif
     return instance;
 }
 
diff --git a/Source/core/dom/ContextFeatures.h b/Source/core/dom/ContextFeatures.h
index 2d22444..2280686 100644
--- a/Source/core/dom/ContextFeatures.h
+++ b/Source/core/dom/ContextFeatures.h
@@ -36,8 +36,8 @@
 class Page;
 
 #if ENABLE(OILPAN)
-class ContextFeatures FINAL : public RefCountedGarbageCollected<ContextFeatures>, public HeapSupplement<Page> {
-    WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(ContextFeatures);
+class ContextFeatures FINAL : public GarbageCollectedFinalized<ContextFeatures>, public HeapSupplement<Page> {
+    USING_GARBAGE_COLLECTED_MIXIN(ContextFeatures);
 public:
     typedef HeapSupplement<Page> SupplementType;
 #else
@@ -68,7 +68,7 @@
     void urlDidChange(Document*);
 
 #if ENABLE(OILPAN)
-    virtual void trace(Visitor*) OVERRIDE { }
+    virtual void trace(Visitor* visitor) OVERRIDE { HeapSupplement<Page>::trace(visitor); }
 #endif
 
 private:
@@ -94,7 +94,7 @@
 
 inline PassRefPtrWillBeRawPtr<ContextFeatures> ContextFeatures::create(PassOwnPtr<ContextFeaturesClient> client)
 {
-    return adoptRefWillBeRefCountedGarbageCollected(new ContextFeatures(client));
+    return adoptRefWillBeNoop(new ContextFeatures(client));
 }
 
 inline bool ContextFeatures::isEnabled(Document* document, FeatureType type, bool defaultValue) const
diff --git a/Source/core/dom/DOMException.cpp b/Source/core/dom/DOMException.cpp
index 5db0d35..5c63ee0 100644
--- a/Source/core/dom/DOMException.cpp
+++ b/Source/core/dom/DOMException.cpp
@@ -76,6 +76,9 @@
 
     // SQL
     { "DatabaseError", "The operation failed for some reason related to the database.", 0 },
+
+    // Web Crypto
+    { "OperationError", "The operation failed for an operation-specific reason", 0 },
 };
 
 static const CoreException* getErrorEntry(ExceptionCode ec)
diff --git a/Source/core/dom/DOMImplementation.cpp b/Source/core/dom/DOMImplementation.cpp
index c3e1784..aaf449b 100644
--- a/Source/core/dom/DOMImplementation.cpp
+++ b/Source/core/dom/DOMImplementation.cpp
@@ -49,7 +49,6 @@
 #include "core/html/TextDocument.h"
 #include "core/loader/FrameLoader.h"
 #include "core/page/Page.h"
-#include "core/svg/SVGDocument.h"
 #include "platform/ContentType.h"
 #include "platform/MIMETypeRegistry.h"
 #include "platform/graphics/Image.h"
@@ -195,26 +194,24 @@
     if (!Document::parseQualifiedName(qualifiedName, prefix, localName, exceptionState))
         return nullptr;
 
-    return DocumentType::create(&m_document, qualifiedName, publicId, systemId);
+    return DocumentType::create(m_document, qualifiedName, publicId, systemId);
 }
 
 PassRefPtr<XMLDocument> DOMImplementation::createDocument(const AtomicString& namespaceURI,
     const AtomicString& qualifiedName, DocumentType* doctype, ExceptionState& exceptionState)
 {
     RefPtr<XMLDocument> doc;
-    DocumentInit init = DocumentInit::fromContext(m_document.contextDocument());
+    DocumentInit init = DocumentInit::fromContext(document().contextDocument());
     if (namespaceURI == SVGNames::svgNamespaceURI) {
-        // FIXME: This should be an XMLDocument as per DOM4 but we need to get rid of SVGDocument first.
-        // SVGDocument no longer exists in SVG2.
-        doc = SVGDocument::create(init);
+        doc = XMLDocument::createSVG(init);
     } else if (namespaceURI == HTMLNames::xhtmlNamespaceURI) {
-        doc = XMLDocument::createXHTML(init.withRegistrationContext(m_document.registrationContext()));
+        doc = XMLDocument::createXHTML(init.withRegistrationContext(document().registrationContext()));
     } else {
         doc = XMLDocument::create(init);
     }
 
-    doc->setSecurityOrigin(m_document.securityOrigin()->isolatedCopy());
-    doc->setContextFeatures(m_document.contextFeatures());
+    doc->setSecurityOrigin(document().securityOrigin()->isolatedCopy());
+    doc->setContextFeatures(document().contextFeatures());
 
     RefPtr<Node> documentElement;
     if (!qualifiedName.isEmpty()) {
@@ -323,15 +320,15 @@
 
 PassRefPtr<HTMLDocument> DOMImplementation::createHTMLDocument(const String& title)
 {
-    DocumentInit init = DocumentInit::fromContext(m_document.contextDocument())
-        .withRegistrationContext(m_document.registrationContext());
+    DocumentInit init = DocumentInit::fromContext(document().contextDocument())
+        .withRegistrationContext(document().registrationContext());
     RefPtr<HTMLDocument> d = HTMLDocument::create(init);
     d->open();
     d->write("<!doctype html><html><body></body></html>");
     if (!title.isNull())
         d->setTitle(title);
-    d->setSecurityOrigin(m_document.securityOrigin()->isolatedCopy());
-    d->setContextFeatures(m_document.contextFeatures());
+    d->setSecurityOrigin(document().securityOrigin()->isolatedCopy());
+    d->setContextFeatures(document().contextFeatures());
     return d.release();
 }
 
@@ -374,11 +371,16 @@
     if (isTextMIMEType(type))
         return TextDocument::create(init);
     if (type == "image/svg+xml")
-        return SVGDocument::create(init);
+        return XMLDocument::createSVG(init);
     if (isXMLMIMEType(type))
         return XMLDocument::create(init);
 
     return HTMLDocument::create(init);
 }
 
+void DOMImplementation::trace(Visitor* visitor)
+{
+    visitor->trace(m_document);
+}
+
 }
diff --git a/Source/core/dom/DOMImplementation.h b/Source/core/dom/DOMImplementation.h
index f954c8f..faa1874 100644
--- a/Source/core/dom/DOMImplementation.h
+++ b/Source/core/dom/DOMImplementation.h
@@ -40,14 +40,19 @@
 class KURL;
 class XMLDocument;
 
-class DOMImplementation : public ScriptWrappable {
-    WTF_MAKE_FAST_ALLOCATED;
+class DOMImplementation FINAL : public NoBaseWillBeGarbageCollectedFinalized<DOMImplementation>, public ScriptWrappable {
+    WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED;
 public:
-    static PassOwnPtr<DOMImplementation> create(Document& document) { return adoptPtr(new DOMImplementation(document)); }
+    static PassOwnPtrWillBeRawPtr<DOMImplementation> create(Document& document)
+    {
+        return adoptPtrWillBeNoop(new DOMImplementation(document));
+    }
 
-    void ref() { m_document.ref(); }
-    void deref() { m_document.deref(); }
-    Document& document() const { return m_document; }
+#if !ENABLE(OILPAN)
+    void ref() { m_document->ref(); }
+    void deref() { m_document->deref(); }
+#endif
+    Document& document() const { return *m_document; }
 
     // DOM methods & attributes for DOMImplementation
     static bool hasFeature(const String& feature, const String& version);
@@ -66,10 +71,12 @@
     static bool isTextMIMEType(const String&);
     static bool isJSONMIMEType(const String&);
 
+    void trace(Visitor*);
+
 private:
     explicit DOMImplementation(Document&);
 
-    Document& m_document;
+    RawPtrWillBeMember<Document> m_document;
 };
 
 } // namespace WebCore
diff --git a/Source/core/dom/DOMImplementation.idl b/Source/core/dom/DOMImplementation.idl
index 46f087a..33b3286 100644
--- a/Source/core/dom/DOMImplementation.idl
+++ b/Source/core/dom/DOMImplementation.idl
@@ -20,6 +20,7 @@
 
 [
     SetWrapperReferenceFrom=document,
+    WillBeGarbageCollected,
 ] interface DOMImplementation {
 
     // DOM Level 1
diff --git a/Source/core/dom/DOMSettableTokenList.h b/Source/core/dom/DOMSettableTokenList.h
index 2a59e85..bba9691 100644
--- a/Source/core/dom/DOMSettableTokenList.h
+++ b/Source/core/dom/DOMSettableTokenList.h
@@ -27,6 +27,7 @@
 
 #include "core/dom/DOMTokenList.h"
 #include "core/dom/SpaceSplitString.h"
+#include "platform/heap/Handle.h"
 #include "wtf/RefCounted.h"
 #include "wtf/text/AtomicString.h"
 
@@ -34,17 +35,24 @@
 
 class ExceptionState;
 
-class DOMSettableTokenList FINAL : public DOMTokenList, public RefCounted<DOMSettableTokenList> {
-    WTF_MAKE_FAST_ALLOCATED;
-public:
-    static PassRefPtr<DOMSettableTokenList> create()
+class DOMSettableTokenList FINAL
+    : public DOMTokenList
+#if !ENABLE(OILPAN)
+    , public RefCounted<DOMSettableTokenList>
+#endif
     {
-        return adoptRef(new DOMSettableTokenList());
+    WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED;
+public:
+    static PassRefPtrWillBeRawPtr<DOMSettableTokenList> create()
+    {
+        return adoptRefWillBeNoop(new DOMSettableTokenList());
     }
     virtual ~DOMSettableTokenList();
 
+#if !ENABLE(OILPAN)
     virtual void ref() OVERRIDE { RefCounted<DOMSettableTokenList>::ref(); }
     virtual void deref() OVERRIDE { RefCounted<DOMSettableTokenList>::deref(); }
+#endif
 
     virtual unsigned length() const OVERRIDE { return m_tokens.size(); }
     virtual const AtomicString item(unsigned index) const OVERRIDE;
diff --git a/Source/core/dom/DOMStringList.h b/Source/core/dom/DOMStringList.h
index 44de344..dd605cd 100644
--- a/Source/core/dom/DOMStringList.h
+++ b/Source/core/dom/DOMStringList.h
@@ -27,6 +27,7 @@
 #define DOMStringList_h
 
 #include "bindings/v8/ScriptWrappable.h"
+#include "platform/heap/Handle.h"
 #include "wtf/PassRefPtr.h"
 #include "wtf/RefCounted.h"
 #include "wtf/Vector.h"
@@ -36,11 +37,11 @@
 
 // FIXME: Some consumers of this class may benefit from lazily fetching items rather
 //        than creating the list statically as is currently the only option.
-class DOMStringList : public ScriptWrappable, public RefCounted<DOMStringList> {
+class DOMStringList FINAL : public RefCountedWillBeGarbageCollectedFinalized<DOMStringList>, public ScriptWrappable {
 public:
-    static PassRefPtr<DOMStringList> create()
+    static PassRefPtrWillBeRawPtr<DOMStringList> create()
     {
-        return adoptRef(new DOMStringList());
+        return adoptRefWillBeNoop(new DOMStringList());
     }
 
     bool isEmpty() const { return m_strings.isEmpty(); }
@@ -55,6 +56,8 @@
 
     operator const Vector<String>&() const { return m_strings; }
 
+    void trace(Visitor*) { }
+
 private:
     DOMStringList()
     {
diff --git a/Source/core/dom/DOMStringList.idl b/Source/core/dom/DOMStringList.idl
index 06e7f3e..8a57087 100644
--- a/Source/core/dom/DOMStringList.idl
+++ b/Source/core/dom/DOMStringList.idl
@@ -24,6 +24,7 @@
  */
 
 [
+    WillBeGarbageCollected,
 ] interface DOMStringList {
     readonly attribute unsigned long length;
     [TreatReturnedNullStringAs=Null] getter DOMString item([Default=Undefined] optional unsigned long index);
diff --git a/Source/core/dom/DOMStringMap.h b/Source/core/dom/DOMStringMap.h
index fb4d17b..8309579 100644
--- a/Source/core/dom/DOMStringMap.h
+++ b/Source/core/dom/DOMStringMap.h
@@ -29,6 +29,7 @@
 #include "bindings/v8/ExceptionState.h"
 #include "bindings/v8/ScriptWrappable.h"
 #include "bindings/v8/V8Binding.h"
+#include "platform/heap/Handle.h"
 #include "wtf/Noncopyable.h"
 #include "wtf/Vector.h"
 #include "wtf/text/WTFString.h"
@@ -37,13 +38,16 @@
 
 class Element;
 
-class DOMStringMap : public ScriptWrappable {
-    WTF_MAKE_NONCOPYABLE(DOMStringMap); WTF_MAKE_FAST_ALLOCATED;
+class DOMStringMap : public NoBaseWillBeGarbageCollectedFinalized<DOMStringMap>, public ScriptWrappable {
+    WTF_MAKE_NONCOPYABLE(DOMStringMap);
+    WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED;
 public:
     virtual ~DOMStringMap();
 
+#if !ENABLE(OILPAN)
     virtual void ref() = 0;
     virtual void deref() = 0;
+#endif
 
     virtual void getNames(Vector<String>&) = 0;
     virtual String item(const String& name) = 0;
@@ -81,6 +85,8 @@
 
     virtual Element* element() = 0;
 
+    virtual void trace(Visitor*) { }
+
 protected:
     DOMStringMap()
     {
diff --git a/Source/core/dom/DOMStringMap.idl b/Source/core/dom/DOMStringMap.idl
index b3590a9..c8c7d15 100644
--- a/Source/core/dom/DOMStringMap.idl
+++ b/Source/core/dom/DOMStringMap.idl
@@ -26,6 +26,7 @@
 [
     OverrideBuiltins,
     SetWrapperReferenceFrom=element,
+    WillBeGarbageCollected,
 ] interface DOMStringMap {
     [NotEnumerable] getter DOMString (unsigned long index);
     [RaisesException] setter DOMString (unsigned long index, DOMString value);
diff --git a/Source/core/dom/DOMTokenList.h b/Source/core/dom/DOMTokenList.h
index bd5204e..1ab1b7c 100644
--- a/Source/core/dom/DOMTokenList.h
+++ b/Source/core/dom/DOMTokenList.h
@@ -26,6 +26,7 @@
 #define DOMTokenList_h
 
 #include "bindings/v8/ScriptWrappable.h"
+#include "platform/heap/Handle.h"
 #include "wtf/Vector.h"
 #include "wtf/text/AtomicString.h"
 
@@ -34,17 +35,20 @@
 class Element;
 class ExceptionState;
 
-class DOMTokenList : public ScriptWrappable {
-    WTF_MAKE_NONCOPYABLE(DOMTokenList); WTF_MAKE_FAST_ALLOCATED;
+class DOMTokenList : public NoBaseWillBeGarbageCollectedFinalized<DOMTokenList>, public ScriptWrappable {
+    WTF_MAKE_NONCOPYABLE(DOMTokenList);
+    WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED;
 public:
     DOMTokenList()
     {
         ScriptWrappable::init(this);
     }
-    virtual ~DOMTokenList() { };
+    virtual ~DOMTokenList() { }
 
+#if !ENABLE(OILPAN)
     virtual void ref() = 0;
     virtual void deref() = 0;
+#endif
 
     virtual unsigned length() const = 0;
     virtual const AtomicString item(unsigned index) const = 0;
@@ -61,6 +65,8 @@
 
     virtual Element* element() { return 0; }
 
+    virtual void trace(Visitor*) { }
+
 protected:
     virtual const AtomicString& value() const = 0;
     virtual void setValue(const AtomicString&) = 0;
diff --git a/Source/core/dom/DOMTokenList.idl b/Source/core/dom/DOMTokenList.idl
index 6072629..98d51cf 100644
--- a/Source/core/dom/DOMTokenList.idl
+++ b/Source/core/dom/DOMTokenList.idl
@@ -24,6 +24,7 @@
 
 [
     SetWrapperReferenceFrom=element,
+    WillBeGarbageCollected,
 ] interface DOMTokenList {
     readonly attribute unsigned long length;
     [TreatReturnedNullStringAs=Null] getter DOMString item(unsigned long index);
diff --git a/Source/core/dom/DatasetDOMStringMap.cpp b/Source/core/dom/DatasetDOMStringMap.cpp
index 8690449..adf09b1 100644
--- a/Source/core/dom/DatasetDOMStringMap.cpp
+++ b/Source/core/dom/DatasetDOMStringMap.cpp
@@ -140,6 +140,7 @@
     return builder.toAtomicString();
 }
 
+#if !ENABLE(OILPAN)
 void DatasetDOMStringMap::ref()
 {
     m_element->ref();
@@ -149,6 +150,7 @@
 {
     m_element->deref();
 }
+#endif
 
 void DatasetDOMStringMap::getNames(Vector<String>& names)
 {
@@ -215,4 +217,10 @@
     return false;
 }
 
+void DatasetDOMStringMap::trace(Visitor* visitor)
+{
+    visitor->trace(m_element);
+    DOMStringMap::trace(visitor);
+}
+
 } // namespace WebCore
diff --git a/Source/core/dom/DatasetDOMStringMap.h b/Source/core/dom/DatasetDOMStringMap.h
index 9d2220f..dc31f53 100644
--- a/Source/core/dom/DatasetDOMStringMap.h
+++ b/Source/core/dom/DatasetDOMStringMap.h
@@ -36,13 +36,15 @@
 
 class DatasetDOMStringMap FINAL : public DOMStringMap {
 public:
-    static PassOwnPtr<DatasetDOMStringMap> create(Element* element)
+    static PassOwnPtrWillBeRawPtr<DatasetDOMStringMap> create(Element* element)
     {
-        return adoptPtr(new DatasetDOMStringMap(element));
+        return adoptPtrWillBeNoop(new DatasetDOMStringMap(element));
     }
 
+#if !ENABLE(OILPAN)
     virtual void ref() OVERRIDE;
     virtual void deref() OVERRIDE;
+#endif
 
     virtual void getNames(Vector<String>&) OVERRIDE;
     virtual String item(const String& name) OVERRIDE;
@@ -52,13 +54,15 @@
 
     virtual Element* element() OVERRIDE { return m_element; }
 
+    virtual void trace(Visitor*) OVERRIDE;
+
 private:
     explicit DatasetDOMStringMap(Element* element)
         : m_element(element)
     {
     }
 
-    Element* m_element;
+    RawPtrWillBeMember<Element> m_element;
 };
 
 } // namespace WebCore
diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp
index 86fedec..4b89020 100644
--- a/Source/core/dom/Document.cpp
+++ b/Source/core/dom/Document.cpp
@@ -42,7 +42,6 @@
 #include "bindings/v8/ExceptionStatePlaceholder.h"
 #include "bindings/v8/ScriptController.h"
 #include "core/accessibility/AXObjectCache.h"
-#include "core/animation/AnimationClock.h"
 #include "core/animation/DocumentAnimations.h"
 #include "core/animation/DocumentTimeline.h"
 #include "core/animation/css/TransitionTimeline.h"
@@ -71,7 +70,6 @@
 #include "core/dom/Element.h"
 #include "core/dom/ElementDataCache.h"
 #include "core/dom/ElementTraversal.h"
-#include "core/dom/EventHandlerRegistry.h"
 #include "core/dom/ExceptionCode.h"
 #include "core/dom/ExecutionContextTask.h"
 #include "core/dom/MainThreadTaskRunner.h"
@@ -477,10 +475,9 @@
 #ifndef NDEBUG
     , m_didDispatchViewportPropertiesChanged(false)
 #endif
-    , m_animationClock(AnimationClock::create())
     , m_timeline(DocumentTimeline::create(this))
     , m_transitionTimeline(TransitionTimeline::create(this))
-    , m_templateDocumentHost(0)
+    , m_templateDocumentHost(nullptr)
     , m_didAssociateFormControlsTimer(this, &Document::didAssociateFormControlsTimerFired)
     , m_hasViewportUnits(false)
     , m_styleRecalcElementCounter(0)
@@ -535,14 +532,20 @@
     // When they die in the same GC round, the list of visibility observers
     // will not be empty on Document destruction.
     ASSERT(m_visibilityObservers.isEmpty());
-#endif
 
     if (m_templateDocument)
-        m_templateDocument->m_templateDocumentHost = 0; // balanced in ensureTemplateDocument().
+        m_templateDocument->m_templateDocumentHost = nullptr; // balanced in ensureTemplateDocument().
+#endif
 
     m_scriptRunner.clear();
 
+    // FIXME: Oilpan: Not removing event listeners here also means that we do
+    // not notify the inspector instrumentation that the event listeners are
+    // gone. The Document and all the nodes in the document are gone, so maybe
+    // that is OK?
+#if !ENABLE(OILPAN)
     removeAllEventListenersRecursively();
+#endif
 
     // Currently we believe that Document can never outlive the parser.
     // Although the Document may be replaced synchronously, DocumentParsers
@@ -569,25 +572,27 @@
     m_timeline->detachFromDocument();
     m_transitionTimeline->detachFromDocument();
 
+#if !ENABLE(OILPAN)
     // We need to destroy CSSFontSelector before destroying m_fetcher.
     if (m_styleEngine)
         m_styleEngine->detachFromDocument();
 
-#if !ENABLE(OILPAN)
     if (m_elemSheet)
         m_elemSheet->clearOwnerNode();
-#endif
 
     // It's possible for multiple Documents to end up referencing the same ResourceFetcher (e.g., SVGImages
     // load the initial empty document and the SVGDocument with the same DocumentLoader).
     if (m_fetcher->document() == this)
-        m_fetcher->setDocument(0);
+        m_fetcher->setDocument(nullptr);
     m_fetcher.clear();
+#endif
 
     // We must call clearRareData() here since a Document class inherits TreeScope
     // as well as Node. See a comment on TreeScope.h for the reason.
+#if !ENABLE(OILPAN)
     if (hasRareData())
         clearRareData();
+#endif
 
     ASSERT(!m_listsInvalidatedAtDocument.size());
 
@@ -601,7 +606,9 @@
 
 void Document::dispose()
 {
+#if !ENABLE(OILPAN)
     ASSERT_WITH_SECURITY_IMPLICATION(!m_deletionHasBegun);
+
     // We must make sure not to be retaining any of our children through
     // these extra pointers or we will create a reference cycle.
     m_docType = nullptr;
@@ -615,6 +622,7 @@
     m_associatedFormControls.clear();
 
     detachParser();
+#endif
 
     m_registrationContext.clear();
 
@@ -623,16 +631,20 @@
         m_importsController = 0;
     }
 
+#if !ENABLE(OILPAN)
     // removeDetachedChildren() doesn't always unregister IDs,
     // so tear down scope information upfront to avoid having stale references in the map.
     destroyTreeScopeData();
+
     removeDetachedChildren();
+
     // removeDetachedChildren() can access FormController.
     m_formController.clear();
 
     m_markers->clear();
 
     m_cssCanvasElements.clear();
+#endif
 
     // FIXME: consider using ActiveDOMObject.
     if (m_scriptedAnimationController)
@@ -1363,7 +1375,7 @@
     else if (!m_titleElement) {
         if (HTMLElement* headElement = head()) {
             m_titleElement = HTMLTitleElement::create(*this);
-            headElement->appendChild(m_titleElement);
+            headElement->appendChild(m_titleElement.get());
         }
     }
 
@@ -1638,6 +1650,7 @@
     m_lifecycle.ensureStateAtMost(DocumentLifecycle::VisualUpdatePending);
 
     TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "ScheduleStyleRecalculation", "frame", frame());
+    TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline.stack"), "CallStack", "stack", InspectorCallStackEvent::currentCallStack());
     // FIXME(361045): remove InspectorInstrumentation calls once DevTools Timeline migrates to tracing.
     InspectorInstrumentation::didScheduleStyleRecalculation(this);
 }
@@ -1811,6 +1824,7 @@
 
     m_styleRecalcElementCounter = 0;
     TRACE_EVENT_BEGIN1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "RecalculateStyles", "frame", frame());
+    TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline.stack"), "CallStack", "stack", InspectorCallStackEvent::currentCallStack());
     // FIXME(361045): remove InspectorInstrumentation calls once DevTools Timeline migrates to tracing.
     InspectorInstrumentationCookie cookie = InspectorInstrumentation::willRecalculateStyle(this);
 
@@ -1848,6 +1862,10 @@
     if (svgExtensions())
         accessSVGExtensions().removePendingSVGFontFaceElementsForRemoval();
 #endif
+
+    ASSERT(!m_timeline->hasOutdatedAnimationPlayer());
+    ASSERT(!m_transitionTimeline->hasOutdatedAnimationPlayer());
+
     TRACE_EVENT_END1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "RecalculateStyles", "elementCount", m_styleRecalcElementCounter);
     // FIXME(361045): remove InspectorInstrumentation calls once DevTools Timeline migrates to tracing.
     InspectorInstrumentation::didRecalculateStyle(cookie, m_styleRecalcElementCounter);
@@ -2227,6 +2245,15 @@
 
     lifecycleNotifier().notifyDocumentWasDetached();
     m_lifecycle.advanceTo(DocumentLifecycle::Stopped);
+#if ENABLE(OILPAN)
+    // FIXME: Oilpan: With Oilpan dispose should not be needed. At
+    // this point we still have dispose in order to clear out some
+    // RefPtrs that would otherwise cause leaks. However, when the
+    // Document is detached the document can still be alive, so we
+    // really shouldn't clear anything at this point. It should just
+    // die with the document when the document is no longer reachable.
+    dispose();
+#endif
 }
 
 void Document::prepareForDestruction()
@@ -2969,7 +2996,8 @@
 {
     if (!haveStylesheetsLoaded())
         return;
-
+    if (!importLoader())
+        styleResolverMayHaveChanged();
     didLoadAllScriptBlockingResources();
 }
 
@@ -2977,14 +3005,13 @@
 {
     m_needsNotifyRemoveAllPendingStylesheet = false;
 
-    styleResolverChanged(RecalcStyleDeferred, hasNodesWithPlaceholderStyle() ? FullStyleUpdate : AnalyzedStyleUpdate);
+    styleResolverMayHaveChanged();
 
+    // Only imports on master documents can trigger rendering.
     if (HTMLImportLoader* import = importLoader())
         import->didRemoveAllPendingStylesheet();
-
     if (!haveImportsLoaded())
         return;
-
     didLoadAllScriptBlockingResources();
 }
 
@@ -3437,6 +3464,11 @@
         updateRenderTreeIfNeeded();
 }
 
+void Document::styleResolverMayHaveChanged()
+{
+    styleResolverChanged(RecalcStyleDeferred, hasNodesWithPlaceholderStyle() ? FullStyleUpdate : AnalyzedStyleUpdate);
+}
+
 void Document::setHoverNode(PassRefPtr<Node> newHoverNode)
 {
     m_hoverNode = newHoverNode;
@@ -3530,7 +3562,7 @@
         return true;
 
     bool focusChangeBlocked = false;
-    RefPtr<Element> oldFocusedElement = m_focusedElement;
+    RefPtrWillBeRawPtr<Element> oldFocusedElement = m_focusedElement;
     m_focusedElement = nullptr;
 
     // Remove focus from the existing focus node (if any)
@@ -3862,18 +3894,6 @@
     return nullptr;
 }
 
-PassRefPtrWillBeRawPtr<Event> Document::createEvent(ExceptionState& exceptionState)
-{
-    if (!isSVGDocument()) {
-        exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, 0));
-        return nullptr;
-    }
-
-    UseCounter::count(this, UseCounter::DocumentCreateEventOptionalArgument);
-    // Legacy SVGDocument behavior.
-    return createEvent("undefined", exceptionState);
-}
-
 void Document::addMutationEventListenerTypeIfEnabled(ListenerType listenerType)
 {
     if (ContextFeatures::mutationEventsEnabled(this))
@@ -4584,7 +4604,7 @@
         // adding extra latency. Note that the first render tree update can be expensive since it
         // triggers the parsing of the default stylesheets which are compiled-in.
         const bool mainResourceWasAlreadyRequested =
-            m_frame->loader().stateMachine()->startedFirstRealLoad();
+            m_frame->loader().stateMachine()->committedFirstRealDocumentLoad();
 
         // FrameLoader::finishedParsing() might end up calling Document::implicitClose() if all
         // resource loads are complete. HTMLObjectElements can start loading their resources from
@@ -4883,7 +4903,7 @@
 
 HTMLCanvasElement& Document::getCSSCanvasElement(const String& name)
 {
-    RefPtr<HTMLCanvasElement>& element = m_cssCanvasElements.add(name, nullptr).storedValue->value;
+    RefPtrWillBeMember<HTMLCanvasElement>& element = m_cssCanvasElements.add(name, nullptr).storedValue->value;
     if (!element) {
         element = HTMLCanvasElement::create(*this);
         element->setAccelerationDisabled(true);
@@ -5309,7 +5329,7 @@
 
 void Document::setContextFeatures(ContextFeatures& features)
 {
-    m_contextFeatures = PassRefPtr<ContextFeatures>(features);
+    m_contextFeatures = PassRefPtrWillBeRawPtr<ContextFeatures>(features);
 }
 
 static RenderObject* nearestCommonHoverAncestor(RenderObject* obj1, RenderObject* obj2)
@@ -5668,9 +5688,30 @@
 
 void Document::trace(Visitor* visitor)
 {
+    visitor->trace(m_docType);
+    visitor->trace(m_implementation);
+    visitor->trace(m_autofocusElement);
+    visitor->trace(m_focusedElement);
+    visitor->trace(m_hoverNode);
+    visitor->trace(m_activeHoverElement);
+    visitor->trace(m_documentElement);
+    visitor->trace(m_titleElement);
+    visitor->trace(m_currentScriptStack);
+    visitor->trace(m_transformSourceDocument);
+    visitor->trace(m_cssCanvasElements);
+    visitor->trace(m_topLayerElements);
+    visitor->trace(m_elemSheet);
+    visitor->trace(m_styleEngine);
+    visitor->trace(m_formController);
+    visitor->trace(m_fetcher);
+    visitor->trace(m_contextFeatures);
     visitor->trace(m_styleSheetList);
     visitor->trace(m_mediaQueryMatcher);
+    visitor->trace(m_associatedFormControls);
+    visitor->trace(m_templateDocument);
+    visitor->trace(m_templateDocumentHost);
     visitor->trace(m_visibilityObservers);
+    visitor->trace(m_userActionElements);
     visitor->registerWeakMembers<Document, &Document::clearWeakMembers>(this);
     DocumentSupplementable::trace(visitor);
     TreeScope::trace(visitor);
diff --git a/Source/core/dom/Document.h b/Source/core/dom/Document.h
index 5131c76..ef6c24a 100644
--- a/Source/core/dom/Document.h
+++ b/Source/core/dom/Document.h
@@ -30,6 +30,7 @@
 
 #include "bindings/v8/ExceptionStatePlaceholder.h"
 #include "bindings/v8/ScriptValue.h"
+#include "core/animation/AnimationClock.h"
 #include "core/animation/CompositorPendingAnimations.h"
 #include "core/dom/ContainerNode.h"
 #include "core/dom/DocumentEncodingData.h"
@@ -64,7 +65,6 @@
 namespace WebCore {
 
 class AXObjectCache;
-class AnimationClock;
 class Attr;
 class CDATASection;
 class CSSFontSelector;
@@ -270,6 +270,8 @@
     DEFINE_ATTRIBUTE_EVENT_LISTENER(copy);
     DEFINE_ATTRIBUTE_EVENT_LISTENER(cut);
     DEFINE_ATTRIBUTE_EVENT_LISTENER(paste);
+    DEFINE_ATTRIBUTE_EVENT_LISTENER(pointerlockchange);
+    DEFINE_ATTRIBUTE_EVENT_LISTENER(pointerlockerror);
     DEFINE_ATTRIBUTE_EVENT_LISTENER(readystatechange);
     DEFINE_ATTRIBUTE_EVENT_LISTENER(search);
     DEFINE_ATTRIBUTE_EVENT_LISTENER(securitypolicyviolation);
@@ -440,6 +442,7 @@
 
     // Called when one or more stylesheets in the document may have been added, removed, or changed.
     void styleResolverChanged(RecalcStyleTime, StyleResolverUpdateMode = FullStyleUpdate);
+    void styleResolverMayHaveChanged();
 
     // FIXME: Switch all callers of styleResolverChanged to these or better ones and then make them
     // do something smarter.
@@ -690,7 +693,6 @@
     EventListener* getWindowAttributeEventListener(const AtomicString& eventType);
 
     PassRefPtrWillBeRawPtr<Event> createEvent(const String& eventType, ExceptionState&);
-    PassRefPtrWillBeRawPtr<Event> createEvent(ExceptionState&);
 
     // keep track of what types of event listeners are registered, so we don't
     // dispatch events unnecessarily
@@ -835,7 +837,7 @@
     void popCurrentScript();
 
     void applyXSLTransform(ProcessingInstruction* pi);
-    PassRefPtr<Document> transformSourceDocument() { return m_transformSourceDocument; }
+    PassRefPtrWillBeRawPtr<Document> transformSourceDocument() { return m_transformSourceDocument; }
     void setTransformSourceDocument(Document* doc) { m_transformSourceDocument = doc; }
 
     void setTransformSource(PassOwnPtr<TransformSource>);
@@ -1020,14 +1022,14 @@
     // Return a Locale for the default locale if the argument is null or empty.
     Locale& getCachedLocale(const AtomicString& locale = nullAtom);
 
-    AnimationClock& animationClock() { return *m_animationClock; }
+    AnimationClock& animationClock() { return m_animationClock; }
     DocumentTimeline& timeline() const { return *m_timeline; }
     DocumentTimeline& transitionTimeline() const { return *m_transitionTimeline; }
     CompositorPendingAnimations& compositorPendingAnimations() { return m_compositorPendingAnimations; }
 
     void addToTopLayer(Element*, const Element* before = 0);
     void removeFromTopLayer(Element*);
-    const Vector<RefPtr<Element> >& topLayerElements() const { return m_topLayerElements; }
+    const WillBeHeapVector<RefPtrWillBeMember<Element> >& topLayerElements() const { return m_topLayerElements; }
     HTMLDialogElement* activeModalDialog() const;
 
     // A non-null m_templateDocumentHost implies that |this| was created by ensureTemplateDocument().
@@ -1046,6 +1048,7 @@
     DocumentLifecycle& lifecycle() { return m_lifecycle; }
     bool isActive() const { return m_lifecycle.isActive(); }
     bool isStopped() const { return m_lifecycle.state() == DocumentLifecycle::Stopped; }
+    bool isDisposed() const { return m_lifecycle.state() == DocumentLifecycle::Disposed; }
 
     enum HttpRefreshType {
         HttpRefreshFromHeader,
@@ -1190,10 +1193,10 @@
     DOMWindow* m_domWindow;
     HTMLImportsController* m_importsController;
 
-    RefPtr<ResourceFetcher> m_fetcher;
+    RefPtrWillBeMember<ResourceFetcher> m_fetcher;
     RefPtr<DocumentParser> m_parser;
     unsigned m_activeParserCount;
-    RefPtr<ContextFeatures> m_contextFeatures;
+    RefPtrWillBeMember<ContextFeatures> m_contextFeatures;
 
     bool m_wellFormed;
 
@@ -1209,10 +1212,10 @@
     // Mime-type of the document in case it was cloned or created by XHR.
     AtomicString m_mimeType;
 
-    RefPtr<DocumentType> m_docType;
-    OwnPtr<DOMImplementation> m_implementation;
+    RefPtrWillBeMember<DocumentType> m_docType;
+    OwnPtrWillBeMember<DOMImplementation> m_implementation;
 
-    RefPtrWillBePersistent<CSSStyleSheet> m_elemSheet;
+    RefPtrWillBeMember<CSSStyleSheet> m_elemSheet;
 
     bool m_printing;
     bool m_paginatedForScreen;
@@ -1222,11 +1225,11 @@
 
     bool m_hasAutofocused;
     Timer<Document> m_clearFocusedElementTimer;
-    RefPtr<Element> m_autofocusElement;
-    RefPtr<Element> m_focusedElement;
-    RefPtr<Node> m_hoverNode;
-    RefPtr<Element> m_activeHoverElement;
-    RefPtr<Element> m_documentElement;
+    RefPtrWillBeMember<Element> m_autofocusElement;
+    RefPtrWillBeMember<Element> m_focusedElement;
+    RefPtrWillBeMember<Node> m_hoverNode;
+    RefPtrWillBeMember<Element> m_activeHoverElement;
+    RefPtrWillBeMember<Element> m_documentElement;
     UserActionElementSet m_userActionElements;
 
     uint64_t m_domTreeVersion;
@@ -1239,10 +1242,10 @@
 
     MutationObserverOptions m_mutationObserverTypes;
 
-    OwnPtrWillBePersistent<StyleEngine> m_styleEngine;
+    OwnPtrWillBeMember<StyleEngine> m_styleEngine;
     RefPtrWillBeMember<StyleSheetList> m_styleSheetList;
 
-    OwnPtr<FormController> m_formController;
+    OwnPtrWillBeMember<FormController> m_formController;
 
     TextLinkColors m_textLinkColors;
     const OwnPtr<VisitedLinkState> m_visitedLinkState;
@@ -1264,7 +1267,7 @@
     String m_title;
     String m_rawTitle;
     bool m_titleSetExplicitly;
-    RefPtr<Element> m_titleElement;
+    RefPtrWillBeMember<Element> m_titleElement;
 
     OwnPtr<AXObjectCache> m_axObjectCache;
     OwnPtr<DocumentMarkerController> m_markers;
@@ -1279,10 +1282,10 @@
 
     OwnPtr<ScriptRunner> m_scriptRunner;
 
-    Vector<RefPtr<HTMLScriptElement> > m_currentScriptStack;
+    WillBeHeapVector<RefPtrWillBeMember<HTMLScriptElement> > m_currentScriptStack;
 
     OwnPtr<TransformSource> m_transformSource;
-    RefPtr<Document> m_transformSourceDocument;
+    RefPtrWillBeMember<Document> m_transformSourceDocument;
 
     String m_xmlEncoding;
     String m_xmlVersion;
@@ -1304,7 +1307,7 @@
     bool m_hasAnnotatedRegions;
     bool m_annotatedRegionsDirty;
 
-    HashMap<String, RefPtr<HTMLCanvasElement> > m_cssCanvasElements;
+    WillBeHeapHashMap<String, RefPtrWillBeMember<HTMLCanvasElement> > m_cssCanvasElements;
 
     OwnPtr<SelectorQueryCache> m_selectorQueryCache;
 
@@ -1319,12 +1322,13 @@
 
     RenderView* m_renderView;
 
+    // FIXME: Oilpan: We should use a real weak pointer here.
     WeakPtrFactory<Document> m_weakFactory;
     WeakPtr<Document> m_contextDocument;
 
     bool m_hasFullscreenElementStack; // For early return in FullscreenElementStack::fromIfExists()
 
-    Vector<RefPtr<Element> > m_topLayerElements;
+    WillBeHeapVector<RefPtrWillBeMember<Element> > m_topLayerElements;
 
     int m_loadEventDelayCount;
     Timer<Document> m_loadEventDelayTimer;
@@ -1365,16 +1369,19 @@
     typedef HashMap<AtomicString, OwnPtr<Locale> > LocaleIdentifierToLocaleMap;
     LocaleIdentifierToLocaleMap m_localeCache;
 
-    OwnPtr<AnimationClock> m_animationClock;
+    AnimationClock m_animationClock;
     RefPtr<DocumentTimeline> m_timeline;
     RefPtr<DocumentTimeline> m_transitionTimeline;
     CompositorPendingAnimations m_compositorPendingAnimations;
 
-    RefPtr<Document> m_templateDocument;
-    Document* m_templateDocumentHost; // Manually managed weakref (backpointer from m_templateDocument).
+    RefPtrWillBeMember<Document> m_templateDocument;
+    // With Oilpan the templateDocument and the templateDocumentHost
+    // live and die together. Without Oilpan, the templateDocumentHost
+    // is a manually managed backpointer from m_templateDocument.
+    RawPtrWillBeMember<Document> m_templateDocumentHost;
 
     Timer<Document> m_didAssociateFormControlsTimer;
-    HashSet<RefPtr<Element> > m_associatedFormControls;
+    WillBeHeapHashSet<RefPtrWillBeMember<Element> > m_associatedFormControls;
 
     HashSet<SVGUseElement*> m_useElementsNeedingUpdate;
     HashSet<Element*> m_layerUpdateElements;
diff --git a/Source/core/dom/Document.idl b/Source/core/dom/Document.idl
index 42513d2..bf48b53 100644
--- a/Source/core/dom/Document.idl
+++ b/Source/core/dom/Document.idl
@@ -63,7 +63,7 @@
 
     // DOM Level 2 Events (DocumentEvents interface)
 
-    [RaisesException] Event createEvent(optional DOMString eventType);
+    [RaisesException] Event createEvent(DOMString eventType);
 
     // DOM Level 2 Traversal and Range (DocumentRange interface)
 
@@ -140,6 +140,7 @@
 
     Element            elementFromPoint([Default=Undefined] optional long x,
                                         [Default=Undefined] optional long y);
+    [MeasureAs=DocumentCaretRangeFromPoint]
     Range              caretRangeFromPoint([Default=Undefined] optional long x,
                                            [Default=Undefined] optional long y);
 
@@ -152,7 +153,7 @@
     [TreatReturnedNullStringAs=Null] readonly attribute DOMString preferredStylesheetSet;
     [TreatReturnedNullStringAs=Null, TreatNullAs=NullString] attribute DOMString selectedStylesheetSet;
 
-    RenderingContext getCSSCanvasContext(DOMString contextId, DOMString name, long width, long height);
+    [MeasureAs=DocumentGetCSSCanvasContext] RenderingContext getCSSCanvasContext(DOMString contextId, DOMString name, long width, long height);
 
     // HTML 5
     HTMLCollection getElementsByClassName(DOMString classNames);
@@ -161,8 +162,8 @@
 
     readonly attribute DOMString compatMode;
 
-    void webkitExitPointerLock();
-    readonly attribute Element webkitPointerLockElement;
+    [MeasureAs=PrefixedDocumentExitPointerLock] void webkitExitPointerLock();
+    [MeasureAs=PrefixedDocumentPointerLockElement] readonly attribute Element webkitPointerLockElement;
 
     // Event handler attributes
     attribute EventHandler onbeforecopy;
@@ -171,6 +172,8 @@
     attribute EventHandler oncopy;
     attribute EventHandler oncut;
     attribute EventHandler onpaste;
+    attribute EventHandler onpointerlockchange;
+    attribute EventHandler onpointerlockerror;
     attribute EventHandler onreadystatechange;
     attribute EventHandler onsearch;
     [RuntimeEnabled=ExperimentalContentSecurityPolicyFeatures] attribute EventHandler onsecuritypolicyviolation;
diff --git a/Source/core/dom/DocumentLifecycle.h b/Source/core/dom/DocumentLifecycle.h
index dcc6a60..1869523 100644
--- a/Source/core/dom/DocumentLifecycle.h
+++ b/Source/core/dom/DocumentLifecycle.h
@@ -99,6 +99,7 @@
     State state() const { return m_state; }
 
     bool stateAllowsTreeMutations() const;
+    bool stateAllowsRenderTreeMutations() const;
 
     void advanceTo(State);
     void ensureStateAtMost(State);
@@ -121,6 +122,11 @@
         && m_state != InCompositingUpdate;
 }
 
+inline bool DocumentLifecycle::stateAllowsRenderTreeMutations() const
+{
+    return m_state == InStyleRecalc;
+}
+
 }
 
 #endif
diff --git a/Source/core/dom/DocumentStyleSheetCollector.cpp b/Source/core/dom/DocumentStyleSheetCollector.cpp
index a624b53..47818b9 100644
--- a/Source/core/dom/DocumentStyleSheetCollector.cpp
+++ b/Source/core/dom/DocumentStyleSheetCollector.cpp
@@ -33,7 +33,7 @@
 
 namespace WebCore {
 
-DocumentStyleSheetCollector::DocumentStyleSheetCollector(WillBeHeapVector<RefPtrWillBeMember<StyleSheet> >& sheetsForList, WillBeHeapVector<RefPtrWillBeMember<CSSStyleSheet> >& activeList, HashSet<Document*>& visitedDocuments)
+DocumentStyleSheetCollector::DocumentStyleSheetCollector(WillBeHeapVector<RefPtrWillBeMember<StyleSheet> >& sheetsForList, WillBeHeapVector<RefPtrWillBeMember<CSSStyleSheet> >& activeList, WillBeHeapHashSet<RawPtrWillBeMember<Document> >& visitedDocuments)
     : m_styleSheetsForStyleSheetList(sheetsForList)
     , m_activeAuthorStyleSheets(activeList)
     , m_visitedDocuments(visitedDocuments)
diff --git a/Source/core/dom/DocumentStyleSheetCollector.h b/Source/core/dom/DocumentStyleSheetCollector.h
index e4682e6..fd74c83 100644
--- a/Source/core/dom/DocumentStyleSheetCollector.h
+++ b/Source/core/dom/DocumentStyleSheetCollector.h
@@ -47,7 +47,7 @@
 public:
     friend class ImportedDocumentStyleSheetCollector;
 
-    DocumentStyleSheetCollector(WillBeHeapVector<RefPtrWillBeMember<StyleSheet> >& sheetsForList, WillBeHeapVector<RefPtrWillBeMember<CSSStyleSheet> >& activeList, HashSet<Document*>&);
+    DocumentStyleSheetCollector(WillBeHeapVector<RefPtrWillBeMember<StyleSheet> >& sheetsForList, WillBeHeapVector<RefPtrWillBeMember<CSSStyleSheet> >& activeList, WillBeHeapHashSet<RawPtrWillBeMember<Document> >&);
     ~DocumentStyleSheetCollector();
 
     void appendActiveStyleSheets(const WillBeHeapVector<RefPtrWillBeMember<CSSStyleSheet> >&);
@@ -60,14 +60,14 @@
 private:
     WillBeHeapVector<RefPtrWillBeMember<StyleSheet> >& m_styleSheetsForStyleSheetList;
     WillBeHeapVector<RefPtrWillBeMember<CSSStyleSheet> >& m_activeAuthorStyleSheets;
-    HashSet<Document*>& m_visitedDocuments;
+    WillBeHeapHashSet<RawPtrWillBeMember<Document> >& m_visitedDocuments;
 };
 
 class ActiveDocumentStyleSheetCollector FINAL : public DocumentStyleSheetCollector {
 public:
     ActiveDocumentStyleSheetCollector(StyleSheetCollection&);
 private:
-    HashSet<Document*> m_visitedDocuments;
+    WillBeHeapHashSet<RawPtrWillBeMember<Document> > m_visitedDocuments;
 };
 
 class ImportedDocumentStyleSheetCollector FINAL : public DocumentStyleSheetCollector {
diff --git a/Source/core/dom/Element.cpp b/Source/core/dom/Element.cpp
index 2bcfb67..6d034cd 100644
--- a/Source/core/dom/Element.cpp
+++ b/Source/core/dom/Element.cpp
@@ -97,6 +97,7 @@
 #include "core/page/PointerLockController.h"
 #include "core/rendering/RenderLayer.h"
 #include "core/rendering/RenderView.h"
+#include "core/rendering/compositing/RenderLayerCompositor.h"
 #include "core/svg/SVGDocumentExtensions.h"
 #include "core/svg/SVGElement.h"
 #include "platform/scroll/ScrollableArea.h"
@@ -167,11 +168,10 @@
 {
     ASSERT(needsAttach());
 
+#if !ENABLE(OILPAN)
     if (hasRareData())
         elementRareData()->clearShadow();
-
-    if (hasActiveAnimations())
-        activeAnimations()->dispose();
+#endif
 
     if (isCustomElement())
         CustomElement::wasDestroyed(this);
@@ -541,43 +541,43 @@
     return zoomFactor;
 }
 
-static int adjustForLocalZoom(LayoutUnit value, RenderObject& renderer)
+static double adjustForLocalZoom(LayoutUnit value, RenderObject& renderer)
 {
     float zoomFactor = localZoomForRenderer(renderer);
     if (zoomFactor == 1)
-        return value;
-    return lroundf(value / zoomFactor);
+        return value.toDouble();
+    return value.toDouble() / zoomFactor;
 }
 
-int Element::offsetLeft()
+double Element::offsetLeft()
 {
     document().updateLayoutIgnorePendingStylesheets();
     if (RenderBoxModelObject* renderer = renderBoxModelObject())
-        return adjustForLocalZoom(renderer->pixelSnappedOffsetLeft(), *renderer);
+        return adjustForLocalZoom(renderer->offsetLeft(), *renderer);
     return 0;
 }
 
-int Element::offsetTop()
+double Element::offsetTop()
 {
     document().updateLayoutIgnorePendingStylesheets();
     if (RenderBoxModelObject* renderer = renderBoxModelObject())
-        return adjustForLocalZoom(renderer->pixelSnappedOffsetTop(), *renderer);
+        return adjustForLocalZoom(renderer->offsetTop(), *renderer);
     return 0;
 }
 
-int Element::offsetWidth()
+double Element::offsetWidth()
 {
     document().updateLayoutIgnorePendingStylesheets();
     if (RenderBoxModelObject* renderer = renderBoxModelObject())
-        return adjustLayoutUnitForAbsoluteZoom(renderer->pixelSnappedOffsetWidth(), *renderer).round();
+        return adjustLayoutUnitForAbsoluteZoom(renderer->offsetWidth(), *renderer).toFloat();
     return 0;
 }
 
-int Element::offsetHeight()
+double Element::offsetHeight()
 {
     document().updateLayoutIgnorePendingStylesheets();
     if (RenderBoxModelObject* renderer = renderBoxModelObject())
-        return adjustLayoutUnitForAbsoluteZoom(renderer->pixelSnappedOffsetHeight(), *renderer).round();
+        return adjustLayoutUnitForAbsoluteZoom(renderer->offsetHeight(), *renderer).toFloat();
     return 0;
 }
 
@@ -597,25 +597,25 @@
     return 0;
 }
 
-int Element::clientLeft()
+double Element::clientLeft()
 {
     document().updateLayoutIgnorePendingStylesheets();
 
     if (RenderBox* renderer = renderBox())
-        return adjustForAbsoluteZoom(roundToInt(renderer->clientLeft()), renderer);
+        return adjustForAbsoluteZoom(renderer->clientLeft(), renderer);
     return 0;
 }
 
-int Element::clientTop()
+double Element::clientTop()
 {
     document().updateLayoutIgnorePendingStylesheets();
 
     if (RenderBox* renderer = renderBox())
-        return adjustForAbsoluteZoom(roundToInt(renderer->clientTop()), renderer);
+        return adjustForAbsoluteZoom(renderer->clientTop(), renderer);
     return 0;
 }
 
-int Element::clientWidth()
+double Element::clientWidth()
 {
     document().updateLayoutIgnorePendingStylesheets();
 
@@ -631,11 +631,11 @@
     }
 
     if (RenderBox* renderer = renderBox())
-        return adjustLayoutUnitForAbsoluteZoom(renderer->pixelSnappedClientWidth(), *renderer).round();
+        return adjustLayoutUnitForAbsoluteZoom(renderer->clientWidth(), *renderer).toFloat();
     return 0;
 }
 
-int Element::clientHeight()
+double Element::clientHeight()
 {
     document().updateLayoutIgnorePendingStylesheets();
 
@@ -652,11 +652,11 @@
     }
 
     if (RenderBox* renderer = renderBox())
-        return adjustLayoutUnitForAbsoluteZoom(renderer->pixelSnappedClientHeight(), *renderer).round();
+        return adjustLayoutUnitForAbsoluteZoom(renderer->clientHeight(), *renderer).toFloat();
     return 0;
 }
 
-int Element::scrollLeft()
+double Element::scrollLeft()
 {
     document().updateLayoutIgnorePendingStylesheets();
 
@@ -679,7 +679,7 @@
     return 0;
 }
 
-int Element::scrollTop()
+double Element::scrollTop()
 {
     document().updateLayoutIgnorePendingStylesheets();
 
@@ -702,13 +702,13 @@
     return 0;
 }
 
-void Element::setScrollLeft(int newLeft)
+void Element::setScrollLeft(double newLeft)
 {
     document().updateLayoutIgnorePendingStylesheets();
 
     if (document().documentElement() != this) {
         if (RenderBox* rend = renderBox())
-            rend->setScrollLeft(static_cast<int>(newLeft * rend->style()->effectiveZoom()));
+            rend->setScrollLeft(roundf(newLeft * rend->style()->effectiveZoom()));
         return;
     }
 
@@ -723,7 +723,7 @@
         if (!view)
             return;
 
-        view->setScrollPosition(IntPoint(static_cast<int>(newLeft * frame->pageZoomFactor()), view->scrollY()));
+        view->setScrollPosition(IntPoint(roundf(newLeft * frame->pageZoomFactor()), view->scrollY()));
     }
 }
 
@@ -748,13 +748,13 @@
     setScrollLeft(position);
 }
 
-void Element::setScrollTop(int newTop)
+void Element::setScrollTop(double newTop)
 {
     document().updateLayoutIgnorePendingStylesheets();
 
     if (document().documentElement() != this) {
         if (RenderBox* rend = renderBox())
-            rend->setScrollTop(static_cast<int>(newTop * rend->style()->effectiveZoom()));
+            rend->setScrollTop(roundf(newTop * rend->style()->effectiveZoom()));
         return;
     }
 
@@ -769,7 +769,7 @@
         if (!view)
             return;
 
-        view->setScrollPosition(IntPoint(view->scrollX(), static_cast<int>(newTop * frame->pageZoomFactor())));
+        view->setScrollPosition(IntPoint(view->scrollX(), roundf(newTop * frame->pageZoomFactor())));
     }
 }
 
@@ -794,7 +794,7 @@
     setScrollTop(position);
 }
 
-int Element::scrollWidth()
+double Element::scrollWidth()
 {
     document().updateLayoutIgnorePendingStylesheets();
     if (RenderBox* rend = renderBox())
@@ -802,7 +802,7 @@
     return 0;
 }
 
-int Element::scrollHeight()
+double Element::scrollHeight()
 {
     document().updateLayoutIgnorePendingStylesheets();
     if (RenderBox* rend = renderBox())
@@ -1402,22 +1402,12 @@
     createPseudoElementIfNeeded(AFTER);
     createPseudoElementIfNeeded(BACKDROP);
 
-    if (hasRareData()) {
-        ElementRareData* data = elementRareData();
-        if (data->hasElementFlag(NeedsFocusAppearanceUpdateSoonAfterAttach)) {
-            if (isFocusable() && document().focusedElement() == this)
-                document().updateFocusAppearanceSoon(false /* don't restore selection */);
-            data->clearElementFlag(NeedsFocusAppearanceUpdateSoonAfterAttach);
-        }
-        if (!renderer()) {
-            if (ActiveAnimations* activeAnimations = data->activeAnimations()) {
-                activeAnimations->cssAnimations().cancel();
-                activeAnimations->setAnimationStyleChange(false);
-            }
+    if (hasRareData() && !renderer()) {
+        if (ActiveAnimations* activeAnimations = elementRareData()->activeAnimations()) {
+            activeAnimations->cssAnimations().cancel();
+            activeAnimations->setAnimationStyleChange(false);
         }
     }
-
-    document().didRecalculateStyleForElement();
 }
 
 void Element::detach(const AttachContext& context)
@@ -1440,7 +1430,7 @@
 
         if (ActiveAnimations* activeAnimations = data->activeAnimations()) {
             if (context.performingReattach) {
-                // FIXME: We call detach from withing style recalc, so compositingState is not up to date.
+                // FIXME: We call detach from within style recalc, so compositingState is not up to date.
                 // https://code.google.com/p/chromium/issues/detail?id=339847
                 DisableCompositingQueryAsserts disabler;
 
@@ -1519,6 +1509,7 @@
         activeAnimations->updateAnimationFlags(*style);
     }
 
+    document().didRecalculateStyleForElement();
     return style.release();
 }
 
@@ -1590,8 +1581,6 @@
 
     ASSERT(oldStyle);
 
-    document().didRecalculateStyleForElement();
-
     if (localChange != NoChange)
         updateCallbackSelectors(oldStyle.get(), newStyle.get());
 
@@ -1721,6 +1710,19 @@
     setAnimationStyleChange(true);
 }
 
+void Element::setNeedsCompositingUpdate()
+{
+    if (!document().isActive())
+        return;
+    RenderBoxModelObject* renderer = renderBoxModelObject();
+    if (!renderer)
+        return;
+    if (!renderer->hasLayer())
+        return;
+    renderer->layer()->setNeedsToUpdateAncestorDependentProperties();
+    document().renderView()->compositor()->setNeedsCompositingUpdate(CompositingUpdateAfterCompositingInputChange);
+}
+
 void Element::setCustomElementDefinition(PassRefPtr<CustomElementDefinition> definition)
 {
     if (!hasRareData() && !definition)
@@ -2074,39 +2076,24 @@
     if (!inDocument())
         return;
 
-    Document& doc = document();
-    if (doc.focusedElement() == this)
+    if (document().focusedElement() == this)
         return;
 
-    // If the stylesheets have already been loaded we can reliably check isFocusable.
-    // If not, we continue and set the focused node on the focus controller below so
-    // that it can be updated soon after attach.
-    if (doc.isRenderingReady()) {
-        doc.updateLayoutIgnorePendingStylesheets();
-        if (!isFocusable())
-            return;
-    }
-
-    if (!supportsFocus())
+    if (!document().isActive())
         return;
 
-    RefPtr<Node> protect;
-    if (Page* page = doc.page()) {
-        // Focus and change event handlers can cause us to lose our last ref.
-        // If a focus event handler changes the focus to a different node it
-        // does not make sense to continue and update appearence.
-        protect = this;
-        if (!page->focusController().setFocusedElement(this, doc.frame(), type))
-            return;
-    }
+    document().updateLayoutIgnorePendingStylesheets();
+    if (!isFocusable())
+        return;
+
+    RefPtr<Node> protect(this);
+    if (!document().page()->focusController().setFocusedElement(this, document().frame(), type))
+        return;
 
     // Setting the focused node above might have invalidated the layout due to scripts.
-    doc.updateLayoutIgnorePendingStylesheets();
-
-    if (!isFocusable()) {
-        setElementFlag(NeedsFocusAppearanceUpdateSoonAfterAttach);
+    document().updateLayoutIgnorePendingStylesheets();
+    if (!isFocusable())
         return;
-    }
 
     cancelFocusAppearanceUpdate();
     updateFocusAppearance(restorePreviousSelection);
@@ -2433,18 +2420,6 @@
     return false;
 }
 
-LayoutSize Element::minimumSizeForResizing() const
-{
-    return hasRareData() ? elementRareData()->minimumSizeForResizing() : defaultMinimumSizeForResizing();
-}
-
-void Element::setMinimumSizeForResizing(const LayoutSize& size)
-{
-    if (!hasRareData() && size == defaultMinimumSizeForResizing())
-        return;
-    ensureElementRareData().setMinimumSizeForResizing(size);
-}
-
 RenderStyle* Element::computedStyle(PseudoId pseudoElementSpecifier)
 {
     if (PseudoElement* element = pseudoElement(pseudoElementSpecifier))
@@ -2504,8 +2479,6 @@
 
 void Element::cancelFocusAppearanceUpdate()
 {
-    if (hasRareData())
-        clearElementFlag(NeedsFocusAppearanceUpdateSoonAfterAttach);
     if (document().focusedElement() == this)
         document().cancelFocusAppearanceUpdate();
 }
@@ -2827,7 +2800,7 @@
     }
 
     if (oldValue != newValue) {
-        if (inActiveDocument())
+        if (inActiveDocument() && document().styleResolver() && styleChangeType() < SubtreeStyleChange)
             document().ensureStyleResolver().ensureUpdatedRuleFeatureSet().scheduleStyleInvalidationForAttributeChange(name, *this);
 
         if (isUpgradedCustomElement())
@@ -3321,4 +3294,12 @@
     return true;
 }
 
+void Element::trace(Visitor* visitor)
+{
+    if (hasRareData())
+        visitor->trace(elementRareData());
+
+    ContainerNode::trace(visitor);
+}
+
 } // namespace WebCore
diff --git a/Source/core/dom/Element.h b/Source/core/dom/Element.h
index 3ae0445..2e81754 100644
--- a/Source/core/dom/Element.h
+++ b/Source/core/dom/Element.h
@@ -79,14 +79,13 @@
 
 enum ElementFlags {
     TabIndexWasSetExplicitly = 1 << 0,
-    NeedsFocusAppearanceUpdateSoonAfterAttach = 1 << 1,
-    StyleAffectedByEmpty = 1 << 2,
-    IsInCanvasSubtree = 1 << 3,
-    ContainsFullScreenElement = 1 << 4,
-    IsInTopLayer = 1 << 5,
-    HasPendingResources = 1 << 6,
+    StyleAffectedByEmpty = 1 << 1,
+    IsInCanvasSubtree = 1 << 2,
+    ContainsFullScreenElement = 1 << 3,
+    IsInTopLayer = 1 << 4,
+    HasPendingResources = 1 << 5,
 
-    NumberOfElementFlags = 7, // Required size of bitfield used to store the flags.
+    NumberOfElementFlags = 6, // Required size of bitfield used to store the flags.
 };
 
 class Element : public ContainerNode {
@@ -182,28 +181,28 @@
     void scrollByLines(int lines);
     void scrollByPages(int pages);
 
-    int offsetLeft();
-    int offsetTop();
-    int offsetWidth();
-    int offsetHeight();
+    double offsetLeft();
+    double offsetTop();
+    double offsetWidth();
+    double offsetHeight();
 
     // FIXME: Replace uses of offsetParent in the platform with calls
     // to the render layer and merge offsetParentForBindings and offsetParent.
     Element* offsetParentForBindings();
 
     Element* offsetParent();
-    int clientLeft();
-    int clientTop();
-    int clientWidth();
-    int clientHeight();
-    virtual int scrollLeft();
-    virtual int scrollTop();
-    virtual void setScrollLeft(int);
+    double clientLeft();
+    double clientTop();
+    double clientWidth();
+    double clientHeight();
+    virtual double scrollLeft();
+    virtual double scrollTop();
+    virtual void setScrollLeft(double);
     virtual void setScrollLeft(const Dictionary& scrollOptionsHorizontal, ExceptionState&);
-    virtual void setScrollTop(int);
+    virtual void setScrollTop(double);
     virtual void setScrollTop(const Dictionary& scrollOptionsVertical, ExceptionState&);
-    virtual int scrollWidth();
-    virtual int scrollHeight();
+    virtual double scrollWidth();
+    virtual double scrollHeight();
 
     IntRect boundsInRootViewSpace();
 
@@ -326,6 +325,8 @@
     void setAnimationStyleChange(bool);
     void setNeedsAnimationStyleRecalc();
 
+    void setNeedsCompositingUpdate();
+
     bool supportsStyleSharing() const;
 
     ElementShadow* shadow() const;
@@ -402,9 +403,6 @@
     virtual const AtomicString& shadowPseudoId() const;
     void setShadowPseudoId(const AtomicString&);
 
-    LayoutSize minimumSizeForResizing() const;
-    void setMinimumSizeForResizing(const LayoutSize&);
-
     virtual void didBecomeFullscreenElement() { }
     virtual void willStopBeingFullscreenElement() { }
 
@@ -430,9 +428,6 @@
 
     DOMStringMap& dataset();
 
-#if ENABLE(INPUT_SPEECH)
-    virtual bool isInputFieldSpeechButtonElement() const { return false; }
-#endif
 #if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
     virtual bool isDateTimeEditElement() const { return false; }
     virtual bool isDateTimeFieldElement() const { return false; }
@@ -513,6 +508,8 @@
     void setTabIndex(int);
     virtual short tabIndex() const OVERRIDE;
 
+    virtual void trace(Visitor*) OVERRIDE;
+
 protected:
     Element(const QualifiedName& tagName, Document* document, ConstructionType type)
         : ContainerNode(document, type)
@@ -819,6 +816,8 @@
 
 inline Node::InsertionNotificationRequest Node::insertedInto(ContainerNode* insertionPoint)
 {
+    ASSERT(!childNeedsStyleInvalidation());
+    ASSERT(!needsStyleInvalidation());
     ASSERT(insertionPoint->inDocument() || isContainerNode());
     if (insertionPoint->inDocument())
         setFlag(InDocumentFlag);
diff --git a/Source/core/dom/Element.idl b/Source/core/dom/Element.idl
index 42efd90..3de57ce 100644
--- a/Source/core/dom/Element.idl
+++ b/Source/core/dom/Element.idl
@@ -61,24 +61,24 @@
 
     // Common extensions
 
-    readonly attribute long offsetLeft;
-    readonly attribute long offsetTop;
-    readonly attribute long offsetWidth;
-    readonly attribute long offsetHeight;
+    readonly attribute double offsetLeft;
+    readonly attribute double offsetTop;
+    readonly attribute double offsetWidth;
+    readonly attribute double offsetHeight;
     [ImplementedAs=offsetParentForBindings, PerWorldBindings] readonly attribute Element offsetParent;
-    readonly attribute long clientLeft;
-    readonly attribute long clientTop;
-    readonly attribute long clientWidth;
-    readonly attribute long clientHeight;
+    readonly attribute double clientLeft;
+    readonly attribute double clientTop;
+    readonly attribute double clientWidth;
+    readonly attribute double clientHeight;
 
     // FIXME: should be:
-    // attribute (Dictionary or long) scrollLeft;
-    // attribute (Dictionary or long) scrollTop;
+    // attribute (Dictionary or double) scrollLeft;
+    // attribute (Dictionary or double) scrollTop;
     // http://crbug.com/240176
-    [Custom=Setter] attribute long scrollLeft;
-    [Custom=Setter] attribute long scrollTop;
-    readonly attribute long scrollWidth;
-    readonly attribute long scrollHeight;
+    [Custom=Setter] attribute double scrollLeft;
+    [Custom=Setter] attribute double scrollTop;
+    readonly attribute double scrollWidth;
+    readonly attribute double scrollHeight;
 
     void focus();
     void blur();
@@ -86,9 +86,9 @@
 
     // WebKit extensions
 
-    void scrollIntoViewIfNeeded(optional boolean centerIfNeeded);
-    void scrollByLines([Default=Undefined] optional long lines);
-    void scrollByPages([Default=Undefined] optional long pages);
+    [MeasureAs=ElementScrollIntoViewIfNeeded] void scrollIntoViewIfNeeded(optional boolean centerIfNeeded);
+    [MeasureAs=ElementScrollByLines] void scrollByLines([Default=Undefined] optional long lines);
+    [MeasureAs=ElementScrollByPages] void scrollByPages([Default=Undefined] optional long pages);
 
     // HTML 5
     HTMLCollection getElementsByClassName(DOMString classNames);
diff --git a/Source/core/dom/ElementRareData.cpp b/Source/core/dom/ElementRareData.cpp
index 42d5083..d527c1a 100644
--- a/Source/core/dom/ElementRareData.cpp
+++ b/Source/core/dom/ElementRareData.cpp
@@ -37,19 +37,28 @@
 
 struct SameSizeAsElementRareData : NodeRareData {
     short indices[2];
-    LayoutSize sizeForResizing;
     IntSize scrollOffset;
     void* pointers[11];
-    OwnPtrWillBePersistent<ActiveAnimations> m_activeAnimations;
+    OwnPtrWillBeMember<ActiveAnimations> activeAnimations;
 };
 
 CSSStyleDeclaration& ElementRareData::ensureInlineCSSStyleDeclaration(Element* ownerElement)
 {
     if (!m_cssomWrapper)
-        m_cssomWrapper = adoptPtr(new InlineCSSStyleDeclaration(ownerElement));
+        m_cssomWrapper = adoptPtrWillBeNoop(new InlineCSSStyleDeclaration(ownerElement));
     return *m_cssomWrapper;
 }
 
+void ElementRareData::traceAfterDispatch(Visitor* visitor)
+{
+    visitor->trace(m_dataset);
+    visitor->trace(m_classList);
+    visitor->trace(m_shadow);
+    visitor->trace(m_attributeMap);
+    visitor->trace(m_activeAnimations);
+    visitor->trace(m_cssomWrapper);
+    NodeRareData::traceAfterDispatch(visitor);
+}
 
 COMPILE_ASSERT(sizeof(ElementRareData) == sizeof(SameSizeAsElementRareData), ElementRareDataShouldStaySmall);
 
diff --git a/Source/core/dom/ElementRareData.h b/Source/core/dom/ElementRareData.h
index 631fc87..67d8e0f 100644
--- a/Source/core/dom/ElementRareData.h
+++ b/Source/core/dom/ElementRareData.h
@@ -32,6 +32,7 @@
 #include "core/html/ClassList.h"
 #include "core/html/ime/InputMethodContext.h"
 #include "core/rendering/style/StyleInheritedData.h"
+#include "platform/heap/Handle.h"
 #include "wtf/OwnPtr.h"
 
 namespace WebCore {
@@ -40,9 +41,9 @@
 
 class ElementRareData : public NodeRareData {
 public:
-    static PassOwnPtr<ElementRareData> create(RenderObject* renderer)
+    static ElementRareData* create(RenderObject* renderer)
     {
-        return adoptPtr(new ElementRareData(renderer));
+        return new ElementRareData(renderer);
     }
 
     ~ElementRareData();
@@ -78,14 +79,14 @@
     }
 
     NamedNodeMap* attributeMap() const { return m_attributeMap.get(); }
-    void setAttributeMap(PassOwnPtr<NamedNodeMap> attributeMap) { m_attributeMap = attributeMap; }
+    void setAttributeMap(PassOwnPtrWillBeRawPtr<NamedNodeMap> attributeMap) { m_attributeMap = attributeMap; }
 
     RenderStyle* computedStyle() const { return m_computedStyle.get(); }
     void setComputedStyle(PassRefPtr<RenderStyle> computedStyle) { m_computedStyle = computedStyle; }
     void clearComputedStyle() { m_computedStyle = nullptr; }
 
     ClassList* classList() const { return m_classList.get(); }
-    void setClassList(PassOwnPtr<ClassList> classList) { m_classList = classList; }
+    void setClassList(PassOwnPtrWillBeRawPtr<ClassList> classList) { m_classList = classList; }
     void clearClassListValueForQuirksMode()
     {
         if (!m_classList)
@@ -94,10 +95,7 @@
     }
 
     DatasetDOMStringMap* dataset() const { return m_dataset.get(); }
-    void setDataset(PassOwnPtr<DatasetDOMStringMap> dataset) { m_dataset = dataset; }
-
-    LayoutSize minimumSizeForResizing() const { return m_minimumSizeForResizing; }
-    void setMinimumSizeForResizing(LayoutSize size) { m_minimumSizeForResizing = size; }
+    void setDataset(PassOwnPtrWillBeRawPtr<DatasetDOMStringMap> dataset) { m_dataset = dataset; }
 
     IntSize savedLayerScrollOffset() const { return m_savedLayerScrollOffset; }
     void setSavedLayerScrollOffset(IntSize size) { m_savedLayerScrollOffset = size; }
@@ -122,19 +120,20 @@
     void setCustomElementDefinition(PassRefPtr<CustomElementDefinition> definition) { m_customElementDefinition = definition; }
     CustomElementDefinition* customElementDefinition() const { return m_customElementDefinition.get(); }
 
+    void traceAfterDispatch(Visitor*);
+
 private:
     short m_tabindex;
 
-    LayoutSize m_minimumSizeForResizing;
     IntSize m_savedLayerScrollOffset;
 
-    OwnPtr<DatasetDOMStringMap> m_dataset;
-    OwnPtr<ClassList> m_classList;
-    OwnPtr<ElementShadow> m_shadow;
-    OwnPtr<NamedNodeMap> m_attributeMap;
+    OwnPtrWillBeMember<DatasetDOMStringMap> m_dataset;
+    OwnPtrWillBeMember<ClassList> m_classList;
+    OwnPtrWillBeMember<ElementShadow> m_shadow;
+    OwnPtrWillBeMember<NamedNodeMap> m_attributeMap;
     OwnPtr<InputMethodContext> m_inputMethodContext;
-    OwnPtrWillBePersistent<ActiveAnimations> m_activeAnimations;
-    OwnPtr<InlineCSSStyleDeclaration> m_cssomWrapper;
+    OwnPtrWillBeMember<ActiveAnimations> m_activeAnimations;
+    OwnPtrWillBeMember<InlineCSSStyleDeclaration> m_cssomWrapper;
 
     RefPtr<RenderStyle> m_computedStyle;
     RefPtr<CustomElementDefinition> m_customElementDefinition;
@@ -146,21 +145,18 @@
     explicit ElementRareData(RenderObject*);
 };
 
-inline IntSize defaultMinimumSizeForResizing()
-{
-    return IntSize(LayoutUnit::max(), LayoutUnit::max());
-}
-
 inline ElementRareData::ElementRareData(RenderObject* renderer)
     : NodeRareData(renderer)
     , m_tabindex(0)
-    , m_minimumSizeForResizing(defaultMinimumSizeForResizing())
 {
+    m_isElementRareData = true;
 }
 
 inline ElementRareData::~ElementRareData()
 {
+#if !ENABLE(OILPAN)
     ASSERT(!m_shadow);
+#endif
     ASSERT(!m_generatedBefore);
     ASSERT(!m_generatedAfter);
     ASSERT(!m_backdrop);
diff --git a/Source/core/dom/EventHandlerRegistry.cpp b/Source/core/dom/EventHandlerRegistry.cpp
deleted file mode 100644
index 232622c..0000000
--- a/Source/core/dom/EventHandlerRegistry.cpp
+++ /dev/null
@@ -1,230 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "config.h"
-#include "core/dom/EventHandlerRegistry.h"
-
-#include "core/dom/Document.h"
-#include "core/events/ThreadLocalEventNames.h"
-#include "core/events/WheelEvent.h"
-#include "core/frame/FrameHost.h"
-#include "core/frame/LocalFrame.h"
-#include "core/page/Chrome.h"
-#include "core/page/ChromeClient.h"
-#include "core/page/Page.h"
-#include "core/page/scrolling/ScrollingCoordinator.h"
-
-namespace WebCore {
-
-EventHandlerRegistry::HandlerState::HandlerState()
-{
-}
-
-EventHandlerRegistry::HandlerState::~HandlerState()
-{
-}
-
-EventHandlerRegistry::EventHandlerRegistry(Document& document)
-    : m_document(document)
-{
-}
-
-EventHandlerRegistry::~EventHandlerRegistry()
-{
-}
-
-const char* EventHandlerRegistry::supplementName()
-{
-    return "EventHandlerRegistry";
-}
-
-EventHandlerRegistry* EventHandlerRegistry::from(Document& document)
-{
-    EventHandlerRegistry* registry = static_cast<EventHandlerRegistry*>(DocumentSupplement::from(document, supplementName()));
-    if (!registry) {
-        registry = new EventHandlerRegistry(document);
-        DocumentSupplement::provideTo(document, supplementName(), adoptPtrWillBeNoop(registry));
-    }
-    return registry;
-}
-
-bool EventHandlerRegistry::eventTypeToClass(const AtomicString& eventType, EventHandlerClass* result)
-{
-    if (eventType == EventTypeNames::scroll) {
-        *result = ScrollEvent;
-    } else {
-        return false;
-    }
-    return true;
-}
-
-const EventTargetSet* EventHandlerRegistry::eventHandlerTargets(EventHandlerClass handlerClass) const
-{
-    return m_eventHandlers[handlerClass].targets.get();
-}
-
-bool EventHandlerRegistry::hasEventHandlers(EventHandlerClass handlerClass) const
-{
-    EventTargetSet* targets = m_eventHandlers[handlerClass].targets.get();
-    return targets && targets->size();
-}
-
-bool EventHandlerRegistry::updateEventHandlerTargets(ChangeOperation op, EventHandlerClass handlerClass, EventTarget* target)
-{
-    EventTargetSet* targets = m_eventHandlers[handlerClass].targets.get();
-    if (op == Add) {
-#if ASSERT_ENABLED
-        if (Node* node = target->toNode())
-            ASSERT(&node->document() == &m_document);
-#endif // ASSERT_ENABLED
-
-        if (!targets) {
-            m_eventHandlers[handlerClass].targets = adoptPtr(new EventTargetSet);
-            targets = m_eventHandlers[handlerClass].targets.get();
-        }
-
-        if (!targets->add(target).isNewEntry) {
-            // Just incremented refcount, no real change.
-            return false;
-        }
-    } else {
-        // Note that we can't assert that |target| is in this document because
-        // it might be in the process of moving out of it.
-        ASSERT(op == Remove || op == RemoveAll);
-        ASSERT(op == RemoveAll || targets->contains(target));
-        if (!targets)
-            return false;
-
-        if (op == RemoveAll) {
-            if (!targets->contains(target))
-                return false;
-            targets->removeAll(target);
-        } else {
-            if (!targets->remove(target)) {
-                // Just decremented refcount, no real update.
-                return false;
-            }
-        }
-    }
-    return true;
-}
-
-void EventHandlerRegistry::updateEventHandlerInternal(ChangeOperation op, EventHandlerClass handlerClass, EventTarget* target)
-{
-    // After the document has stopped, all updates become no-ops.
-    if (!m_document.isActive()) {
-        return;
-    }
-
-    bool hadHandlers = hasEventHandlers(handlerClass);
-    updateEventHandlerTargets(op, handlerClass, target);
-    bool hasHandlers = hasEventHandlers(handlerClass);
-
-    // Notify the parent document's registry if we added the first or removed
-    // the last handler.
-    if (hadHandlers != hasHandlers && !m_document.parentDocument()) {
-        // This is the root registry; notify clients accordingly.
-        notifyHasHandlersChanged(handlerClass, hasHandlers);
-    }
-}
-
-void EventHandlerRegistry::updateEventHandlerOfType(ChangeOperation op, const AtomicString& eventType, EventTarget* target)
-{
-    EventHandlerClass handlerClass;
-    if (!eventTypeToClass(eventType, &handlerClass))
-        return;
-    updateEventHandlerInternal(op, handlerClass, target);
-}
-
-void EventHandlerRegistry::didAddEventHandler(EventTarget& target, const AtomicString& eventType)
-{
-    updateEventHandlerOfType(Add, eventType, &target);
-}
-
-void EventHandlerRegistry::didRemoveEventHandler(EventTarget& target, const AtomicString& eventType)
-{
-    updateEventHandlerOfType(Remove, eventType, &target);
-}
-
-void EventHandlerRegistry::didAddEventHandler(EventTarget& target, EventHandlerClass handlerClass)
-{
-    updateEventHandlerInternal(Add, handlerClass, &target);
-}
-
-void EventHandlerRegistry::didRemoveEventHandler(EventTarget& target, EventHandlerClass handlerClass)
-{
-    updateEventHandlerInternal(Remove, handlerClass, &target);
-}
-
-void EventHandlerRegistry::didMoveFromOtherDocument(EventTarget& target, Document& oldDocument)
-{
-    EventHandlerRegistry* oldRegistry = EventHandlerRegistry::from(oldDocument);
-    for (size_t i = 0; i < EventHandlerClassCount; ++i) {
-        EventHandlerClass handlerClass = static_cast<EventHandlerClass>(i);
-        const EventTargetSet* targets = oldRegistry->eventHandlerTargets(handlerClass);
-        if (!targets)
-            continue;
-        for (unsigned count = targets->count(&target); count > 0; --count) {
-            oldRegistry->updateEventHandlerInternal(Remove, handlerClass, &target);
-            updateEventHandlerInternal(Add, handlerClass, &target);
-        }
-    }
-}
-
-void EventHandlerRegistry::didRemoveAllEventHandlers(EventTarget& target)
-{
-    for (size_t i = 0; i < EventHandlerClassCount; ++i) {
-        EventHandlerClass handlerClass = static_cast<EventHandlerClass>(i);
-        const EventTargetSet* targets = eventHandlerTargets(handlerClass);
-        if (!targets)
-            continue;
-        updateEventHandlerInternal(RemoveAll, handlerClass, &target);
-    }
-}
-
-void EventHandlerRegistry::notifyHasHandlersChanged(EventHandlerClass handlerClass, bool hasActiveHandlers)
-{
-    Page* page = m_document.page();
-    ScrollingCoordinator* scrollingCoordinator = page ? page->scrollingCoordinator() : 0;
-
-    switch (handlerClass) {
-    case ScrollEvent:
-        if (scrollingCoordinator)
-            scrollingCoordinator->updateHaveScrollEventHandlers();
-        break;
-    default:
-        ASSERT_NOT_REACHED();
-        break;
-    }
-}
-
-void EventHandlerRegistry::trace(Visitor* visitor)
-{
-    visitor->registerWeakMembers<EventHandlerRegistry, &EventHandlerRegistry::clearWeakMembers>(this);
-}
-
-void EventHandlerRegistry::clearWeakMembers(Visitor* visitor)
-{
-    // FIXME: Oilpan: This is pretty funky. The current code disables all modifications of the
-    // EventHandlerRegistry when the document becomes inactive. To keep that behavior we only
-    // perform weak processing of the registry when the document is active.
-    if (!m_document.isActive())
-        return;
-    Vector<EventTarget*> deadNodeTargets;
-    for (size_t i = 0; i < EventHandlerClassCount; ++i) {
-        EventHandlerClass handlerClass = static_cast<EventHandlerClass>(i);
-        const EventTargetSet* targets = eventHandlerTargets(handlerClass);
-        if (!targets)
-            continue;
-        for (EventTargetSet::const_iterator it = targets->begin(); it != targets->end(); ++it) {
-            Node* node = it->key->toNode();
-            if (node && !visitor->isAlive(node))
-                deadNodeTargets.append(node);
-        }
-    }
-    for (size_t i = 0; i < deadNodeTargets.size(); ++i)
-        didRemoveAllEventHandlers(*deadNodeTargets[i]);
-}
-
-} // namespace WebCore
diff --git a/Source/core/dom/ExceptionCode.h b/Source/core/dom/ExceptionCode.h
index 4dc428a..be3bf07 100644
--- a/Source/core/dom/ExceptionCode.h
+++ b/Source/core/dom/ExceptionCode.h
@@ -78,6 +78,9 @@
         // SQL
         SQLDatabaseError, // Naming conflict with DatabaseError class.
 
+        // Web Crypto
+        OperationError,
+
         // WebIDL exception types, handled by the binding layer.
         // FIXME: Add GeneralError, EvalError, etc. when implemented in the bindings.
         TypeError,
diff --git a/Source/core/dom/FullscreenElementStack.cpp b/Source/core/dom/FullscreenElementStack.cpp
index 98d846e..22875bf 100644
--- a/Source/core/dom/FullscreenElementStack.cpp
+++ b/Source/core/dom/FullscreenElementStack.cpp
@@ -268,7 +268,7 @@
 
     // To achieve that aim, remove all the elements from the top document's stack except for the first before
     // calling webkitExitFullscreen():
-    Vector<RefPtr<Element> > replacementFullscreenElementStack;
+    WillBeHeapVector<RefPtrWillBeMember<Element> > replacementFullscreenElementStack;
     replacementFullscreenElementStack.append(fullscreenElementFrom(document()->topDocument()));
     FullscreenElementStack& topFullscreenElementStack = from(document()->topDocument());
     topFullscreenElementStack.m_fullScreenElementStack.swap(replacementFullscreenElementStack);
@@ -477,14 +477,14 @@
     // Since we dispatch events in this function, it's possible that the
     // document will be detached and GC'd. We protect it here to make sure we
     // can finish the function successfully.
-    RefPtr<Document> protectDocument(document());
-    Deque<RefPtr<Node> > changeQueue;
+    RefPtrWillBeRawPtr<Document> protectDocument(document());
+    WillBeHeapDeque<RefPtrWillBeMember<Node> > changeQueue;
     m_fullScreenChangeEventTargetQueue.swap(changeQueue);
-    Deque<RefPtr<Node> > errorQueue;
+    WillBeHeapDeque<RefPtrWillBeMember<Node> > errorQueue;
     m_fullScreenErrorEventTargetQueue.swap(errorQueue);
 
     while (!changeQueue.isEmpty()) {
-        RefPtr<Node> node = changeQueue.takeFirst();
+        RefPtrWillBeRawPtr<Node> node = changeQueue.takeFirst();
         if (!node)
             node = document()->documentElement();
         // The dispatchEvent below may have blown away our documentElement.
@@ -500,7 +500,7 @@
     }
 
     while (!errorQueue.isEmpty()) {
-        RefPtr<Node> node = errorQueue.takeFirst();
+        RefPtrWillBeRawPtr<Node> node = errorQueue.takeFirst();
         if (!node)
             node = document()->documentElement();
         // The dispatchEvent below may have blown away our documentElement.
@@ -575,4 +575,13 @@
     m_fullScreenChangeEventTargetQueue.append(target);
 }
 
+void FullscreenElementStack::trace(Visitor* visitor)
+{
+    visitor->trace(m_fullScreenElement);
+    visitor->trace(m_fullScreenElementStack);
+    visitor->trace(m_fullScreenChangeEventTargetQueue);
+    visitor->trace(m_fullScreenErrorEventTargetQueue);
+    DocumentSupplement::trace(visitor);
+}
+
 } // namespace WebCore
diff --git a/Source/core/dom/FullscreenElementStack.h b/Source/core/dom/FullscreenElementStack.h
index e9a44dd..9fd6945 100644
--- a/Source/core/dom/FullscreenElementStack.h
+++ b/Source/core/dom/FullscreenElementStack.h
@@ -99,7 +99,7 @@
     virtual void documentWasDetached() OVERRIDE;
     virtual void documentWasDisposed() OVERRIDE;
 
-    virtual void trace(Visitor*) OVERRIDE { }
+    virtual void trace(Visitor*) OVERRIDE;
 
 private:
     static FullscreenElementStack* fromIfExistsSlow(Document&);
@@ -110,12 +110,12 @@
     void fullScreenChangeDelayTimerFired(Timer<FullscreenElementStack>*);
 
     bool m_areKeysEnabledInFullScreen;
-    RefPtr<Element> m_fullScreenElement;
-    Vector<RefPtr<Element> > m_fullScreenElementStack;
+    RefPtrWillBeMember<Element> m_fullScreenElement;
+    WillBeHeapVector<RefPtrWillBeMember<Element> > m_fullScreenElementStack;
     RenderFullScreen* m_fullScreenRenderer;
     Timer<FullscreenElementStack> m_fullScreenChangeDelayTimer;
-    Deque<RefPtr<Node> > m_fullScreenChangeEventTargetQueue;
-    Deque<RefPtr<Node> > m_fullScreenErrorEventTargetQueue;
+    WillBeHeapDeque<RefPtrWillBeMember<Node> > m_fullScreenChangeEventTargetQueue;
+    WillBeHeapDeque<RefPtrWillBeMember<Node> > m_fullScreenErrorEventTargetQueue;
     LayoutRect m_savedPlaceholderFrameRect;
     RefPtr<RenderStyle> m_savedPlaceholderRenderStyle;
 };
diff --git a/Source/core/dom/IdTargetObserver.cpp b/Source/core/dom/IdTargetObserver.cpp
index af185a0..50294e4 100644
--- a/Source/core/dom/IdTargetObserver.cpp
+++ b/Source/core/dom/IdTargetObserver.cpp
@@ -39,7 +39,16 @@
 
 IdTargetObserver::~IdTargetObserver()
 {
+#if !ENABLE(OILPAN)
     m_registry.removeObserver(m_id, this);
+#endif
+}
+
+void IdTargetObserver::unregister()
+{
+#if ENABLE(OILPAN)
+    m_registry.removeObserver(m_id, this);
+#endif
 }
 
 } // namespace WebCore
diff --git a/Source/core/dom/IdTargetObserver.h b/Source/core/dom/IdTargetObserver.h
index 22f26bf..1fc4cd6 100644
--- a/Source/core/dom/IdTargetObserver.h
+++ b/Source/core/dom/IdTargetObserver.h
@@ -36,6 +36,7 @@
 public:
     virtual ~IdTargetObserver();
     virtual void idTargetChanged() = 0;
+    virtual void unregister();
 
 protected:
     IdTargetObserver(IdTargetObserverRegistry&, const AtomicString& id);
diff --git a/Source/core/dom/MessageChannel.idl b/Source/core/dom/MessageChannel.idl
index fbd8bab..9486bc3 100644
--- a/Source/core/dom/MessageChannel.idl
+++ b/Source/core/dom/MessageChannel.idl
@@ -26,7 +26,7 @@
 
 [
     CustomConstructor,
-    GlobalContext=Window&WorkerGlobalScope,
+    Exposed=Window&Worker&ServiceWorker,
 ] interface MessageChannel {
     readonly attribute MessagePort port1;
     readonly attribute MessagePort port2;
diff --git a/Source/core/dom/Microtask.cpp b/Source/core/dom/Microtask.cpp
index 8902693..b38af16 100644
--- a/Source/core/dom/Microtask.cpp
+++ b/Source/core/dom/Microtask.cpp
@@ -39,40 +39,43 @@
 
 namespace WebCore {
 
-typedef Vector<OwnPtr<blink::WebThread::Task> > MicrotaskQueue;
-
-static MicrotaskQueue& microtaskQueue()
-{
-    DEFINE_STATIC_LOCAL(MicrotaskQueue, microtaskQueue, ());
-    return microtaskQueue;
-}
-
 void Microtask::performCheckpoint()
 {
-    V8PerIsolateData* isolateData = V8PerIsolateData::from(v8::Isolate::GetCurrent());
+    v8::Isolate* isolate = v8::Isolate::GetCurrent();
+    V8PerIsolateData* isolateData = V8PerIsolateData::from(isolate);
     ASSERT(isolateData);
     if (isolateData->recursionLevel() || isolateData->performingMicrotaskCheckpoint())
         return;
     isolateData->setPerformingMicrotaskCheckpoint(true);
 
-    while (!microtaskQueue().isEmpty()) {
-        MicrotaskQueue microtasks;
-        microtasks.swap(microtaskQueue());
-        for (size_t i = 0; i < microtasks.size(); ++i) {
-            microtasks[i]->run();
-        }
-    }
+    v8::HandleScope handleScope(isolate);
+    v8::Local<v8::Context> context = isolateData->ensureDomInJSContext();
+    v8::Context::Scope scope(context);
+    isolate->RunMicrotasks();
 
     isolateData->setPerformingMicrotaskCheckpoint(false);
 }
 
+static void microtaskFunctionCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
+{
+    OwnPtr<blink::WebThread::Task> task = adoptPtr(static_cast<blink::WebThread::Task*>(info.Data().As<v8::External>()->Value()));
+    task->run();
+}
+
 void Microtask::enqueueMicrotask(PassOwnPtr<blink::WebThread::Task> callback)
 {
-    microtaskQueue().append(callback);
+    v8::Isolate* isolate = v8::Isolate::GetCurrent();
+    V8PerIsolateData* isolateData = V8PerIsolateData::from(isolate);
+    v8::HandleScope handleScope(isolate);
+    v8::Local<v8::Context> context = isolateData->ensureDomInJSContext();
+    v8::Context::Scope scope(context);
+    v8::Local<v8::External> handler = v8::External::New(isolate, callback.leakPtr());
+    isolate->EnqueueMicrotask(v8::Function::New(isolate, &microtaskFunctionCallback, handler));
 }
 
 void Microtask::enqueueMicrotask(const Closure& callback)
 {
     enqueueMicrotask(adoptPtr(new Task(callback)));
 }
+
 } // namespace WebCore
diff --git a/Source/core/dom/MutationObserver.cpp b/Source/core/dom/MutationObserver.cpp
index d8ea3dd..e36a1a7 100644
--- a/Source/core/dom/MutationObserver.cpp
+++ b/Source/core/dom/MutationObserver.cpp
@@ -70,7 +70,9 @@
 
 MutationObserver::~MutationObserver()
 {
+#if !ENABLE(OILPAN)
     ASSERT(m_registrations.isEmpty());
+#endif
     if (!m_records.isEmpty())
         InspectorInstrumentation::didClearAllMutationRecords(m_callback->executionContext(), this);
 }
diff --git a/Source/core/dom/MutationObserver.h b/Source/core/dom/MutationObserver.h
index 03d1d9e..5036587 100644
--- a/Source/core/dom/MutationObserver.h
+++ b/Source/core/dom/MutationObserver.h
@@ -54,7 +54,7 @@
 typedef unsigned char MutationRecordDeliveryOptions;
 
 typedef WillBeHeapHashSet<RefPtrWillBeMember<MutationObserver> > MutationObserverSet;
-typedef WillBeHeapHashSet<RawPtrWillBeMember<MutationObserverRegistration> > MutationObserverRegistrationSet;
+typedef WillBeHeapHashSet<RawPtrWillBeWeakMember<MutationObserverRegistration> > MutationObserverRegistrationSet;
 typedef WillBeHeapVector<RefPtrWillBeMember<MutationObserver> > MutationObserverVector;
 typedef WillBeHeapVector<RefPtrWillBeMember<MutationRecord> > MutationRecordVector;
 
diff --git a/Source/core/dom/MutationObserverRegistration.cpp b/Source/core/dom/MutationObserverRegistration.cpp
index 12816b0..0ba07f1 100644
--- a/Source/core/dom/MutationObserverRegistration.cpp
+++ b/Source/core/dom/MutationObserverRegistration.cpp
@@ -37,12 +37,12 @@
 
 namespace WebCore {
 
-PassOwnPtrWillBeRawPtr<MutationObserverRegistration> MutationObserverRegistration::create(MutationObserver& observer, Node& registrationNode, MutationObserverOptions options, const HashSet<AtomicString>& attributeFilter)
+PassOwnPtrWillBeRawPtr<MutationObserverRegistration> MutationObserverRegistration::create(MutationObserver& observer, Node* registrationNode, MutationObserverOptions options, const HashSet<AtomicString>& attributeFilter)
 {
     return adoptPtrWillBeNoop(new MutationObserverRegistration(observer, registrationNode, options, attributeFilter));
 }
 
-MutationObserverRegistration::MutationObserverRegistration(MutationObserver& observer, Node& registrationNode, MutationObserverOptions options, const HashSet<AtomicString>& attributeFilter)
+MutationObserverRegistration::MutationObserverRegistration(MutationObserver& observer, Node* registrationNode, MutationObserverOptions options, const HashSet<AtomicString>& attributeFilter)
     : m_observer(observer)
     , m_registrationNode(registrationNode)
     , m_options(options)
@@ -53,8 +53,9 @@
 
 MutationObserverRegistration::~MutationObserverRegistration()
 {
-    // dispose() hasn't been called if this assert triggers.
-    ASSERT(!m_observer);
+#if !ENABLE(OILPAN)
+    dispose();
+#endif
 }
 
 void MutationObserverRegistration::dispose()
@@ -82,8 +83,9 @@
     if (!m_transientRegistrationNodes) {
         m_transientRegistrationNodes = adoptPtr(new NodeHashSet);
 
+        ASSERT(m_registrationNode);
         ASSERT(!m_registrationNodeKeepAlive);
-        m_registrationNodeKeepAlive = PassRefPtr<Node>(m_registrationNode); // Balanced in clearTransientRegistrations.
+        m_registrationNodeKeepAlive = PassRefPtrWillBeRawPtr<Node>(m_registrationNode.get()); // Balanced in clearTransientRegistrations.
     }
     m_transientRegistrationNodes->add(&node);
 }
@@ -106,7 +108,8 @@
 
 void MutationObserverRegistration::unregister()
 {
-    m_registrationNode.unregisterMutationObserver(this);
+    ASSERT(m_registrationNode);
+    m_registrationNode->unregisterMutationObserver(this);
     // The above line will cause this object to be deleted, so don't do any more in this function.
 }
 
@@ -116,7 +119,7 @@
     if (!(m_options & type))
         return false;
 
-    if (m_registrationNode != node && !isSubtree())
+    if (m_registrationNode != &node && !isSubtree())
         return false;
 
     if (type != MutationObserver::Attributes || !(m_options & MutationObserver::AttributeFilter))
@@ -130,7 +133,8 @@
 
 void MutationObserverRegistration::addRegistrationNodesToSet(HashSet<Node*>& nodes) const
 {
-    nodes.add(&m_registrationNode);
+    ASSERT(m_registrationNode);
+    nodes.add(m_registrationNode.get());
     if (!m_transientRegistrationNodes)
         return;
     for (NodeHashSet::const_iterator iter = m_transientRegistrationNodes->begin(); iter != m_transientRegistrationNodes->end(); ++iter)
@@ -140,6 +144,8 @@
 void MutationObserverRegistration::trace(Visitor* visitor)
 {
     visitor->trace(m_observer);
+    visitor->trace(m_registrationNode);
+    visitor->trace(m_registrationNodeKeepAlive);
 }
 
 } // namespace WebCore
diff --git a/Source/core/dom/MutationObserverRegistration.h b/Source/core/dom/MutationObserverRegistration.h
index 7668c09..7af8e85 100644
--- a/Source/core/dom/MutationObserverRegistration.h
+++ b/Source/core/dom/MutationObserverRegistration.h
@@ -43,7 +43,7 @@
 
 class MutationObserverRegistration FINAL : public NoBaseWillBeGarbageCollectedFinalized<MutationObserverRegistration> {
 public:
-    static PassOwnPtrWillBeRawPtr<MutationObserverRegistration> create(MutationObserver&, Node&, MutationObserverOptions, const HashSet<AtomicString>& attributeFilter);
+    static PassOwnPtrWillBeRawPtr<MutationObserverRegistration> create(MutationObserver&, Node*, MutationObserverOptions, const HashSet<AtomicString>& attributeFilter);
     ~MutationObserverRegistration();
 
     void resetObservation(MutationObserverOptions, const HashSet<AtomicString>& attributeFilter);
@@ -66,11 +66,11 @@
     void dispose();
 
 private:
-    MutationObserverRegistration(MutationObserver&, Node&, MutationObserverOptions, const HashSet<AtomicString>& attributeFilter);
+    MutationObserverRegistration(MutationObserver&, Node*, MutationObserverOptions, const HashSet<AtomicString>& attributeFilter);
 
     RefPtrWillBeMember<MutationObserver> m_observer;
-    Node& m_registrationNode;
-    RefPtr<Node> m_registrationNodeKeepAlive;
+    RawPtrWillBeWeakMember<Node> m_registrationNode;
+    RefPtrWillBeMember<Node> m_registrationNodeKeepAlive;
     typedef HashSet<RefPtr<Node> > NodeHashSet;
     OwnPtr<NodeHashSet> m_transientRegistrationNodes;
 
diff --git a/Source/core/dom/NamedNodeMap.cpp b/Source/core/dom/NamedNodeMap.cpp
index 00280fa..8d0d9f2 100644
--- a/Source/core/dom/NamedNodeMap.cpp
+++ b/Source/core/dom/NamedNodeMap.cpp
@@ -35,6 +35,7 @@
 
 using namespace HTMLNames;
 
+#if !ENABLE(OILPAN)
 void NamedNodeMap::ref()
 {
     m_element->ref();
@@ -44,6 +45,7 @@
 {
     m_element->deref();
 }
+#endif
 
 PassRefPtr<Node> NamedNodeMap::getNamedItem(const AtomicString& name) const
 {
@@ -110,4 +112,9 @@
     return m_element->attributeCount();
 }
 
+void NamedNodeMap::trace(Visitor* visitor)
+{
+    visitor->trace(m_element);
+}
+
 } // namespace WebCore
diff --git a/Source/core/dom/NamedNodeMap.h b/Source/core/dom/NamedNodeMap.h
index d167e77..fc908cd 100644
--- a/Source/core/dom/NamedNodeMap.h
+++ b/Source/core/dom/NamedNodeMap.h
@@ -26,6 +26,7 @@
 #define NamedNodeMap_h
 
 #include "bindings/v8/ScriptWrappable.h"
+#include "core/dom/Element.h"
 #include "wtf/PassOwnPtr.h"
 #include "wtf/PassRefPtr.h"
 #include "wtf/text/AtomicString.h"
@@ -33,20 +34,21 @@
 namespace WebCore {
 
 class Node;
-class Element;
 class ExceptionState;
 
-class NamedNodeMap : public ScriptWrappable {
-    WTF_MAKE_FAST_ALLOCATED;
+class NamedNodeMap FINAL : public NoBaseWillBeGarbageCollectedFinalized<NamedNodeMap>, public ScriptWrappable {
+    WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED;
     friend class Element;
 public:
-    static PassOwnPtr<NamedNodeMap> create(Element* element)
+    static PassOwnPtrWillBeRawPtr<NamedNodeMap> create(Element* element)
     {
-        return adoptPtr(new NamedNodeMap(element));
+        return adoptPtrWillBeNoop(new NamedNodeMap(element));
     }
 
+#if !ENABLE(OILPAN)
     void ref();
     void deref();
+#endif
 
     // Public DOM interface.
 
@@ -64,6 +66,8 @@
 
     Element* element() const { return m_element; }
 
+    void trace(Visitor*);
+
 private:
     explicit NamedNodeMap(Element* element)
         : m_element(element)
@@ -73,7 +77,7 @@
         ScriptWrappable::init(this);
     }
 
-    Element* m_element;
+    RawPtrWillBeMember<Element> m_element;
 };
 
 } // namespace WebCore
diff --git a/Source/core/dom/NamedNodeMap.idl b/Source/core/dom/NamedNodeMap.idl
index 0030043..7de6a6f 100644
--- a/Source/core/dom/NamedNodeMap.idl
+++ b/Source/core/dom/NamedNodeMap.idl
@@ -20,6 +20,7 @@
 
 [
     SetWrapperReferenceFrom=element,
+    WillBeGarbageCollected,
 ] interface NamedNodeMap {
 
     [MeasureAs=NamedNodeMapGetNamedItem] Node getNamedItem([Default=Undefined] optional DOMString name);
diff --git a/Source/core/dom/Node.cpp b/Source/core/dom/Node.cpp
index 00d4d58..733c520 100644
--- a/Source/core/dom/Node.cpp
+++ b/Source/core/dom/Node.cpp
@@ -42,7 +42,6 @@
 #include "core/dom/Element.h"
 #include "core/dom/ElementRareData.h"
 #include "core/dom/ElementTraversal.h"
-#include "core/dom/EventHandlerRegistry.h"
 #include "core/dom/ExceptionCode.h"
 #include "core/dom/LiveNodeList.h"
 #include "core/dom/NodeRareData.h"
@@ -74,6 +73,7 @@
 #include "core/events/TouchEvent.h"
 #include "core/events/UIEvent.h"
 #include "core/events/WheelEvent.h"
+#include "core/frame/EventHandlerRegistry.h"
 #include "core/frame/LocalFrame.h"
 #include "core/html/HTMLAnchorElement.h"
 #include "core/html/HTMLDialogElement.h"
@@ -266,24 +266,26 @@
     liveNodeSet.remove(this);
 #endif
 
+#if !ENABLE(OILPAN)
     if (hasRareData())
         clearRareData();
 
     RELEASE_ASSERT(!renderer());
 
-#if !ENABLE(OILPAN)
     if (!isContainerNode())
         willBeDeletedFromDocument();
-#endif
 
     if (m_previous)
         m_previous->setNextSibling(0);
     if (m_next)
         m_next->setPreviousSibling(0);
 
-#if !ENABLE(OILPAN)
     if (m_treeScope)
         m_treeScope->guardDeref();
+#else
+    // With Oilpan, the rare data finalizer also asserts for
+    // this condition (we cannot directly access it here.)
+    RELEASE_ASSERT(hasRareData() || !renderer());
 #endif
 
     InspectorCounters::decrementCounter(InspectorCounters::NodeCounter);
@@ -304,7 +306,8 @@
     if (hasEventTargetData()) {
         clearEventTargetData();
         document.didClearTouchEventHandlers(this);
-        EventHandlerRegistry::from(document)->didRemoveAllEventHandlers(*this);
+        if (document.frameHost())
+            document.frameHost()->eventHandlerRegistry().didRemoveAllEventHandlers(*this);
     }
 
     if (AXObjectCache* cache = document.existingAXObjectCache())
@@ -325,36 +328,32 @@
     if (hasRareData())
         return *rareData();
 
-    NodeRareData* data;
     if (isElementNode())
-        data = ElementRareData::create(m_data.m_renderer).leakPtr();
+        m_data.m_rareData = ElementRareData::create(m_data.m_renderer);
     else
-        data = NodeRareData::create(m_data.m_renderer).leakPtr();
-    ASSERT(data);
+        m_data.m_rareData = NodeRareData::create(m_data.m_renderer);
 
-    m_data.m_rareData = data;
+    ASSERT(m_data.m_rareData);
+
     setFlag(HasRareDataFlag);
-    return *data;
+    return *rareData();
 }
 
+#if !ENABLE(OILPAN)
 void Node::clearRareData()
 {
     ASSERT(hasRareData());
     ASSERT(!transientMutationObserverRegistry() || transientMutationObserverRegistry()->isEmpty());
 
     RenderObject* renderer = m_data.m_rareData->renderer();
-    if (isElementNode()) {
-        ElementRareData* rareData = static_cast<ElementRareData*>(m_data.m_rareData);
-        rareData->dispose();
-        delete rareData;
-    } else {
-        NodeRareData* rareData = static_cast<NodeRareData*>(m_data.m_rareData);
-        rareData->dispose();
-        delete rareData;
-    }
+    if (isElementNode())
+        delete static_cast<ElementRareData*>(m_data.m_rareData);
+    else
+        delete static_cast<NodeRareData*>(m_data.m_rareData);
     m_data.m_renderer = renderer;
     clearFlag(HasRareDataFlag);
 }
+#endif
 
 Node* Node::toNode()
 {
@@ -996,6 +995,8 @@
 
 void Node::detach(const AttachContext& context)
 {
+    DeprecatedDisableModifyRenderTreeStructureAsserts disabler;
+
 #ifndef NDEBUG
     ASSERT(!detachingNode);
     detachingNode = this;
@@ -1023,6 +1024,8 @@
 
     if (StyleResolver* resolver = document().styleResolver())
         resolver->ruleFeatureSet().styleInvalidator().clearInvalidation(*this);
+    clearChildNeedsStyleInvalidation();
+    clearNeedsStyleInvalidation();
 
 #ifndef NDEBUG
     detachingNode = 0;
@@ -1961,7 +1964,12 @@
             document().didAddTouchEventHandler(this);
         }
     }
-    EventHandlerRegistry::from(document())->didMoveFromOtherDocument(*this, oldDocument);
+    if (oldDocument.frameHost() != document().frameHost()) {
+        if (oldDocument.frameHost())
+            oldDocument.frameHost()->eventHandlerRegistry().didMoveOutOfFrameHost(*this);
+        if (document().frameHost())
+            document().frameHost()->eventHandlerRegistry().didMoveIntoFrameHost(*this);
+    }
 
     if (WillBeHeapVector<OwnPtrWillBeMember<MutationObserverRegistration> >* registry = mutationObserverRegistry()) {
         for (size_t i = 0; i < registry->size(); ++i) {
@@ -1987,7 +1995,8 @@
         WheelController::from(document)->didAddWheelEventHandler(document);
     else if (isTouchEventType(eventType))
         document.didAddTouchEventHandler(targetNode);
-    EventHandlerRegistry::from(document)->didAddEventHandler(*targetNode, eventType);
+    if (document.frameHost())
+        document.frameHost()->eventHandlerRegistry().didAddEventHandler(*targetNode, eventType);
 
     return true;
 }
@@ -2009,7 +2018,8 @@
         WheelController::from(document)->didRemoveWheelEventHandler(document);
     else if (isTouchEventType(eventType))
         document.didRemoveTouchEventHandler(targetNode);
-    EventHandlerRegistry::from(document)->didRemoveEventHandler(*targetNode, eventType);
+    if (document.frameHost())
+        document.frameHost()->eventHandlerRegistry().didRemoveEventHandler(*targetNode, eventType);
 
     return true;
 }
@@ -2021,8 +2031,8 @@
 
 void Node::removeAllEventListeners()
 {
-    if (hasEventListeners())
-        EventHandlerRegistry::from(document())->didRemoveAllEventHandlers(*this);
+    if (hasEventListeners() && document().frameHost())
+        document().frameHost()->eventHandlerRegistry().didRemoveAllEventHandlers(*this);
     EventTarget::removeAllEventListeners();
     document().didClearTouchEventHandlers(this);
 }
@@ -2130,7 +2140,7 @@
     }
 
     if (!registration) {
-        registry.append(MutationObserverRegistration::create(observer, *this, options, attributeFilter));
+        registry.append(MutationObserverRegistration::create(observer, this, options, attributeFilter));
         registration = registry.last().get();
     }
 
@@ -2153,9 +2163,11 @@
     // before that, in case |this| is destroyed (see MutationObserverRegistration::m_registrationNodeKeepAlive).
     // FIXME: Simplify the registration/transient registration logic to make this understandable by humans.
     RefPtr<Node> protect(this);
-    // The explicit dispose() is motivated by Oilpan; the registration
-    // object needs to unregister itself promptly.
+#if ENABLE(OILPAN)
+    // The explicit dispose() is needed to have the registration
+    // object unregister itself promptly.
     registration->dispose();
+#endif
     registry->remove(index);
 }
 
@@ -2367,13 +2379,8 @@
     return hasEventListeners(EventTypeNames::touchstart) || hasEventListeners(EventTypeNames::touchmove) || hasEventListeners(EventTypeNames::touchcancel) || hasEventListeners(EventTypeNames::touchend);
 }
 
+#if !ENABLE(OILPAN)
 // This is here for inlining
-#if ENABLE(OILPAN)
-inline void TreeScope::removedLastRefToScope()
-{
-    dispose();
-}
-#else
 inline void TreeScope::removedLastRefToScope()
 {
     ASSERT_WITH_SECURITY_IMPLICATION(!deletionHasBegun());
@@ -2399,7 +2406,6 @@
         delete this;
     }
 }
-#endif
 
 // It's important not to inline removedLastRef, because we don't want to inline the code to
 // delete a Node at each deref call site.
@@ -2413,13 +2419,12 @@
         return;
     }
 
-#if !ENABLE(OILPAN)
 #if SECURITY_ASSERT_ENABLED
     m_deletionHasBegun = true;
 #endif
     delete this;
-#endif
 }
+#endif
 
 unsigned Node::connectedSubframeCount() const
 {
@@ -2563,6 +2568,12 @@
 
 void Node::trace(Visitor* visitor)
 {
+    visitor->trace(m_parentOrShadowHostNode);
+    visitor->trace(m_previous);
+    visitor->trace(m_next);
+    if (hasRareData())
+        visitor->trace(rareData());
+
     visitor->trace(m_treeScope);
 }
 
diff --git a/Source/core/dom/Node.h b/Source/core/dom/Node.h
index 0f523a0..f1b7b8c 100644
--- a/Source/core/dom/Node.h
+++ b/Source/core/dom/Node.h
@@ -109,12 +109,12 @@
     RenderObject* m_renderer;
 };
 
-class Node : public TreeShared<Node>, public EventTarget, public ScriptWrappable {
+class Node : public TreeSharedWillBeRefCountedGarbageCollected<Node>, public EventTarget, public ScriptWrappable {
     friend class Document;
     friend class TreeScope;
     friend class TreeScopeAdopter;
 
-    DEFINE_EVENT_TARGET_REFCOUNTING(TreeShared<Node>);
+    DEFINE_EVENT_TARGET_REFCOUNTING(TreeSharedWillBeRefCountedGarbageCollected<Node>);
 public:
     enum NodeType {
         ELEMENT_NODE = 1,
@@ -755,10 +755,10 @@
 
     Node(TreeScope* treeScope, ConstructionType type)
         : m_nodeFlags(type)
-        , m_parentOrShadowHostNode(0)
+        , m_parentOrShadowHostNode(nullptr)
         , m_treeScope(treeScope)
-        , m_previous(0)
-        , m_next(0)
+        , m_previous(nullptr)
+        , m_next(nullptr)
     {
         ASSERT(m_treeScope || type == CreateDocument || type == CreateShadowRoot);
         ScriptWrappable::init(this);
@@ -785,9 +785,9 @@
 
     NodeRareData* rareData() const;
     NodeRareData& ensureRareData();
+#if !ENABLE(OILPAN)
     void clearRareData();
 
-#if !ENABLE(OILPAN)
     void clearEventTargetData();
 #endif
 
@@ -814,7 +814,9 @@
         return NOPSEUDO;
     }
 
+#if !ENABLE(OILPAN)
     void removedLastRef();
+#endif
     bool hasTreeSharedParent() const { return !!parentOrShadowHostNode(); }
 
     enum EditableLevel { Editable, RichlyEditable };
@@ -840,10 +842,10 @@
     WillBeHeapHashSet<RawPtrWillBeMember<MutationObserverRegistration> >* transientMutationObserverRegistry();
 
     mutable uint32_t m_nodeFlags;
-    ContainerNode* m_parentOrShadowHostNode;
+    RawPtrWillBeMember<ContainerNode> m_parentOrShadowHostNode;
     RawPtrWillBeMember<TreeScope> m_treeScope;
-    Node* m_previous;
-    Node* m_next;
+    RawPtrWillBeMember<Node> m_previous;
+    RawPtrWillBeMember<Node> m_next;
     // When a node has rare data we move the renderer into the rare data.
     union DataUnion {
         DataUnion() : m_renderer(0) { }
diff --git a/Source/core/dom/NodeRareData.cpp b/Source/core/dom/NodeRareData.cpp
index dcb570e..c29894c 100644
--- a/Source/core/dom/NodeRareData.cpp
+++ b/Source/core/dom/NodeRareData.cpp
@@ -31,13 +31,14 @@
 #include "config.h"
 #include "core/dom/NodeRareData.h"
 #include "core/dom/Element.h"
+#include "core/dom/ElementRareData.h"
 #include "platform/heap/Handle.h"
 
 namespace WebCore {
 
 struct SameSizeAsNodeRareData {
     void* m_pointer[2];
-    OwnPtrWillBePersistent<NodeMutationObserverData> m_mutationObserverData;
+    OwnPtrWillBeMember<NodeMutationObserverData> m_mutationObserverData;
     unsigned m_bitfields;
 };
 
@@ -57,13 +58,26 @@
         it->value->invalidateCache();
 }
 
-void NodeRareData::dispose()
+void NodeRareData::traceAfterDispatch(Visitor* visitor)
 {
-    if (m_mutationObserverData) {
-        for (unsigned i = 0; i < m_mutationObserverData->registry.size(); i++)
-            m_mutationObserverData->registry.at(i)->dispose();
-        m_mutationObserverData.clear();
-    }
+    visitor->trace(m_mutationObserverData);
+}
+
+void NodeRareData::trace(Visitor* visitor)
+{
+    if (m_isElementRareData)
+        static_cast<ElementRareData*>(this)->traceAfterDispatch(visitor);
+    else
+        traceAfterDispatch(visitor);
+}
+
+void NodeRareData::finalizeGarbageCollectedObject()
+{
+    RELEASE_ASSERT(!renderer());
+    if (m_isElementRareData)
+        static_cast<ElementRareData*>(this)->~ElementRareData();
+    else
+        this->~NodeRareData();
 }
 
 // Ensure the 10 bits reserved for the m_connectedFrameCount cannot overflow
diff --git a/Source/core/dom/NodeRareData.h b/Source/core/dom/NodeRareData.h
index 9e8d139..91405c8 100644
--- a/Source/core/dom/NodeRareData.h
+++ b/Source/core/dom/NodeRareData.h
@@ -232,16 +232,15 @@
     NodeMutationObserverData() { }
 };
 
-class NodeRareData : public NodeRareDataBase {
-    WTF_MAKE_NONCOPYABLE(NodeRareData); WTF_MAKE_FAST_ALLOCATED;
+class NodeRareData : public NoBaseWillBeGarbageCollectedFinalized<NodeRareData>, public NodeRareDataBase {
+    WTF_MAKE_NONCOPYABLE(NodeRareData);
+    WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED;
 public:
-    static PassOwnPtr<NodeRareData> create(RenderObject* renderer)
+    static NodeRareData* create(RenderObject* renderer)
     {
-        return adoptPtr(new NodeRareData(renderer));
+        return new NodeRareData(renderer);
     }
 
-    void dispose();
-
     void clearNodeLists() { m_nodeLists.clear(); }
     NodeListsNodeData* nodeLists() const { return m_nodeLists.get(); }
     NodeListsNodeData& ensureNodeLists()
@@ -284,21 +283,29 @@
         ConnectedFrameCountBits = 10, // Must fit Page::maxNumberOfFrames.
     };
 
+    void trace(Visitor*);
+
+    void traceAfterDispatch(Visitor*);
+    void finalizeGarbageCollectedObject();
+
 protected:
     NodeRareData(RenderObject* renderer)
         : NodeRareDataBase(renderer)
         , m_connectedFrameCount(0)
         , m_elementFlags(0)
         , m_restyleFlags(0)
+        , m_isElementRareData(false)
     { }
 
 private:
     OwnPtr<NodeListsNodeData> m_nodeLists;
-    OwnPtrWillBePersistent<NodeMutationObserverData> m_mutationObserverData;
+    OwnPtrWillBeMember<NodeMutationObserverData> m_mutationObserverData;
 
     unsigned m_connectedFrameCount : ConnectedFrameCountBits;
     unsigned m_elementFlags : NumberOfElementFlags;
     unsigned m_restyleFlags : NumberOfDynamicRestyleFlags;
+protected:
+    unsigned m_isElementRareData : 1;
 };
 
 inline bool NodeListsNodeData::deleteThisAndUpdateNodeRareDataIfAboutToRemoveLastList(Node& ownerNode)
diff --git a/Source/core/dom/NodeRenderingTraversal.cpp b/Source/core/dom/NodeRenderingTraversal.cpp
index 6cee1a7..0a0c06f 100644
--- a/Source/core/dom/NodeRenderingTraversal.cpp
+++ b/Source/core/dom/NodeRenderingTraversal.cpp
@@ -245,7 +245,7 @@
 {
     if (!element->isInTopLayer())
         return 0;
-    const Vector<RefPtr<Element> >& topLayerElements = element->document().topLayerElements();
+    const WillBeHeapVector<RefPtrWillBeMember<Element> >& topLayerElements = element->document().topLayerElements();
     size_t position = topLayerElements.find(element);
     ASSERT(position != kNotFound);
     for (size_t i = position + 1; i < topLayerElements.size(); ++i) {
diff --git a/Source/core/dom/Position.cpp b/Source/core/dom/Position.cpp
index f180639..3ecc1ae 100644
--- a/Source/core/dom/Position.cpp
+++ b/Source/core/dom/Position.cpp
@@ -285,7 +285,7 @@
     return toElement(n);
 }
 
-PassRefPtr<CSSComputedStyleDeclaration> Position::computedStyle() const
+PassRefPtrWillBeRawPtr<CSSComputedStyleDeclaration> Position::computedStyle() const
 {
     Element* elem = element();
     if (!elem)
diff --git a/Source/core/dom/Position.h b/Source/core/dom/Position.h
index 8738b64..8bf2713 100644
--- a/Source/core/dom/Position.h
+++ b/Source/core/dom/Position.h
@@ -145,7 +145,7 @@
     bool isOrphan() const { return m_anchorNode && !m_anchorNode->inDocument(); }
 
     Element* element() const;
-    PassRefPtr<CSSComputedStyleDeclaration> computedStyle() const;
+    PassRefPtrWillBeRawPtr<CSSComputedStyleDeclaration> computedStyle() const;
 
     // Move up or down the DOM by one position.
     // Offsets are computed using render text for nodes that have renderers - but note that even when
diff --git a/Source/core/dom/ProcessingInstruction.cpp b/Source/core/dom/ProcessingInstruction.cpp
index f2da0a5..7e96ce9 100644
--- a/Source/core/dom/ProcessingInstruction.cpp
+++ b/Source/core/dom/ProcessingInstruction.cpp
@@ -55,10 +55,10 @@
 
 ProcessingInstruction::~ProcessingInstruction()
 {
+#if !ENABLE(OILPAN)
     if (m_sheet)
         m_sheet->clearOwnerNode();
 
-#if !ENABLE(OILPAN)
     if (inDocument())
         document().styleEngine()->removeStyleSheetCandidateNode(this);
 #endif
@@ -273,4 +273,10 @@
         document().removedStyleSheet(removedSheet.get());
 }
 
+void ProcessingInstruction::trace(Visitor* visitor)
+{
+    visitor->trace(m_sheet);
+    CharacterData::trace(visitor);
+}
+
 } // namespace
diff --git a/Source/core/dom/ProcessingInstruction.h b/Source/core/dom/ProcessingInstruction.h
index 53bc43d..4686d96 100644
--- a/Source/core/dom/ProcessingInstruction.h
+++ b/Source/core/dom/ProcessingInstruction.h
@@ -36,6 +36,7 @@
 public:
     static PassRefPtr<ProcessingInstruction> create(Document&, const String& target, const String& data);
     virtual ~ProcessingInstruction();
+    virtual void trace(Visitor*) OVERRIDE;
 
     const String& target() const { return m_target; }
 
@@ -75,7 +76,7 @@
     String m_localHref;
     String m_title;
     String m_media;
-    RefPtrWillBePersistent<StyleSheet> m_sheet;
+    RefPtrWillBeMember<StyleSheet> m_sheet;
     bool m_loading;
     bool m_alternate;
     bool m_createdByParser;
diff --git a/Source/core/dom/Promise.idl b/Source/core/dom/Promise.idl
index 45989d4..07d0aa4 100644
--- a/Source/core/dom/Promise.idl
+++ b/Source/core/dom/Promise.idl
@@ -32,7 +32,7 @@
 callback AnyCallback = any (optional any value);
 [
    CustomConstructor(PromiseInit init),
-   GlobalContext=Window&WorkerGlobalScope,
+   Exposed=Window&Worker
 ] interface Promise {
    [Custom] Promise then(optional AnyCallback fulfillCallback, optional AnyCallback rejectCallback);
    [Custom] Promise catch(optional AnyCallback rejectCallback);
diff --git a/Source/core/dom/Range.idl b/Source/core/dom/Range.idl
index 523d9a7..e73f6d3 100644
--- a/Source/core/dom/Range.idl
+++ b/Source/core/dom/Range.idl
@@ -82,7 +82,7 @@
     const unsigned short NODE_BEFORE_AND_AFTER = 2;
     const unsigned short NODE_INSIDE           = 3;
 
-    [RaisesException] short compareNode([Default=Undefined] optional Node refNode);
+    [RaisesException, MeasureAs=RangeCompareNode] short compareNode([Default=Undefined] optional Node refNode);
 
-    [RaisesException] void expand([Default=Undefined] optional DOMString unit);
+    [RaisesException, MeasureAs=RangeExpand] void expand([Default=Undefined] optional DOMString unit);
 };
diff --git a/Source/core/dom/ScriptLoader.cpp b/Source/core/dom/ScriptLoader.cpp
index 6585f8d..6c8c4a3 100644
--- a/Source/core/dom/ScriptLoader.cpp
+++ b/Source/core/dom/ScriptLoader.cpp
@@ -54,7 +54,6 @@
 
 ScriptLoader::ScriptLoader(Element* element, bool parserInserted, bool alreadyStarted)
     : m_element(element)
-    , m_resource(0)
     , m_startLineNumber(WTF::OrdinalNumber::beforeFirst())
     , m_parserInserted(parserInserted)
     , m_isExternalScript(false)
@@ -73,7 +72,6 @@
 
 ScriptLoader::~ScriptLoader()
 {
-    stopLoadRequest();
 }
 
 void ScriptLoader::didNotifySubtreeInsertionsToDocument()
@@ -165,10 +163,10 @@
 }
 
 // http://dev.w3.org/html5/spec/Overview.html#prepare-a-script
-bool ScriptLoader::prepareScript(const TextPosition& scriptStartPosition, LegacyTypeSupport supportLegacyTypes)
+ScriptPrep ScriptLoader::prepareScript(const TextPosition& scriptStartPosition, LegacyTypeSupport supportLegacyTypes)
 {
     if (m_alreadyStarted)
-        return false;
+        return ScriptPrep::failed();
 
     ScriptLoaderClient* client = this->client();
 
@@ -185,13 +183,13 @@
 
     // FIXME: HTML5 spec says we should check that all children are either comments or empty text nodes.
     if (!client->hasSourceAttribute() && !m_element->firstChild())
-        return false;
+        return ScriptPrep::failed();
 
     if (!m_element->inDocument())
-        return false;
+        return ScriptPrep::failed();
 
     if (!isScriptTypeSupported(supportLegacyTypes))
-        return false;
+        return ScriptPrep::failed();
 
     if (wasParserInserted) {
         m_parserInserted = true;
@@ -205,19 +203,24 @@
     Document* contextDocument = elementDocument.contextDocument().get();
 
     if (!contextDocument || !contextDocument->allowExecutingScripts(m_element))
-        return false;
+        return ScriptPrep::failed();
 
     if (!isScriptForEventSupported())
-        return false;
+        return ScriptPrep::failed();
 
     if (!client->charsetAttributeValue().isEmpty())
         m_characterEncoding = client->charsetAttributeValue();
     else
         m_characterEncoding = elementDocument.charset();
 
+    ResourcePtr<ScriptResource> resource;
     if (client->hasSourceAttribute()) {
-        if (!fetchScript(client->sourceAttributeValue()))
-            return false;
+        resource = fetchScript(client->sourceAttributeValue());
+        if (!resource) {
+            dispatchErrorEvent();
+            return ScriptPrep::failed();
+        }
+
     }
 
     if (client->hasSourceAttribute() && client->deferAttributeValue() && m_parserInserted && !client->asyncAttributeValue()) {
@@ -230,11 +233,9 @@
         m_readyToBeParserExecuted = true;
     } else if (client->hasSourceAttribute() && !client->asyncAttributeValue() && !m_forceAsync) {
         m_willExecuteInOrder = true;
-        contextDocument->scriptRunner()->queueScriptForExecution(this, m_resource, ScriptRunner::IN_ORDER_EXECUTION);
-        m_resource->addClient(this);
+        contextDocument->scriptRunner()->queueScriptForExecution(this, resource, ScriptRunner::IN_ORDER_EXECUTION);
     } else if (client->hasSourceAttribute()) {
-        contextDocument->scriptRunner()->queueScriptForExecution(this, m_resource, ScriptRunner::ASYNC_EXECUTION);
-        m_resource->addClient(this);
+        contextDocument->scriptRunner()->queueScriptForExecution(this, resource, ScriptRunner::ASYNC_EXECUTION);
     } else {
         // Reset line numbering for nested writes.
         TextPosition position = elementDocument.isInDocumentWrite() ? TextPosition() : scriptStartPosition;
@@ -242,18 +243,25 @@
         executeScript(ScriptSourceCode(scriptContent(), scriptURL, position));
     }
 
-    return true;
+    // FIXME: This second "subscribing" parameter is a mess. We shouldn't have to need this.
+    if (resource)
+        setResource(resource, !m_willBeParserExecuted);
+
+    // We have to return fetchedResource instead of let callers ask ScriptLoader::resource()
+    // because resource() can be null when it is accessed: Following setResource() can trigger clearResource().
+    return ScriptPrep(true, resource);
 }
 
-bool ScriptLoader::fetchScript(const String& sourceUrl)
+ResourcePtr<ScriptResource> ScriptLoader::fetchScript(const String& sourceUrl)
 {
     ASSERT(m_element);
 
-    RefPtr<Document> elementDocument(m_element->document());
+    RefPtrWillBeRawPtr<Document> elementDocument(m_element->document());
     if (!m_element->inDocument() || m_element->document() != elementDocument)
-        return false;
+        return ResourcePtr<ScriptResource>();
 
-    ASSERT(!m_resource);
+    ASSERT(!resource());
+    ResourcePtr<ScriptResource> resource;
     if (!stripLeadingAndTrailingHTMLSpaces(sourceUrl).isEmpty()) {
         FetchRequest request(ResourceRequest(elementDocument->completeURL(sourceUrl)), m_element->localName());
 
@@ -266,15 +274,11 @@
         if (isValidScriptNonce)
             request.setContentSecurityCheck(DoNotCheckContentSecurityPolicy);
 
-        m_resource = elementDocument->fetcher()->fetchScript(request);
+        resource = elementDocument->fetcher()->fetchScript(request);
         m_isExternalScript = true;
     }
 
-    if (m_resource)
-        return true;
-
-    dispatchErrorEvent();
-    return false;
+    return resource;
 }
 
 bool isHTMLScriptLoader(Element* element)
@@ -309,7 +313,7 @@
         return;
 
     if (m_isExternalScript) {
-        ScriptResource* resource = m_resource ? m_resource.get() : sourceCode.resource();
+        ScriptResource* resource = this->resource() ? this->resource() : sourceCode.resource();
         if (resource && !resource->mimeTypeAllowedByNosniff()) {
             contextDocument->addConsoleMessage(SecurityMessageSource, ErrorMessageLevel, "Refused to execute script from '" + resource->url().elidedString() + "' because its MIME type ('" + resource->mimeType() + "') is not executable, and strict MIME type checking is enabled.");
             return;
@@ -341,15 +345,6 @@
     }
 }
 
-void ScriptLoader::stopLoadRequest()
-{
-    if (m_resource) {
-        if (!m_willBeParserExecuted)
-            m_resource->removeClient(this);
-        m_resource = 0;
-    }
-}
-
 void ScriptLoader::execute(ScriptResource* resource)
 {
     ASSERT(!m_willBeParserExecuted);
@@ -360,12 +355,13 @@
         executeScript(ScriptSourceCode(resource));
         dispatchLoadEvent();
     }
-    resource->removeClient(this);
+
+    clearResource();
 }
 
 void ScriptLoader::cancel(Document* contextDocument)
 {
-    if (!m_resource)
+    if (!resource())
         return;
     finishLoading(contextDocument, FinishWithCancel);
 }
@@ -375,11 +371,12 @@
     // Resource possibly invokes this notifyFinished() more than
     // once because ScriptLoader doesn't unsubscribe itself from
     // Resource here and does it in execute() instead.
-    // We use m_resource to check if this function is already called.
-    ASSERT_UNUSED(resource, resource == m_resource);
-    if (!m_resource)
+    // We use resource() to check if this function is already called.
+    ASSERT_UNUSED(resource, resource == this->resource());
+    if (!this->resource())
         return;
 
+    RefPtr<Element> protect(m_element);
     RefPtr<Document> elementDocument(m_element->document());
     RefPtr<Document> contextDocument = elementDocument->contextDocument().get();
     finishLoading(contextDocument.get(), resource->errorOccurred() ? FinishWithError : FinishSuccessfully);
@@ -387,29 +384,28 @@
 
 void ScriptLoader::finishLoading(Document* contextDocument, ScriptLoader::FinishType type)
 {
-    if (!contextDocument)
-        return;
+    if (!m_willBeParserExecuted && contextDocument)
+        notifyRunnerFinishLoading(contextDocument->scriptRunner(), type);
+    clearResource();
+}
 
+void ScriptLoader::notifyRunnerFinishLoading(ScriptRunner* runner, ScriptLoader::FinishType type)
+{
     switch (type) {
     case FinishWithCancel:
-        if (!m_willBeParserExecuted)
-            contextDocument->scriptRunner()->notifyScriptLoadError(this, m_willExecuteInOrder ? ScriptRunner::IN_ORDER_EXECUTION : ScriptRunner::ASYNC_EXECUTION);
-        stopLoadRequest();
+        runner->notifyScriptLoadError(this, m_willExecuteInOrder ? ScriptRunner::IN_ORDER_EXECUTION : ScriptRunner::ASYNC_EXECUTION);
         break;
     case FinishWithError:
-        ASSERT(!m_willBeParserExecuted);
         dispatchErrorEvent();
-        contextDocument->scriptRunner()->notifyScriptLoadError(this, m_willExecuteInOrder ? ScriptRunner::IN_ORDER_EXECUTION : ScriptRunner::ASYNC_EXECUTION);
-        m_resource = 0;
+        runner->notifyScriptLoadError(this, m_willExecuteInOrder ? ScriptRunner::IN_ORDER_EXECUTION : ScriptRunner::ASYNC_EXECUTION);
         break;
     case FinishSuccessfully:
-        ASSERT(!m_willBeParserExecuted);
-        contextDocument->scriptRunner()->notifyScriptReady(this, m_willExecuteInOrder ? ScriptRunner::IN_ORDER_EXECUTION : ScriptRunner::ASYNC_EXECUTION);
-        m_resource = 0;
+        runner->notifyScriptReady(this, m_willExecuteInOrder ? ScriptRunner::IN_ORDER_EXECUTION : ScriptRunner::ASYNC_EXECUTION);
         break;
     }
 }
 
+
 bool ScriptLoader::ignoresLoadRequest() const
 {
     return m_alreadyStarted || m_isExternalScript || m_parserInserted || !element() || !element()->inDocument();
diff --git a/Source/core/dom/ScriptLoader.h b/Source/core/dom/ScriptLoader.h
index a862e33..d0a814b 100644
--- a/Source/core/dom/ScriptLoader.h
+++ b/Source/core/dom/ScriptLoader.h
@@ -22,7 +22,9 @@
 #define ScriptLoader_h
 
 #include "core/fetch/ResourceClient.h"
+#include "core/fetch/ResourceOwner.h"
 #include "core/fetch/ResourcePtr.h"
+#include "core/fetch/ScriptResource.h"
 #include "wtf/text/TextPosition.h"
 #include "wtf/text/WTFString.h"
 
@@ -33,10 +35,31 @@
 class Document;
 class Element;
 class ScriptLoaderClient;
+class ScriptRunner;
 class ScriptSourceCode;
 
+class ScriptPrep FINAL {
+public:
+    ScriptPrep(bool succeeded, const ResourcePtr<ScriptResource>& resource)
+        : m_succeeded(succeeded)
+        , m_resource(resource)
+    { }
 
-class ScriptLoader FINAL : private ResourceClient {
+    bool succeeded() const { return m_succeeded; }
+    ScriptResource* resource() const { return m_resource.get(); }
+
+    static ScriptPrep failed() { return ScriptPrep(); }
+
+private:
+    ScriptPrep()
+        : m_succeeded(false)
+    { }
+
+    bool m_succeeded;
+    ResourcePtr<ScriptResource> m_resource;
+};
+
+class ScriptLoader FINAL : public ResourceOwner<ScriptResource> {
 public:
     static PassOwnPtr<ScriptLoader> create(Element*, bool createdByParser, bool isEvaluated);
     virtual ~ScriptLoader();
@@ -44,7 +67,7 @@
     Element* element() const { return m_element; }
 
     enum LegacyTypeSupport { DisallowLegacyTypeInTypeAttribute, AllowLegacyTypeInTypeAttribute };
-    bool prepareScript(const TextPosition& scriptStartPosition = TextPosition::minimumPosition(), LegacyTypeSupport = DisallowLegacyTypeInTypeAttribute);
+    ScriptPrep prepareScript(const TextPosition& scriptStartPosition = TextPosition::minimumPosition(), LegacyTypeSupport = DisallowLegacyTypeInTypeAttribute);
 
     String scriptCharset() const { return m_characterEncoding; }
     String scriptContent() const;
@@ -60,7 +83,6 @@
     bool willBeParserExecuted() const { return m_willBeParserExecuted; }
     bool readyToBeParserExecuted() const { return m_readyToBeParserExecuted; }
     bool willExecuteWhenDocumentFinishedParsing() const { return m_willExecuteWhenDocumentFinishedParsing; }
-    ResourcePtr<ScriptResource> resource() { return m_resource; }
 
     void setHaveFiredLoadEvent(bool haveFiredLoad) { m_haveFiredLoad = haveFiredLoad; }
     bool isParserInserted() const { return m_parserInserted; }
@@ -80,8 +102,7 @@
     bool ignoresLoadRequest() const;
     bool isScriptForEventSupported() const;
 
-    bool fetchScript(const String& sourceUrl);
-    void stopLoadRequest();
+    ResourcePtr<ScriptResource> fetchScript(const String& sourceUrl);
 
     ScriptLoaderClient* client() const;
 
@@ -95,9 +116,9 @@
     };
 
     void finishLoading(Document* contextDocument, FinishType);
+    void notifyRunnerFinishLoading(ScriptRunner*, FinishType);
 
     Element* m_element;
-    ResourcePtr<ScriptResource> m_resource;
     WTF::OrdinalNumber m_startLineNumber;
     bool m_parserInserted : 1;
     bool m_isExternalScript : 1;
diff --git a/Source/core/dom/ScriptedAnimationController.cpp b/Source/core/dom/ScriptedAnimationController.cpp
index 9f60acb..1838e6d 100644
--- a/Source/core/dom/ScriptedAnimationController.cpp
+++ b/Source/core/dom/ScriptedAnimationController.cpp
@@ -76,6 +76,7 @@
     scheduleAnimationIfNeeded();
 
     TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "RequestAnimationFrame", "data", InspectorAnimationFrameEvent::data(m_document, id));
+    TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline.stack"), "CallStack", "stack", InspectorCallStackEvent::currentCallStack());
     // FIXME(361045): remove InspectorInstrumentation calls once DevTools Timeline migrates to tracing.
     InspectorInstrumentation::didRequestAnimationFrame(m_document, id);
 
@@ -87,6 +88,7 @@
     for (size_t i = 0; i < m_callbacks.size(); ++i) {
         if (m_callbacks[i]->m_id == id) {
             TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "CancelAnimationFrame", "data", InspectorAnimationFrameEvent::data(m_document, id));
+            TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline.stack"), "CallStack", "stack", InspectorCallStackEvent::currentCallStack());
             // FIXME(361045): remove InspectorInstrumentation calls once DevTools Timeline migrates to tracing.
             InspectorInstrumentation::didCancelAnimationFrame(m_document, id);
             m_callbacks.remove(i);
@@ -96,6 +98,7 @@
     for (size_t i = 0; i < m_callbacksToInvoke.size(); ++i) {
         if (m_callbacksToInvoke[i]->m_id == id) {
             TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "CancelAnimationFrame", "data", InspectorAnimationFrameEvent::data(m_document, id));
+            TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline.stack"), "CallStack", "stack", InspectorCallStackEvent::currentCallStack());
             // FIXME(361045): remove InspectorInstrumentation calls once DevTools Timeline migrates to tracing.
             InspectorInstrumentation::didCancelAnimationFrame(m_document, id);
             m_callbacksToInvoke[i]->m_cancelled = true;
@@ -148,6 +151,7 @@
             else
                 callback->handleEvent(highResNowMs);
             InspectorInstrumentation::didFireAnimationFrame(cookie);
+            TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "UpdateCounters", "data", InspectorUpdateCountersEvent::data());
         }
     }
 
diff --git a/Source/core/dom/StyleElement.cpp b/Source/core/dom/StyleElement.cpp
index cbe3765..f27d81d 100644
--- a/Source/core/dom/StyleElement.cpp
+++ b/Source/core/dom/StyleElement.cpp
@@ -52,8 +52,10 @@
 
 StyleElement::~StyleElement()
 {
+#if !ENABLE(OILPAN)
     if (m_sheet)
         clearSheet();
+#endif
 }
 
 void StyleElement::processStyleSheet(Document& document, Element* element)
@@ -187,4 +189,9 @@
     document.styleEngine()->addPendingSheet();
 }
 
+void StyleElement::trace(Visitor* visitor)
+{
+    visitor->trace(m_sheet);
+}
+
 }
diff --git a/Source/core/dom/StyleElement.h b/Source/core/dom/StyleElement.h
index 5bbf09b..4f76cad 100644
--- a/Source/core/dom/StyleElement.h
+++ b/Source/core/dom/StyleElement.h
@@ -31,10 +31,11 @@
 class Element;
 class TreeScope;
 
-class StyleElement {
+class StyleElement : public WillBeGarbageCollectedMixin {
 public:
     StyleElement(Document*, bool createdByParser);
     virtual ~StyleElement();
+    virtual void trace(Visitor*);
 
 protected:
     virtual const AtomicString& type() const = 0;
@@ -53,7 +54,7 @@
     void childrenChanged(Element*);
     void finishParsingChildren(Element*);
 
-    RefPtrWillBePersistent<CSSStyleSheet> m_sheet;
+    RefPtrWillBeMember<CSSStyleSheet> m_sheet;
 
 private:
     void createSheet(Element*, const String& text = String());
diff --git a/Source/core/dom/StyleEngine.cpp b/Source/core/dom/StyleEngine.cpp
index a62b970..41e41f2 100644
--- a/Source/core/dom/StyleEngine.cpp
+++ b/Source/core/dom/StyleEngine.cpp
@@ -54,7 +54,7 @@
 using namespace HTMLNames;
 
 StyleEngine::StyleEngine(Document& document)
-    : m_document(document)
+    : m_document(&document)
     , m_isMaster(!document.importsController() || document.importsController()->isMaster(document) )
     , m_pendingStylesheets(0)
     , m_injectedStyleSheetCacheValid(false)
@@ -78,6 +78,7 @@
 {
 }
 
+#if !ENABLE(OILPAN)
 void StyleEngine::detachFromDocument()
 {
     // Cleanup is performed eagerly when the StyleEngine is removed from the
@@ -90,10 +91,8 @@
 
     if (m_fontSelector) {
         m_fontSelector->clearDocument();
-#if !ENABLE(OILPAN)
         if (m_resolver)
             m_fontSelector->unregisterForInvalidationCallbacks(m_resolver.get());
-#endif
     }
 
     // Decrement reference counts for things we could be keeping alive.
@@ -101,12 +100,13 @@
     m_resolver.clear();
     m_styleSheetCollectionMap.clear();
 }
+#endif
 
 inline Document* StyleEngine::master()
 {
     if (isMaster())
-        return &m_document;
-    HTMLImportsController* import = m_document.importsController();
+        return m_document;
+    HTMLImportsController* import = document().importsController();
     if (!import) // Document::import() can return null while executing its destructor.
         return 0;
     return import->master();
@@ -202,18 +202,18 @@
     m_injectedStyleSheetCacheValid = true;
     m_injectedAuthorStyleSheets.clear();
 
-    Page* owningPage = m_document.page();
+    Page* owningPage = document().page();
     if (!owningPage)
         return;
 
     const InjectedStyleSheetEntryVector& entries = InjectedStyleSheets::instance().entries();
     for (unsigned i = 0; i < entries.size(); ++i) {
         const InjectedStyleSheetEntry* entry = entries[i].get();
-        if (entry->injectedFrames() == InjectStyleInTopFrameOnly && m_document.ownerElement())
+        if (entry->injectedFrames() == InjectStyleInTopFrameOnly && document().ownerElement())
             continue;
-        if (!URLPatternMatcher::matchesPatterns(m_document.url(), entry->whitelist()))
+        if (!URLPatternMatcher::matchesPatterns(document().url(), entry->whitelist()))
             continue;
-        RefPtrWillBeRawPtr<CSSStyleSheet> groupSheet = CSSStyleSheet::createInline(const_cast<Document*>(&m_document), KURL());
+        RefPtrWillBeRawPtr<CSSStyleSheet> groupSheet = CSSStyleSheet::createInline(m_document, KURL());
         m_injectedAuthorStyleSheets.append(groupSheet);
         groupSheet->contents()->parseString(entry->source());
     }
@@ -225,13 +225,13 @@
     markDocumentDirty();
     // FIXME: updateInjectedStyleSheetCache is called inside StyleSheetCollection::updateActiveStyleSheets
     // and batch updates lots of sheets so we can't call addedStyleSheet() or removedStyleSheet().
-    m_document.styleResolverChanged(RecalcStyleDeferred);
+    document().styleResolverChanged(RecalcStyleDeferred);
 }
 
 void StyleEngine::addAuthorSheet(PassRefPtrWillBeRawPtr<StyleSheetContents> authorSheet)
 {
-    m_authorStyleSheets.append(CSSStyleSheet::create(authorSheet, &m_document));
-    m_document.addedStyleSheet(m_authorStyleSheets.last().get(), RecalcStyleImmediately);
+    m_authorStyleSheets.append(CSSStyleSheet::create(authorSheet, m_document));
+    document().addedStyleSheet(m_authorStyleSheets.last().get(), RecalcStyleImmediately);
     markDocumentDirty();
 }
 
@@ -244,7 +244,7 @@
 void StyleEngine::removePendingSheet(Node* styleSheetCandidateNode, RemovePendingSheetNotificationType notification)
 {
     ASSERT(styleSheetCandidateNode);
-    TreeScope* treeScope = isHTMLStyleElement(*styleSheetCandidateNode) ? &styleSheetCandidateNode->treeScope() : &m_document;
+    TreeScope* treeScope = isHTMLStyleElement(*styleSheetCandidateNode) ? &styleSheetCandidateNode->treeScope() : m_document.get();
     markTreeScopeDirty(*treeScope);
 
     // Make sure we knew this sheet was pending, and that our count isn't out of sync.
@@ -255,13 +255,13 @@
         return;
 
     if (notification == RemovePendingSheetNotifyLater) {
-        m_document.setNeedsNotifyRemoveAllPendingStylesheet();
+        document().setNeedsNotifyRemoveAllPendingStylesheet();
         return;
     }
 
     // FIXME: We can't call addedStyleSheet or removedStyleSheet here because we don't know
     // what's new. We should track that to tell the style system what changed.
-    m_document.didRemoveAllPendingStylesheet();
+    document().didRemoveAllPendingStylesheet();
 }
 
 void StyleEngine::modifiedStyleSheet(StyleSheet* sheet)
@@ -273,7 +273,7 @@
     if (!node || !node->inDocument())
         return;
 
-    TreeScope& treeScope = isHTMLStyleElement(*node) ? node->treeScope() : m_document;
+    TreeScope& treeScope = isHTMLStyleElement(*node) ? node->treeScope() : *m_document;
     ASSERT(isHTMLStyleElement(node) || treeScope == m_document);
 
     markTreeScopeDirty(treeScope);
@@ -284,7 +284,7 @@
     if (!node->inDocument())
         return;
 
-    TreeScope& treeScope = isHTMLStyleElement(*node) ? node->treeScope() : m_document;
+    TreeScope& treeScope = isHTMLStyleElement(*node) ? node->treeScope() : *m_document;
     ASSERT(isHTMLStyleElement(node) || treeScope == m_document);
 
     TreeScopeStyleSheetCollection* collection = ensureStyleSheetCollectionFor(treeScope);
@@ -298,7 +298,7 @@
 
 void StyleEngine::removeStyleSheetCandidateNode(Node* node)
 {
-    removeStyleSheetCandidateNode(node, 0, m_document);
+    removeStyleSheetCandidateNode(node, 0, *m_document);
 }
 
 void StyleEngine::removeStyleSheetCandidateNode(Node* node, ContainerNode* scopingNode, TreeScope& treeScope)
@@ -318,7 +318,7 @@
     if (!node->inDocument())
         return;
 
-    TreeScope& treeScope = isHTMLStyleElement(*node) ? node->treeScope() : m_document;
+    TreeScope& treeScope = isHTMLStyleElement(*node) ? node->treeScope() : *m_document;
     ASSERT(isHTMLStyleElement(node) || treeScope == m_document);
     markTreeScopeDirty(treeScope);
 }
@@ -358,9 +358,9 @@
 bool StyleEngine::updateActiveStyleSheets(StyleResolverUpdateMode updateMode)
 {
     ASSERT(isMaster());
-    ASSERT(!m_document.inStyleRecalc());
+    ASSERT(!document().inStyleRecalc());
 
-    if (!m_document.isActive())
+    if (!document().isActive())
         return false;
 
     bool requiresFullStyleRecalc = false;
@@ -383,7 +383,7 @@
         m_activeTreeScopes.removeAll(treeScopesRemoved);
     }
 
-    InspectorInstrumentation::activeStyleSheetsUpdated(&m_document);
+    InspectorInstrumentation::activeStyleSheetsUpdated(m_document);
     m_usesRemUnits = m_documentStyleSheetCollection.usesRemUnits();
 
     m_dirtyTreeScopes.clear();
@@ -444,10 +444,10 @@
     // which is not in a frame. Code which hits this should have checked
     // Document::isActive() before calling into code which could get here.
 
-    ASSERT(m_document.frame());
+    ASSERT(document().frame());
     ASSERT(m_fontSelector);
 
-    m_resolver = adoptPtrWillBeNoop(new StyleResolver(m_document));
+    m_resolver = adoptPtrWillBeNoop(new StyleResolver(*m_document));
     appendActiveAuthorStyleSheets();
     m_fontSelector->registerForInvalidationCallbacks(m_resolver.get());
     combineCSSFeatureFlags(m_resolver->ensureUpdatedRuleFeatureSet());
@@ -455,11 +455,11 @@
 
 void StyleEngine::clearResolver()
 {
-    ASSERT(!m_document.inStyleRecalc());
+    ASSERT(!document().inStyleRecalc());
     ASSERT(isMaster() || !m_resolver);
     ASSERT(m_fontSelector || !m_resolver);
     if (m_resolver) {
-        m_document.updateStyleInvalidationIfNeeded();
+        document().updateStyleInvalidationIfNeeded();
 #if !ENABLE(OILPAN)
         m_fontSelector->unregisterForInvalidationCallbacks(m_resolver.get());
 #endif
@@ -500,13 +500,13 @@
 
     // Don't bother updating, since we haven't loaded all our style info yet
     // and haven't calculated the style selector for the first time.
-    if (!m_document.isActive() || shouldClearResolver()) {
+    if (!document().isActive() || shouldClearResolver()) {
         clearResolver();
         return change;
     }
 
     m_didCalculateResolver = true;
-    if (m_document.didLayoutWithPendingStylesheets() && !hasPendingSheets())
+    if (document().didLayoutWithPendingStylesheets() && !hasPendingSheets())
         change.setNeedsRepaint();
 
     if (updateActiveStyleSheets(mode))
@@ -529,7 +529,7 @@
     if (!m_fontSelector)
         return;
 
-    m_fontSelector->updateGenericFontFamilySettings(m_document);
+    m_fontSelector->updateGenericFontFamilySettings(*m_document);
     if (m_resolver)
         m_resolver->invalidateMatchedPropertiesCache();
 }
@@ -559,8 +559,8 @@
 void StyleEngine::markDocumentDirty()
 {
     m_documentScopeDirty = true;
-    if (m_document.importLoader())
-        m_document.importsController()->master()->styleEngine()->markDocumentDirty();
+    if (document().importLoader())
+        document().importsController()->master()->styleEngine()->markDocumentDirty();
 }
 
 static bool isCacheableForStyleElement(const StyleSheetContents& contents)
@@ -631,6 +631,7 @@
 
 void StyleEngine::trace(Visitor* visitor)
 {
+    visitor->trace(m_document);
     visitor->trace(m_injectedAuthorStyleSheets);
     visitor->trace(m_authorStyleSheets);
     visitor->trace(m_documentStyleSheetCollection);
diff --git a/Source/core/dom/StyleEngine.h b/Source/core/dom/StyleEngine.h
index d2a35e7..b1c737d 100644
--- a/Source/core/dom/StyleEngine.h
+++ b/Source/core/dom/StyleEngine.h
@@ -90,7 +90,9 @@
 
     ~StyleEngine();
 
+#if !ENABLE(OILPAN)
     void detachFromDocument();
+#endif
 
     const WillBeHeapVector<RefPtrWillBeMember<StyleSheet> >& styleSheetsForStyleSheetList(TreeScope&);
     const WillBeHeapVector<RefPtrWillBeMember<CSSStyleSheet> >& activeAuthorStyleSheets() const;
@@ -201,6 +203,7 @@
 
     bool isMaster() const { return m_isMaster; }
     Document* master();
+    Document& document() const { return *m_document; }
 
     typedef ListHashSet<TreeScope*, 16> TreeScopeSet;
     static void insertTreeScopeInDocumentOrder(TreeScopeSet&, TreeScope*);
@@ -210,7 +213,7 @@
 
     static PassRefPtrWillBeRawPtr<CSSStyleSheet> parseSheet(Element*, const String& text, TextPosition startPosition, bool createdByParser);
 
-    Document& m_document;
+    RawPtrWillBeMember<Document> m_document;
     bool m_isMaster;
 
     // Track the number of currently loading top-level stylesheets needed for rendering.
diff --git a/Source/core/dom/Touch.idl b/Source/core/dom/Touch.idl
index 06e93d9..7ff3d97 100644
--- a/Source/core/dom/Touch.idl
+++ b/Source/core/dom/Touch.idl
@@ -34,8 +34,8 @@
     readonly attribute long             pageY;
     readonly attribute EventTarget      target;
     readonly attribute unsigned long    identifier;
-    readonly attribute long             webkitRadiusX;
-    readonly attribute long             webkitRadiusY;
-    readonly attribute float            webkitRotationAngle;
-    readonly attribute float            webkitForce;
+    [MeasureAs=PrefixedTouchRadiusX] readonly attribute long webkitRadiusX;
+    [MeasureAs=PrefixedTouchRadiusY] readonly attribute long webkitRadiusY;
+    [MeasureAs=PrefixedTouchRotationAngle] readonly attribute float webkitRotationAngle;
+    [MeasureAs=PrefixedTouchForce] readonly attribute float webkitForce;
 };
diff --git a/Source/core/dom/TreeScope.cpp b/Source/core/dom/TreeScope.cpp
index f77d2fc..efe9c50 100644
--- a/Source/core/dom/TreeScope.cpp
+++ b/Source/core/dom/TreeScope.cpp
@@ -56,7 +56,7 @@
 using namespace HTMLNames;
 
 TreeScope::TreeScope(ContainerNode& rootNode, Document& document)
-    : m_rootNode(rootNode)
+    : m_rootNode(&rootNode)
     , m_document(&document)
     , m_parentTreeScope(&document)
 #if !ENABLE(OILPAN)
@@ -68,7 +68,7 @@
 #if !ENABLE(OILPAN)
     m_parentTreeScope->guardRef();
 #endif
-    m_rootNode.setTreeScope(this);
+    m_rootNode->setTreeScope(this);
 }
 
 TreeScope::TreeScope(Document& document)
@@ -80,17 +80,15 @@
 #endif
     , m_idTargetObserverRegistry(IdTargetObserverRegistry::create())
 {
-    m_rootNode.setTreeScope(this);
+    m_rootNode->setTreeScope(this);
 }
 
 TreeScope::~TreeScope()
 {
 #if !ENABLE(OILPAN)
     ASSERT(!m_guardRefCount);
-#endif
-    m_rootNode.setTreeScope(0);
+    m_rootNode->setTreeScope(0);
 
-#if !ENABLE(OILPAN)
     if (m_selection) {
         m_selection->clearTreeScope();
         m_selection = nullptr;
@@ -124,12 +122,14 @@
     return rootNode().hasTreeSharedParent();
 }
 
+#if !ENABLE(OILPAN)
 void TreeScope::destroyTreeScopeData()
 {
     m_elementsById.clear();
     m_imageMapsByName.clear();
     m_labelsByForAttribute.clear();
 }
+#endif
 
 void TreeScope::setParentTreeScope(TreeScope& newParentScope)
 {
@@ -338,7 +338,9 @@
 {
     ASSERT(this);
     ASSERT(!node.isDocumentNode());
+#if !ENABLE(OILPAN)
     ASSERT_WITH_SECURITY_IMPLICATION(!node.m_deletionHasBegun);
+#endif
     TreeScopeAdopter adopter(node, *this);
     if (adopter.needsScopeChange())
         adopter.execute();
@@ -479,7 +481,7 @@
     return treeScopesA[indexA] == treeScopesB[indexB] ? treeScopesA[indexA] : 0;
 }
 
-#if SECURITY_ASSERT_ENABLED
+#if SECURITY_ASSERT_ENABLED && !ENABLE(OILPAN)
 bool TreeScope::deletionHasBegun()
 {
     return rootNode().m_deletionHasBegun;
@@ -491,10 +493,12 @@
 }
 #endif
 
+#if !ENABLE(OILPAN)
 int TreeScope::refCount() const
 {
     return rootNode().refCount();
 }
+#endif
 
 bool TreeScope::isInclusiveAncestorOf(const TreeScope& scope) const
 {
@@ -535,6 +539,8 @@
 
 void TreeScope::trace(Visitor* visitor)
 {
+    visitor->trace(m_rootNode);
+    visitor->trace(m_document);
     visitor->trace(m_parentTreeScope);
     visitor->trace(m_selection);
 }
diff --git a/Source/core/dom/TreeScope.h b/Source/core/dom/TreeScope.h
index 9c61b1b..78ad612 100644
--- a/Source/core/dom/TreeScope.h
+++ b/Source/core/dom/TreeScope.h
@@ -98,7 +98,7 @@
     // Used by the basic DOM mutation methods (e.g., appendChild()).
     void adoptIfNeeded(Node&);
 
-    Node& rootNode() const { return m_rootNode; }
+    Node& rootNode() const { return *m_rootNode; }
 
     IdTargetObserverRegistry& idTargetObserverRegistry() const { return *m_idTargetObserverRegistry.get(); }
 
@@ -144,7 +144,10 @@
     TreeScope(Document&);
     virtual ~TreeScope();
 
+#if !ENABLE(OILPAN)
     void destroyTreeScopeData();
+#endif
+
     void setDocument(Document& document) { m_document = &document; }
     void setParentTreeScope(TreeScope&);
 
@@ -157,7 +160,9 @@
 private:
     virtual void dispose() { }
 
+#if !ENABLE(OILPAN)
     int refCount() const;
+
 #if SECURITY_ASSERT_ENABLED
     bool deletionHasBegun();
     void beginDeletion();
@@ -165,11 +170,12 @@
     bool deletionHasBegun() { return false; }
     void beginDeletion() { }
 #endif
+#endif
 
     bool rootNodeHasTreeSharedParent() const;
 
-    Node& m_rootNode;
-    Document* m_document;
+    RawPtrWillBeMember<Node> m_rootNode;
+    RawPtrWillBeMember<Document> m_document;
     RawPtrWillBeMember<TreeScope> m_parentTreeScope;
 
 #if !ENABLE(OILPAN)
diff --git a/Source/core/dom/TreeShared.h b/Source/core/dom/TreeShared.h
index 71a4a5e..65ef726 100644
--- a/Source/core/dom/TreeShared.h
+++ b/Source/core/dom/TreeShared.h
@@ -38,9 +38,6 @@
 protected:
     TreeShared()
         : m_refCount(1)
-#if ENABLE(OILPAN)
-        , m_keepAlive(adoptPtr(new Persistent<NodeType>(static_cast<NodeType*>(this))))
-#endif
 #if SECURITY_ASSERT_ENABLED
         , m_deletionHasBegun(false)
 #if ASSERT_ENABLED
@@ -56,11 +53,7 @@
     {
         ASSERT(isMainThread());
         ASSERT(!m_refCount);
-#if !ENABLE(OILPAN)
         ASSERT_WITH_SECURITY_IMPLICATION(m_deletionHasBegun);
-#else
-        ASSERT(!m_keepAlive);
-#endif
         ASSERT(!m_adoptionIsRequired);
     }
 
@@ -68,64 +61,33 @@
     void ref()
     {
         ASSERT(isMainThread());
-#if !ENABLE(OILPAN)
         ASSERT_WITH_SECURITY_IMPLICATION(!m_deletionHasBegun);
         ASSERT(!m_inRemovedLastRefFunction);
-#endif
         ASSERT(!m_adoptionIsRequired);
         ++m_refCount;
-#if ENABLE(OILPAN)
-        if (!m_keepAlive)
-            m_keepAlive = adoptPtr(new Persistent<NodeType>(static_cast<NodeType*>(this)));
-#endif
     }
 
     void deref()
     {
         ASSERT(isMainThread());
         ASSERT(m_refCount > 0);
-#if !ENABLE(OILPAN)
         ASSERT_WITH_SECURITY_IMPLICATION(!m_deletionHasBegun);
         ASSERT(!m_inRemovedLastRefFunction);
-#endif
         ASSERT(!m_adoptionIsRequired);
         NodeType* thisNode = static_cast<NodeType*>(this);
         if (!--m_refCount && !thisNode->hasTreeSharedParent()) {
 #if !ASSERT_DISABLED
             m_inRemovedLastRefFunction = true;
 #endif
-#if ENABLE(OILPAN)
-            clearKeepAlive();
-#endif
             thisNode->removedLastRef();
         }
     }
 
     int refCount() const { return m_refCount; }
 
-#if ENABLE(OILPAN)
-    void clearKeepAlive()
-    {
-        ASSERT(m_keepAlive);
-        m_keepAlive = nullptr;
-    }
-#endif
-
 private:
     int m_refCount;
 
-#if ENABLE(OILPAN)
-    // With Oilpan, a non-zero reference count will keep the TreeShared object alive
-    // with a self-persistent handle. Whenever the ref count goes above zero
-    // we register the TreeShared as a root for garbage collection by allocating a
-    // persistent handle to the object itself. When the ref count goes to zero
-    // we deallocate the persistent handle again so the object can die if there
-    // are no other things keeping it alive.
-    //
-    // FIXME: Oilpan: Remove m_keepAlive and ref counting and use tracing instead.
-    OwnPtr<Persistent<NodeType> > m_keepAlive;
-#endif
-
 #if SECURITY_ASSERT_ENABLED
 public:
     bool m_deletionHasBegun;
diff --git a/Source/core/dom/URL.idl b/Source/core/dom/URL.idl
index f5bf93f..bad85f2 100644
--- a/Source/core/dom/URL.idl
+++ b/Source/core/dom/URL.idl
@@ -25,7 +25,7 @@
  */
 
 [
-    GlobalContext=Window&WorkerGlobalScope,
+    Exposed=Window&Worker,
     RaisesException=Constructor,
     Constructor(DOMString url),
     Constructor(DOMString url, URL base),
diff --git a/Source/core/dom/URLUtils.idl b/Source/core/dom/URLUtils.idl
index 85fcf22..26ed382 100644
--- a/Source/core/dom/URLUtils.idl
+++ b/Source/core/dom/URLUtils.idl
@@ -30,7 +30,7 @@
 ] interface URLUtils {
     // FIXME: should be stringifier: http://crbug.com/306606
     // stringifier attribute DOMString href;
-    attribute DOMString href;
+    [PerWorldBindings, LogActivity=SetterOnly, LogPreviousValue] attribute DOMString href;
     [NotEnumerable, ImplementedAs=href] DOMString toString();
     readonly attribute DOMString origin;
 
diff --git a/Source/core/dom/UserActionElementSet.cpp b/Source/core/dom/UserActionElementSet.cpp
index 264061f..e59d1fa 100644
--- a/Source/core/dom/UserActionElementSet.cpp
+++ b/Source/core/dom/UserActionElementSet.cpp
@@ -46,10 +46,12 @@
     clearFlags(toElement(node), IsActiveFlag | InActiveChainFlag | IsHoveredFlag);
 }
 
+#if !ENABLE(OILPAN)
 void UserActionElementSet::documentDidRemoveLastRef()
 {
     m_elements.clear();
 }
+#endif
 
 bool UserActionElementSet::hasFlags(const Node* node, unsigned flags) const
 {
@@ -116,4 +118,9 @@
     m_elements.add(element, flags);
 }
 
+void UserActionElementSet::trace(Visitor* visitor)
+{
+    visitor->trace(m_elements);
+}
+
 }
diff --git a/Source/core/dom/UserActionElementSet.h b/Source/core/dom/UserActionElementSet.h
index 9883262..e060ef0 100644
--- a/Source/core/dom/UserActionElementSet.h
+++ b/Source/core/dom/UserActionElementSet.h
@@ -27,6 +27,7 @@
 #ifndef UserActionElementSet_h
 #define UserActionElementSet_h
 
+#include "platform/heap/Handle.h"
 #include "wtf/HashMap.h"
 #include "wtf/PassOwnPtr.h"
 #include "wtf/RefPtr.h"
@@ -36,10 +37,9 @@
 class Node;
 class Element;
 
-class UserActionElementSet {
+class UserActionElementSet FINAL {
+    DISALLOW_ALLOCATION();
 public:
-    static PassOwnPtr<UserActionElementSet> create() { return adoptPtr(new UserActionElementSet()); }
-
     bool isFocused(const Node* node) { return hasFlags(node, IsFocusedFlag); }
     bool isActive(const Node* node) { return hasFlags(node, IsActiveFlag); }
     bool isInActiveChain(const Node* node) { return hasFlags(node, InActiveChainFlag); }
@@ -53,7 +53,12 @@
     ~UserActionElementSet();
 
     void didDetach(Node*);
+
+#if !ENABLE(OILPAN)
     void documentDidRemoveLastRef();
+#endif
+
+    void trace(Visitor*);
 
 private:
     enum ElementFlags {
@@ -72,7 +77,7 @@
     void clearFlags(Element*, unsigned);
     bool hasFlags(const Element*, unsigned flags) const;
 
-    typedef HashMap<RefPtr<Element>, unsigned> ElementFlagMap;
+    typedef WillBeHeapHashMap<RefPtrWillBeMember<Element>, unsigned> ElementFlagMap;
     ElementFlagMap m_elements;
 };
 
diff --git a/Source/core/dom/ViewportDescription.cpp b/Source/core/dom/ViewportDescription.cpp
index 282c838..88e31cf 100644
--- a/Source/core/dom/ViewportDescription.cpp
+++ b/Source/core/dom/ViewportDescription.cpp
@@ -28,6 +28,14 @@
 #include "config.h"
 #include "core/dom/ViewportDescription.h"
 
+#include "core/dom/Document.h"
+#include "core/frame/FrameHost.h"
+#include "core/frame/FrameView.h"
+#include "core/frame/LocalFrame.h"
+#include "core/frame/Settings.h"
+#include "platform/weborigin/KURL.h"
+#include "public/platform/Platform.h"
+
 using namespace std;
 
 namespace WebCore {
@@ -194,4 +202,63 @@
     return result;
 }
 
+void ViewportDescription::reportMobilePageStats(const LocalFrame* mainFrame) const
+{
+#if OS(ANDROID)
+    enum ViewportUMAType {
+        NoViewportTag,
+        DeviceWidth,
+        ConstantWidth,
+        MetaWidthOther,
+        MetaHandheldFriendly,
+        MetaMobileOptimized,
+        XhtmlMobileProfile,
+        TypeCount
+    };
+
+    if (!mainFrame || !mainFrame->host() || !mainFrame->view() || !mainFrame->document())
+        return;
+
+    // Avoid chrome:// pages like the new-tab page (on Android new tab is non-http).
+    if (!mainFrame->document()->url().protocolIsInHTTPFamily())
+        return;
+
+    if (!isSpecifiedByAuthor()) {
+        if (mainFrame->document()->isMobileDocument())
+            blink::Platform::current()->histogramEnumeration("Viewport.MetaTagType", XhtmlMobileProfile, TypeCount);
+        else
+            blink::Platform::current()->histogramEnumeration("Viewport.MetaTagType", NoViewportTag, TypeCount);
+
+        return;
+    }
+
+    if (isMetaViewportType()) {
+        if (maxWidth.type() == WebCore::Fixed) {
+            blink::Platform::current()->histogramEnumeration("Viewport.MetaTagType", ConstantWidth, TypeCount);
+
+            if (mainFrame->view()) {
+                // To get an idea of how "far" the viewport is from the device's ideal width, we
+                // report the zoom level that we'd need to be at for the entire page to be visible.
+                int viewportWidth = maxWidth.intValue();
+                int windowWidth = mainFrame->document()->settings()->pinchVirtualViewportEnabled()
+                    ? mainFrame->host()->pinchViewport().size().width()
+                    : mainFrame->view()->frameRect().width();
+                int overviewZoomPercent = 100 * windowWidth / static_cast<float>(viewportWidth);
+                blink::Platform::current()->histogramSparse("Viewport.OverviewZoom", overviewZoomPercent);
+            }
+
+        } else if (maxWidth.type() == WebCore::DeviceWidth || maxWidth.type() == WebCore::ExtendToZoom) {
+            blink::Platform::current()->histogramEnumeration("Viewport.MetaTagType", DeviceWidth, TypeCount);
+        } else {
+            // Overflow bucket for cases we may be unaware of.
+            blink::Platform::current()->histogramEnumeration("Viewport.MetaTagType", MetaWidthOther, TypeCount);
+        }
+    } else if (type == ViewportDescription::HandheldFriendlyMeta) {
+        blink::Platform::current()->histogramEnumeration("Viewport.MetaTagType", MetaHandheldFriendly, TypeCount);
+    } else if (type == ViewportDescription::MobileOptimizedMeta) {
+        blink::Platform::current()->histogramEnumeration("Viewport.MetaTagType", MobileOptimizedMeta, TypeCount);
+    }
+#endif
+}
+
 } // namespace WebCore
diff --git a/Source/core/dom/ViewportDescription.h b/Source/core/dom/ViewportDescription.h
index f96661a..c5e22de 100644
--- a/Source/core/dom/ViewportDescription.h
+++ b/Source/core/dom/ViewportDescription.h
@@ -34,6 +34,9 @@
 
 namespace WebCore {
 
+class KURL;
+class LocalFrame;
+
 struct ViewportDescription {
 
     enum Type {
@@ -123,6 +126,10 @@
     bool isMetaViewportType() const { return type == ViewportMeta; }
     bool isSpecifiedByAuthor() const { return type != UserAgentStyleSheet; }
 
+    // Reports UMA stat on whether the page is considered mobile or desktop and what kind of
+    // mobile it is. Applies only to Android, must only be called once per page load.
+    void reportMobilePageStats(const LocalFrame*) const;
+
 private:
     enum Direction { Horizontal, Vertical };
     static float resolveViewportLength(const Length&, const FloatSize& initialViewportSize, Direction);
diff --git a/Source/core/dom/WheelController.h b/Source/core/dom/WheelController.h
index 35e94b8..fe1bbde 100644
--- a/Source/core/dom/WheelController.h
+++ b/Source/core/dom/WheelController.h
@@ -52,8 +52,6 @@
     virtual void didAddEventListener(DOMWindow*, const AtomicString&) OVERRIDE;
     virtual void didRemoveEventListener(DOMWindow*, const AtomicString&) OVERRIDE;
 
-    virtual void trace(Visitor*) OVERRIDE { }
-
 private:
     explicit WheelController(Document&);
 
diff --git a/Source/core/dom/XMLDocument.h b/Source/core/dom/XMLDocument.h
index b65b19c..62c2fc8 100644
--- a/Source/core/dom/XMLDocument.h
+++ b/Source/core/dom/XMLDocument.h
@@ -31,7 +31,7 @@
 
 namespace WebCore {
 
-class XMLDocument : public Document {
+class XMLDocument FINAL : public Document {
 public:
     static PassRefPtr<XMLDocument> create(const DocumentInit& initializer = DocumentInit())
     {
@@ -43,6 +43,11 @@
         return adoptRef(new XMLDocument(initializer, XMLDocumentClass | XHTMLDocumentClass));
     }
 
+    static PassRefPtr<XMLDocument> createSVG(const DocumentInit& initializer = DocumentInit())
+    {
+        return adoptRef(new XMLDocument(initializer, XMLDocumentClass | SVGDocumentClass));
+    }
+
 protected:
     XMLDocument(const DocumentInit&, DocumentClassFlags documentClasses);
 };
diff --git a/Source/core/dom/custom/CustomElementMicrotaskDispatcher.cpp b/Source/core/dom/custom/CustomElementMicrotaskDispatcher.cpp
index 524dcd0..ca716e6 100644
--- a/Source/core/dom/custom/CustomElementMicrotaskDispatcher.cpp
+++ b/Source/core/dom/custom/CustomElementMicrotaskDispatcher.cpp
@@ -95,4 +95,19 @@
     m_phase = Quiescent;
 }
 
+#if !defined(NDEBUG)
+void CustomElementMicrotaskDispatcher::show()
+{
+    fprintf(stderr, "Dispatcher:\n");
+    m_resolutionAndImports->show(1);
+}
+#endif
+
 } // namespace WebCore
+
+#if !defined(NDEBUG)
+void showCEMD()
+{
+    WebCore::CustomElementMicrotaskDispatcher::instance().show();
+}
+#endif
diff --git a/Source/core/dom/custom/CustomElementMicrotaskDispatcher.h b/Source/core/dom/custom/CustomElementMicrotaskDispatcher.h
index effdc04..a3f7669 100644
--- a/Source/core/dom/custom/CustomElementMicrotaskDispatcher.h
+++ b/Source/core/dom/custom/CustomElementMicrotaskDispatcher.h
@@ -31,6 +31,10 @@
 
     bool elementQueueIsEmpty() { return m_elements.isEmpty(); }
 
+#if !defined(NDEBUG)
+    void show();
+#endif
+
 private:
     CustomElementMicrotaskDispatcher();
 
@@ -52,4 +56,8 @@
 
 }
 
+#if !defined(NDEBUG)
+void showCEMD();
+#endif
+
 #endif // CustomElementMicrotaskDispatcher_h
diff --git a/Source/core/dom/custom/CustomElementMicrotaskImportStep.cpp b/Source/core/dom/custom/CustomElementMicrotaskImportStep.cpp
index 02b2728..e8fccfc 100644
--- a/Source/core/dom/custom/CustomElementMicrotaskImportStep.cpp
+++ b/Source/core/dom/custom/CustomElementMicrotaskImportStep.cpp
@@ -33,17 +33,21 @@
 
 #include "core/dom/custom/CustomElementMicrotaskDispatcher.h"
 #include "core/dom/custom/CustomElementMicrotaskQueue.h"
+#include "core/html/imports/HTMLImportChild.h"
+#include "core/html/imports/HTMLImportLoader.h"
+#include <stdio.h>
 
 namespace WebCore {
 
-PassOwnPtr<CustomElementMicrotaskImportStep> CustomElementMicrotaskImportStep::create(PassRefPtr<CustomElementMicrotaskQueue> queue)
+PassOwnPtr<CustomElementMicrotaskImportStep> CustomElementMicrotaskImportStep::create(HTMLImportChild* import)
 {
-    return adoptPtr(new CustomElementMicrotaskImportStep(queue));
+    return adoptPtr(new CustomElementMicrotaskImportStep(import));
 }
 
-CustomElementMicrotaskImportStep::CustomElementMicrotaskImportStep(PassRefPtr<CustomElementMicrotaskQueue> queue)
-    : m_importFinished(false)
-    , m_queue(queue)
+CustomElementMicrotaskImportStep::CustomElementMicrotaskImportStep(HTMLImportChild* import)
+    : m_import(import->weakPtr())
+    , m_queue(import->loader()->microtaskQueue())
+    , m_weakFactory(this)
 {
 }
 
@@ -51,20 +55,42 @@
 {
 }
 
-void CustomElementMicrotaskImportStep::importDidFinish()
+bool CustomElementMicrotaskImportStep::shouldWaitForImport() const
 {
-    // imports should only "finish" once
-    ASSERT(!m_importFinished);
-    m_importFinished = true;
-    CustomElementMicrotaskDispatcher::instance().importDidFinish(this);
+    return m_import && !m_import->isLoaded();
+}
+
+bool CustomElementMicrotaskImportStep::shouldStopProcessing() const
+{
+    return m_import && m_import->isSync();
+}
+
+void CustomElementMicrotaskImportStep::didUpgradeAllCustomElements()
+{
+    ASSERT(m_queue);
+    if (m_import)
+        m_import->didFinishUpgradingCustomElements();
 }
 
 CustomElementMicrotaskStep::Result CustomElementMicrotaskImportStep::process()
 {
     Result result = m_queue->dispatch();
-    if (!m_importFinished)
-        result = Result(result | ShouldStop);
+    if (!(result & ShouldStop) && !shouldWaitForImport())
+        didUpgradeAllCustomElements();
+
+    if (shouldWaitForImport())
+        result = Result(result | ShouldRemain | ShouldStop);
+    if (!shouldStopProcessing())
+        result = Result(result & ~ShouldStop);
     return result;
 }
 
+#if !defined(NDEBUG)
+void CustomElementMicrotaskImportStep::show(unsigned indent)
+{
+    fprintf(stderr, "%*sImport(wait=%d sync=%d, url=%s)\n", indent, "", shouldWaitForImport(), shouldStopProcessing(), m_import ? m_import->url().string().utf8().data() : "null");
+    m_queue->show(indent + 1);
+}
+#endif
+
 } // namespace WebCore
diff --git a/Source/core/dom/custom/CustomElementMicrotaskImportStep.h b/Source/core/dom/custom/CustomElementMicrotaskImportStep.h
index d1d20da..186990e 100644
--- a/Source/core/dom/custom/CustomElementMicrotaskImportStep.h
+++ b/Source/core/dom/custom/CustomElementMicrotaskImportStep.h
@@ -36,10 +36,12 @@
 #include "wtf/PassOwnPtr.h"
 #include "wtf/PassRefPtr.h"
 #include "wtf/RefPtr.h"
+#include "wtf/WeakPtr.h"
 
 namespace WebCore {
 
 class CustomElementMicrotaskQueue;
+class HTMLImportChild;
 
 // Processes the Custom Elements in an HTML Import. This is a
 // composite step which processes the Custom Elements created by
@@ -50,20 +52,29 @@
 class CustomElementMicrotaskImportStep : public CustomElementMicrotaskStep {
     WTF_MAKE_NONCOPYABLE(CustomElementMicrotaskImportStep);
 public:
-    static PassOwnPtr<CustomElementMicrotaskImportStep> create(PassRefPtr<CustomElementMicrotaskQueue>);
+    static PassOwnPtr<CustomElementMicrotaskImportStep> create(HTMLImportChild*);
     virtual ~CustomElementMicrotaskImportStep();
 
     // API for HTML Imports
-    void importDidFinish();
+    void importDidFinishLoading();
+    WeakPtr<CustomElementMicrotaskImportStep> weakPtr() { return m_weakFactory.createWeakPtr(); }
 
 private:
-    CustomElementMicrotaskImportStep(PassRefPtr<CustomElementMicrotaskQueue>);
+    CustomElementMicrotaskImportStep(HTMLImportChild*);
+
+    void didUpgradeAllCustomElements();
+    bool shouldWaitForImport() const;
+    bool shouldStopProcessing() const;
 
     // CustomElementMicrotaskStep
     virtual Result process() OVERRIDE FINAL;
 
-    bool m_importFinished;
+#if !defined(NDEBUG)
+    virtual void show(unsigned indent) OVERRIDE;
+#endif
+    WeakPtr<HTMLImportChild> m_import;
     RefPtr<CustomElementMicrotaskQueue> m_queue;
+    WeakPtrFactory<CustomElementMicrotaskImportStep> m_weakFactory;
 };
 
 }
diff --git a/Source/core/dom/custom/CustomElementMicrotaskQueue.cpp b/Source/core/dom/custom/CustomElementMicrotaskQueue.cpp
index 9afa0e0..4e2c25f 100644
--- a/Source/core/dom/custom/CustomElementMicrotaskQueue.cpp
+++ b/Source/core/dom/custom/CustomElementMicrotaskQueue.cpp
@@ -83,23 +83,36 @@
 CustomElementMicrotaskStep::Result CustomElementMicrotaskQueue::dispatch()
 {
     MicrotaskQueueInvocationScope scope(this);
-    Result result = Result(0);
+    Vector<OwnPtr<CustomElementMicrotaskStep> > remaining;
+    Result accumulatedResult = CustomElementMicrotaskStep::ContinueWithRemoving;
 
     unsigned i;
     for (i = 0; i < m_queue.size(); ++i) {
-        result = Result(result | m_queue[i]->process());
-
+        Result result = m_queue[i]->process();
+        accumulatedResult = CustomElementMicrotaskStep::Result(result | accumulatedResult);
+        if (result & CustomElementMicrotaskStep::ShouldRemain)
+            remaining.append(m_queue[i].release());
         if (result & CustomElementMicrotaskStep::ShouldStop)
             break;
     }
 
-    bool wasStopped = i < m_queue.size();
-    if (wasStopped)
-        m_queue.remove(0, i);
-    else
-        m_queue.resize(0);
+    for (++i; i < m_queue.size(); ++i)
+        remaining.append(m_queue[i].release());
+    m_queue.swap(remaining);
 
-    return result;
+    return accumulatedResult;
 }
 
+#if !defined(NDEBUG)
+void CustomElementMicrotaskQueue::show(unsigned indent)
+{
+    for (unsigned q = 0; q < m_queue.size(); ++q) {
+        if (m_queue[q])
+            m_queue[q]->show(indent);
+        else
+            fprintf(stderr, "%*snull\n", indent, "");
+    }
+}
+#endif
+
 } // namespace WebCore
diff --git a/Source/core/dom/custom/CustomElementMicrotaskQueue.h b/Source/core/dom/custom/CustomElementMicrotaskQueue.h
index 0fc03c1..dc7d738 100644
--- a/Source/core/dom/custom/CustomElementMicrotaskQueue.h
+++ b/Source/core/dom/custom/CustomElementMicrotaskQueue.h
@@ -53,6 +53,9 @@
     typedef CustomElementMicrotaskStep::Result Result;
     Result dispatch();
 
+#if !defined(NDEBUG)
+    void show(unsigned indent);
+#endif
 private:
     CustomElementMicrotaskQueue() { }
 
diff --git a/Source/core/dom/custom/CustomElementMicrotaskResolutionStep.cpp b/Source/core/dom/custom/CustomElementMicrotaskResolutionStep.cpp
index e5edad0..5a6e10f 100644
--- a/Source/core/dom/custom/CustomElementMicrotaskResolutionStep.cpp
+++ b/Source/core/dom/custom/CustomElementMicrotaskResolutionStep.cpp
@@ -55,7 +55,15 @@
 CustomElementMicrotaskStep::Result CustomElementMicrotaskResolutionStep::process()
 {
     m_context->resolve(m_element.get(), m_descriptor);
-    return CustomElementMicrotaskStep::Continue;
+    return CustomElementMicrotaskStep::ContinueWithRemoving;
 }
 
+#if !defined(NDEBUG)
+void CustomElementMicrotaskResolutionStep::show(unsigned indent)
+{
+    fprintf(stderr, "%*sResolution: ", indent, "");
+    m_element->outerHTML().show();
+}
+#endif
+
 } // namespace WebCore
diff --git a/Source/core/dom/custom/CustomElementMicrotaskResolutionStep.h b/Source/core/dom/custom/CustomElementMicrotaskResolutionStep.h
index f77b2a8..ff936dd 100644
--- a/Source/core/dom/custom/CustomElementMicrotaskResolutionStep.h
+++ b/Source/core/dom/custom/CustomElementMicrotaskResolutionStep.h
@@ -54,6 +54,10 @@
 
     virtual Result process() OVERRIDE;
 
+#if !defined(NDEBUG)
+    virtual void show(unsigned indent) OVERRIDE;
+#endif
+
     RefPtr<CustomElementRegistrationContext> m_context;
     RefPtr<Element> m_element;
     CustomElementDescriptor m_descriptor;
diff --git a/Source/core/dom/custom/CustomElementMicrotaskStep.h b/Source/core/dom/custom/CustomElementMicrotaskStep.h
index 625067e..c5f11ec 100644
--- a/Source/core/dom/custom/CustomElementMicrotaskStep.h
+++ b/Source/core/dom/custom/CustomElementMicrotaskStep.h
@@ -42,11 +42,16 @@
     virtual ~CustomElementMicrotaskStep() { }
 
     enum Result {
-        Continue   = 1 << 0,
-        ShouldStop = 1 << 1
+        ContinueWithRemoving = 0,
+        ShouldStop           = 1 << 0,
+        ShouldRemain         = 1 << 1
     };
 
     virtual Result process() = 0;
+
+#if !defined(NDEBUG)
+    virtual void show(unsigned indent) = 0;
+#endif
 };
 
 }
diff --git a/Source/core/dom/custom/CustomElementScheduler.cpp b/Source/core/dom/custom/CustomElementScheduler.cpp
index 2583bfa..1980496 100644
--- a/Source/core/dom/custom/CustomElementScheduler.cpp
+++ b/Source/core/dom/custom/CustomElementScheduler.cpp
@@ -42,7 +42,6 @@
 #include "core/dom/custom/CustomElementMicrotaskResolutionStep.h"
 #include "core/dom/custom/CustomElementRegistrationContext.h"
 #include "core/html/imports/HTMLImportChild.h"
-#include "core/html/imports/HTMLImportLoader.h"
 
 namespace WebCore {
 
@@ -85,7 +84,7 @@
     ASSERT(!import->isDone());
     ASSERT(import->parent());
 
-    OwnPtr<CustomElementMicrotaskImportStep> step = CustomElementMicrotaskImportStep::create(import->loader()->microtaskQueue());
+    OwnPtr<CustomElementMicrotaskImportStep> step = CustomElementMicrotaskImportStep::create(import);
     CustomElementMicrotaskImportStep* rawStep = step.get();
 
     // Ownership of the new step is transferred to the parent
diff --git a/Source/core/dom/shadow/ElementShadow.cpp b/Source/core/dom/shadow/ElementShadow.cpp
index ba11a70..cece712 100644
--- a/Source/core/dom/shadow/ElementShadow.cpp
+++ b/Source/core/dom/shadow/ElementShadow.cpp
@@ -122,9 +122,9 @@
     }
 }
 
-PassOwnPtr<ElementShadow> ElementShadow::create()
+PassOwnPtrWillBeRawPtr<ElementShadow> ElementShadow::create()
 {
-    return adoptPtr(new ElementShadow());
+    return adoptPtrWillBeNoop(new ElementShadow());
 }
 
 ElementShadow::ElementShadow()
@@ -135,7 +135,9 @@
 
 ElementShadow::~ElementShadow()
 {
+#if !ENABLE(OILPAN)
     removeDetachedShadowRoots();
+#endif
 }
 
 ShadowRoot& ElementShadow::addShadowRoot(Element& shadowHost, ShadowRoot::ShadowRootType type)
@@ -161,6 +163,7 @@
     return *m_shadowRoots.head();
 }
 
+#if !ENABLE(OILPAN)
 void ElementShadow::removeDetachedShadowRoots()
 {
     // Dont protect this ref count.
@@ -176,8 +179,8 @@
         oldRoot->setPrev(0);
         oldRoot->setNext(0);
     }
-
 }
+#endif
 
 void ElementShadow::attach(const Node::AttachContext& context)
 {
@@ -350,4 +353,12 @@
         root->setShadowInsertionPointOfYoungerShadowRoot(nullptr);
 }
 
+void ElementShadow::trace(Visitor* visitor)
+{
+    // Shadow roots are linked with previous and next pointers which are traced.
+    // It is therefore enough to trace one of the shadow roots here and the
+    // rest will be traced from there.
+    visitor->trace(m_shadowRoots.head());
+}
+
 } // namespace
diff --git a/Source/core/dom/shadow/ElementShadow.h b/Source/core/dom/shadow/ElementShadow.h
index a5538a4..da98542 100644
--- a/Source/core/dom/shadow/ElementShadow.h
+++ b/Source/core/dom/shadow/ElementShadow.h
@@ -30,6 +30,7 @@
 #include "core/dom/shadow/InsertionPoint.h"
 #include "core/dom/shadow/SelectRuleFeatureSet.h"
 #include "core/dom/shadow/ShadowRoot.h"
+#include "platform/heap/Handle.h"
 #include "wtf/DoublyLinkedList.h"
 #include "wtf/Forward.h"
 #include "wtf/HashMap.h"
@@ -39,10 +40,11 @@
 
 namespace WebCore {
 
-class ElementShadow {
-    WTF_MAKE_NONCOPYABLE(ElementShadow); WTF_MAKE_FAST_ALLOCATED;
+class ElementShadow FINAL : public NoBaseWillBeGarbageCollectedFinalized<ElementShadow> {
+    WTF_MAKE_NONCOPYABLE(ElementShadow);
+    WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED;
 public:
-    static PassOwnPtr<ElementShadow> create();
+    static PassOwnPtrWillBeRawPtr<ElementShadow> create();
     ~ElementShadow();
 
     Element* host() const;
@@ -69,10 +71,14 @@
 
     void didDistributeNode(const Node*, InsertionPoint*);
 
+    void trace(Visitor*);
+
 private:
     ElementShadow();
 
+#if !ENABLE(OILPAN)
     void removeDetachedShadowRoots();
+#endif
 
     void distribute();
     void clearDistribution();
@@ -87,6 +93,7 @@
     NodeToDestinationInsertionPoints m_nodeToInsertionPoints;
 
     SelectRuleFeatureSet m_selectFeatures;
+    // FIXME: Oilpan: add a heap-based version of DoublyLinkedList<>.
     DoublyLinkedList<ShadowRoot> m_shadowRoots;
     bool m_needsDistributionRecalc;
     bool m_needsSelectFeatureSet;
diff --git a/Source/core/dom/shadow/ShadowRoot.cpp b/Source/core/dom/shadow/ShadowRoot.cpp
index 896f38f..1f5b2d8 100644
--- a/Source/core/dom/shadow/ShadowRoot.cpp
+++ b/Source/core/dom/shadow/ShadowRoot.cpp
@@ -53,8 +53,8 @@
 ShadowRoot::ShadowRoot(Document& document, ShadowRootType type)
     : DocumentFragment(0, CreateShadowRoot)
     , TreeScope(*this, document)
-    , m_prev(0)
-    , m_next(0)
+    , m_prev(nullptr)
+    , m_next(nullptr)
     , m_numberOfStyles(0)
     , m_type(type)
     , m_registeredWithParentShadowRoot(false)
@@ -65,23 +65,20 @@
 
 ShadowRoot::~ShadowRoot()
 {
+#if !ENABLE(OILPAN)
     ASSERT(!m_prev);
     ASSERT(!m_next);
 
-#if !ENABLE(OILPAN)
     if (m_shadowRootRareData && m_shadowRootRareData->styleSheets())
         m_shadowRootRareData->styleSheets()->detachFromDocument();
 
     document().styleEngine()->didRemoveShadowRoot(this);
-#endif
 
-#if !ENABLE(OILPAN)
     // We cannot let ContainerNode destructor call willBeDeletedFromDocument()
     // for this ShadowRoot instance because TreeScope destructor
     // clears Node::m_treeScope thus ContainerNode is no longer able
     // to access it Document reference after that.
     willBeDeletedFromDocument();
-#endif
 
     // We must remove all of our children first before the TreeScope destructor
     // runs so we don't go through TreeScopeAdopter for each child with a
@@ -92,12 +89,15 @@
     // as well as Node. See a comment on TreeScope.h for the reason.
     if (hasRareData())
         clearRareData();
+#endif
 }
 
+#if !ENABLE(OILPAN)
 void ShadowRoot::dispose()
 {
     removeDetachedChildren();
 }
+#endif
 
 ShadowRoot* ShadowRoot::olderShadowRootForBindings() const
 {
@@ -339,6 +339,8 @@
 
 void ShadowRoot::trace(Visitor* visitor)
 {
+    visitor->trace(m_prev);
+    visitor->trace(m_next);
     visitor->trace(m_shadowRootRareData);
     TreeScope::trace(visitor);
     DocumentFragment::trace(visitor);
diff --git a/Source/core/dom/shadow/ShadowRoot.h b/Source/core/dom/shadow/ShadowRoot.h
index d084f6b..3c09025 100644
--- a/Source/core/dom/shadow/ShadowRoot.h
+++ b/Source/core/dom/shadow/ShadowRoot.h
@@ -128,7 +128,10 @@
     ShadowRoot(Document&, ShadowRootType);
     virtual ~ShadowRoot();
 
+#if !ENABLE(OILPAN)
     virtual void dispose() OVERRIDE;
+#endif
+
     virtual void childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta) OVERRIDE;
 
     ShadowRootRareData* ensureShadowRootRareData();
@@ -143,8 +146,8 @@
     // FIXME: This shouldn't happen. https://bugs.webkit.org/show_bug.cgi?id=88834
     bool isOrphan() const { return !host(); }
 
-    ShadowRoot* m_prev;
-    ShadowRoot* m_next;
+    RawPtrWillBeMember<ShadowRoot> m_prev;
+    RawPtrWillBeMember<ShadowRoot> m_next;
     OwnPtrWillBeMember<ShadowRootRareData> m_shadowRootRareData;
     unsigned m_numberOfStyles : 27;
     unsigned m_type : 1;
diff --git a/Source/core/editing/ApplyStyleCommand.cpp b/Source/core/editing/ApplyStyleCommand.cpp
index c7fbf6a..8d55d6f 100644
--- a/Source/core/editing/ApplyStyleCommand.cpp
+++ b/Source/core/editing/ApplyStyleCommand.cpp
@@ -1502,7 +1502,7 @@
     if (!node)
         return 0;
 
-    RefPtr<CSSComputedStyleDeclaration> style = CSSComputedStyleDeclaration::create(node);
+    RefPtrWillBeRawPtr<CSSComputedStyleDeclaration> style = CSSComputedStyleDeclaration::create(node);
     if (!style)
         return 0;
 
diff --git a/Source/core/editing/EditingStyle.cpp b/Source/core/editing/EditingStyle.cpp
index 9942a5b..41ce59d 100644
--- a/Source/core/editing/EditingStyle.cpp
+++ b/Source/core/editing/EditingStyle.cpp
@@ -134,7 +134,7 @@
     return allEditingProperties().contains(static_cast<CSSPropertyID>(id));
 }
 
-static PassRefPtrWillBeRawPtr<MutableStylePropertySet> editingStyleFromComputedStyle(PassRefPtr<CSSComputedStyleDeclaration> style, EditingPropertiesType type = OnlyInheritableEditingProperties)
+static PassRefPtrWillBeRawPtr<MutableStylePropertySet> editingStyleFromComputedStyle(PassRefPtrWillBeRawPtr<CSSComputedStyleDeclaration> style, EditingPropertiesType type = OnlyInheritableEditingProperties)
 {
     if (!style)
         return MutableStylePropertySet::create();
@@ -455,7 +455,7 @@
     else if (isTabSpanNode(node))
         node = node->parentNode();
 
-    RefPtr<CSSComputedStyleDeclaration> computedStyleAtPosition = CSSComputedStyleDeclaration::create(node);
+    RefPtrWillBeRawPtr<CSSComputedStyleDeclaration> computedStyleAtPosition = CSSComputedStyleDeclaration::create(node);
     m_mutableStyle = propertiesToInclude == AllProperties && computedStyleAtPosition ? computedStyleAtPosition->copyProperties() : editingStyleFromComputedStyle(computedStyleAtPosition);
 
     if (propertiesToInclude == EditingPropertiesInEffect) {
@@ -708,7 +708,7 @@
     bool nodeIsStart = true;
     for (Node* node = selection.start().deprecatedNode(); node; node = NodeTraversal::next(*node)) {
         if (node->renderer() && node->rendererIsEditable()) {
-            RefPtr<CSSComputedStyleDeclaration> nodeStyle = CSSComputedStyleDeclaration::create(node);
+            RefPtrWillBeRawPtr<CSSComputedStyleDeclaration> nodeStyle = CSSComputedStyleDeclaration::create(node);
             if (nodeStyle) {
                 TriState nodeState = triStateOfStyle(nodeStyle.get(), node->isTextNode() ? EditingStyle::DoNotIgnoreTextOnlyProperties : EditingStyle::IgnoreTextOnlyProperties);
                 if (nodeIsStart) {
@@ -1163,7 +1163,7 @@
     // The property value, if it's a percentage, may not reflect the actual computed value.
     // For example: style="height: 1%; overflow: visible;" in quirksmode
     // FIXME: There are others like this, see <rdar://problem/5195123> Slashdot copy/paste fidelity problem
-    RefPtr<CSSComputedStyleDeclaration> computedStyleForElement = CSSComputedStyleDeclaration::create(element);
+    RefPtrWillBeRawPtr<CSSComputedStyleDeclaration> computedStyleForElement = CSSComputedStyleDeclaration::create(element);
     RefPtrWillBeRawPtr<MutableStylePropertySet> fromComputedStyle = MutableStylePropertySet::create();
     {
         unsigned propertyCount = m_mutableStyle->propertyCount();
@@ -1306,7 +1306,7 @@
             if (!n->isStyledElement())
                 continue;
 
-            RefPtr<CSSComputedStyleDeclaration> style = CSSComputedStyleDeclaration::create(n);
+            RefPtrWillBeRawPtr<CSSComputedStyleDeclaration> style = CSSComputedStyleDeclaration::create(n);
             RefPtrWillBeRawPtr<CSSValue> unicodeBidi = style->getPropertyCSSValue(CSSPropertyUnicodeBidi);
             if (!unicodeBidi || !unicodeBidi->isPrimitiveValue())
                 continue;
@@ -1335,7 +1335,7 @@
         if (!node->isStyledElement())
             continue;
 
-        RefPtr<CSSComputedStyleDeclaration> style = CSSComputedStyleDeclaration::create(node);
+        RefPtrWillBeRawPtr<CSSComputedStyleDeclaration> style = CSSComputedStyleDeclaration::create(node);
         RefPtrWillBeRawPtr<CSSValue> unicodeBidi = style->getPropertyCSSValue(CSSPropertyUnicodeBidi);
         if (!unicodeBidi || !unicodeBidi->isPrimitiveValue())
             continue;
@@ -1398,7 +1398,7 @@
     if (!style || !style->style() || !document || !document->frame())
         return;
 
-    RefPtr<CSSComputedStyleDeclaration> computedStyle = position.computedStyle();
+    RefPtrWillBeRawPtr<CSSComputedStyleDeclaration> computedStyle = position.computedStyle();
     // FIXME: take care of background-color in effect
     RefPtrWillBeRawPtr<MutableStylePropertySet> mutableStyle = getPropertiesNotIn(style->style(), computedStyle.get());
 
@@ -1654,7 +1654,7 @@
 PassRefPtrWillBeRawPtr<CSSValue> backgroundColorInEffect(Node* node)
 {
     for (Node* ancestor = node; ancestor; ancestor = ancestor->parentNode()) {
-        RefPtr<CSSComputedStyleDeclaration> ancestorStyle = CSSComputedStyleDeclaration::create(ancestor);
+        RefPtrWillBeRawPtr<CSSComputedStyleDeclaration> ancestorStyle = CSSComputedStyleDeclaration::create(ancestor);
         if (!hasTransparentBackgroundColor(ancestorStyle.get()))
             return ancestorStyle->getPropertyCSSValue(CSSPropertyBackgroundColor);
     }
diff --git a/Source/core/editing/Editor.cpp b/Source/core/editing/Editor.cpp
index 2b9c59c..a91f9e2 100644
--- a/Source/core/editing/Editor.cpp
+++ b/Source/core/editing/Editor.cpp
@@ -1136,75 +1136,76 @@
     return nextMatch.release();
 }
 
+static PassRefPtrWillBeRawPtr<Range> findStringBetweenPositions(const String& target, const Position& start, const Position& end, FindOptions options)
+{
+    Position searchStart(start);
+    Position searchEnd(end);
+
+    bool forward = !(options & Backwards);
+
+    while (true) {
+        Position resultStart;
+        Position resultEnd;
+        findPlainText(searchStart, searchEnd, target, options, resultStart, resultEnd);
+        if (resultStart == resultEnd)
+            return nullptr;
+
+        RefPtrWillBeRawPtr<Range> resultRange = Range::create(*resultStart.document(), resultStart, resultEnd);
+        if (!resultRange->collapsed())
+            return resultRange.release();
+
+        // Found text spans over multiple TreeScopes. Since it's impossible to return such section as a Range,
+        // we skip this match and seek for the next occurrence.
+        // FIXME: Handle this case.
+        if (forward)
+            searchStart = resultStart.next();
+        else
+            searchEnd = resultEnd.previous();
+    }
+
+    ASSERT_NOT_REACHED();
+    return nullptr;
+}
+
 PassRefPtrWillBeRawPtr<Range> Editor::rangeOfString(const String& target, Range* referenceRange, FindOptions options)
 {
     if (target.isEmpty())
         return nullptr;
 
-    // Start from an edge of the reference range, if there's a reference range that's not in shadow content. Which edge
-    // is used depends on whether we're searching forward or backward, and whether startInSelection is set.
-    RefPtrWillBeRawPtr<Range> searchRange(rangeOfContents(m_frame.document()));
+    // Start from an edge of the reference range. Which edge is used depends on whether we're searching forward or
+    // backward, and whether startInSelection is set.
+    Position searchStart = firstPositionInNode(m_frame.document());
+    Position searchEnd = lastPositionInNode(m_frame.document());
 
     bool forward = !(options & Backwards);
     bool startInReferenceRange = referenceRange && (options & StartInSelection);
     if (referenceRange) {
         if (forward)
-            searchRange->setStart(startInReferenceRange ? referenceRange->startPosition() : referenceRange->endPosition());
+            searchStart = startInReferenceRange ? referenceRange->startPosition() : referenceRange->endPosition();
         else
-            searchRange->setEnd(startInReferenceRange ? referenceRange->endPosition() : referenceRange->startPosition());
+            searchEnd = startInReferenceRange ? referenceRange->endPosition() : referenceRange->startPosition();
     }
 
-    RefPtr<Node> shadowTreeRoot = referenceRange && referenceRange->startContainer() ? referenceRange->startContainer()->nonBoundaryShadowTreeRootNode() : 0;
-    if (shadowTreeRoot) {
-        if (forward)
-            searchRange->setEnd(shadowTreeRoot.get(), shadowTreeRoot->countChildren());
-        else
-            searchRange->setStart(shadowTreeRoot.get(), 0);
-    }
+    RefPtrWillBeRawPtr<Range> resultRange = findStringBetweenPositions(target, searchStart, searchEnd, options);
 
-    RefPtrWillBeRawPtr<Range> resultRange(findPlainText(searchRange.get(), target, options));
     // If we started in the reference range and the found range exactly matches the reference range, find again.
     // Build a selection with the found range to remove collapsed whitespace.
     // Compare ranges instead of selection objects to ignore the way that the current selection was made.
-    if (startInReferenceRange && areRangesEqual(VisibleSelection(resultRange.get()).toNormalizedRange().get(), referenceRange)) {
-        searchRange = rangeOfContents(m_frame.document());
+    if (resultRange && startInReferenceRange && areRangesEqual(VisibleSelection(resultRange.get()).toNormalizedRange().get(), referenceRange)) {
         if (forward)
-            searchRange->setStart(referenceRange->endPosition());
+            searchStart = resultRange->endPosition();
         else
-            searchRange->setEnd(referenceRange->startPosition());
-
-        if (shadowTreeRoot) {
-            if (forward)
-                searchRange->setEnd(shadowTreeRoot.get(), shadowTreeRoot->countChildren());
-            else
-                searchRange->setStart(shadowTreeRoot.get(), 0);
-        }
-
-        resultRange = findPlainText(searchRange.get(), target, options);
+            searchEnd = resultRange->startPosition();
+        resultRange = findStringBetweenPositions(target, searchStart, searchEnd, options);
     }
 
-    // If nothing was found in the shadow tree, search in main content following the shadow tree.
-    if (resultRange->collapsed() && shadowTreeRoot) {
-        searchRange = rangeOfContents(m_frame.document());
-        if (forward)
-            searchRange->setStartAfter(shadowTreeRoot->shadowHost());
-        else
-            searchRange->setEndBefore(shadowTreeRoot->shadowHost());
-
-        resultRange = findPlainText(searchRange.get(), target, options);
+    if (!resultRange && options & WrapAround) {
+        searchStart = firstPositionInNode(m_frame.document());
+        searchEnd = lastPositionInNode(m_frame.document());
+        resultRange = findStringBetweenPositions(target, searchStart, searchEnd, options);
     }
 
-    // If we didn't find anything and we're wrapping, search again in the entire document (this will
-    // redundantly re-search the area already searched in some cases).
-    if (resultRange->collapsed() && options & WrapAround) {
-        searchRange = rangeOfContents(m_frame.document());
-        resultRange = findPlainText(searchRange.get(), target, options);
-        // We used to return false here if we ended up with the same range that we started with
-        // (e.g., the reference range was already the only instance of this text). But we decided that
-        // this should be a success case instead, so we'll just fall through in that case.
-    }
-
-    return resultRange->collapsed() ? nullptr : resultRange.release();
+    return resultRange.release();
 }
 
 void Editor::setMarkedTextMatchesAreHighlighted(bool flag)
diff --git a/Source/core/events/Event.h b/Source/core/events/Event.h
index 69d3e52..2b6fb67 100644
--- a/Source/core/events/Event.h
+++ b/Source/core/events/Event.h
@@ -159,7 +159,7 @@
     bool immediatePropagationStopped() const { return m_immediatePropagationStopped; }
 
     bool defaultPrevented() const { return m_defaultPrevented; }
-    void preventDefault()
+    virtual void preventDefault()
     {
         if (m_cancelable)
             m_defaultPrevented = true;
diff --git a/Source/core/events/EventDispatcher.cpp b/Source/core/events/EventDispatcher.cpp
index 0edc6e4..f2b4804 100644
--- a/Source/core/events/EventDispatcher.cpp
+++ b/Source/core/events/EventDispatcher.cpp
@@ -33,6 +33,7 @@
 #include "core/events/WindowEventContext.h"
 #include "core/frame/FrameView.h"
 #include "core/inspector/InspectorInstrumentation.h"
+#include "core/inspector/InspectorTraceEvents.h"
 #include "platform/TraceEvent.h"
 #include "wtf/RefPtr.h"
 
@@ -129,6 +130,7 @@
     m_event->setTarget(windowEventContext.target());
     m_event->setCurrentTarget(0);
     InspectorInstrumentation::didDispatchEvent(cookie);
+    TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "UpdateCounters", "data", InspectorUpdateCountersEvent::data());
 
     return !m_event->defaultPrevented();
 }
diff --git a/Source/core/events/EventPath.cpp b/Source/core/events/EventPath.cpp
index be6dba1..72c272c 100644
--- a/Source/core/events/EventPath.cpp
+++ b/Source/core/events/EventPath.cpp
@@ -44,6 +44,14 @@
 
 namespace WebCore {
 
+// SVG1.1 specified that the <use> instance tree would expose the target
+// element for events. This has been deprecated and will be removed.
+// See: crbug.com/313438
+static bool usesDeprecatedSVGUseTreeEventRules(Node* node)
+{
+    return node->isSVGElement() && toSVGElement(node)->inUseShadowTree();
+}
+
 EventTarget* EventPath::eventTargetRespectingTargetRules(Node* referenceNode)
 {
     ASSERT(referenceNode);
@@ -51,7 +59,7 @@
     if (referenceNode->isPseudoElement())
         return referenceNode->parentNode();
 
-    if (!referenceNode->isSVGElement() || !referenceNode->isInShadowTree())
+    if (!usesDeprecatedSVGUseTreeEventRules(referenceNode))
         return referenceNode;
 
     // Spec: The event handling for the non-exposed tree works as if the referenced element had been textually included
@@ -115,7 +123,7 @@
     m_treeScopeEventContexts.clear();
     calculatePath();
     calculateAdjustedTargets();
-    if (!node->isSVGElement())
+    if (!usesDeprecatedSVGUseTreeEventRules(node))
         calculateTreeScopePrePostOrderNumbers();
 }
 
@@ -218,7 +226,7 @@
 void EventPath::calculateAdjustedTargets()
 {
     const TreeScope* lastTreeScope = 0;
-    bool isSVGElement = at(0).node()->isSVGElement();
+    bool useDeprecatedSVGUseTreeEventRules = usesDeprecatedSVGUseTreeEventRules(at(0).node());
 
     TreeScopeEventContextMap treeScopeEventContextMap;
     TreeScopeEventContext* lastTreeScopeEventContext = 0;
@@ -227,7 +235,7 @@
         Node* currentNode = at(i).node();
         TreeScope& currentTreeScope = currentNode->treeScope();
         if (lastTreeScope != &currentTreeScope) {
-            if (!isSVGElement) {
+            if (!useDeprecatedSVGUseTreeEventRules) {
                 lastTreeScopeEventContext = ensureTreeScopeEventContext(currentNode, &currentTreeScope, treeScopeEventContextMap);
             } else {
                 TreeScopeEventContextMap::AddResult addResult = treeScopeEventContextMap.add(&currentTreeScope, TreeScopeEventContext::create(currentTreeScope));
diff --git a/Source/core/events/EventTypeNames.in b/Source/core/events/EventTypeNames.in
index e8d34ad..1f2cc84 100644
--- a/Source/core/events/EventTypeNames.in
+++ b/Source/core/events/EventTypeNames.in
@@ -139,6 +139,8 @@
 pause
 play
 playing
+pointerlockchange
+pointerlockerror
 popstate
 progress
 ratechange
diff --git a/Source/core/events/MessageEvent.idl b/Source/core/events/MessageEvent.idl
index b830e16..bcfcc39 100644
--- a/Source/core/events/MessageEvent.idl
+++ b/Source/core/events/MessageEvent.idl
@@ -27,7 +27,7 @@
 
 [
     EventConstructor,
-    GlobalContext=Window&WorkerGlobalScope,
+    Exposed=Window&Worker,
     RaisesException=Constructor,
     Custom=Wrap,
 ] interface MessageEvent : Event {
diff --git a/Source/core/events/MouseEvent.idl b/Source/core/events/MouseEvent.idl
index 0b9211c..16beaeb 100644
--- a/Source/core/events/MouseEvent.idl
+++ b/Source/core/events/MouseEvent.idl
@@ -30,8 +30,8 @@
     [InitializedByEventConstructor] readonly attribute boolean          metaKey;
     [InitializedByEventConstructor] readonly attribute unsigned short   button;
     [InitializedByEventConstructor] readonly attribute EventTarget?     relatedTarget;
-                                    readonly attribute long             webkitMovementX;
-                                    readonly attribute long             webkitMovementY;
+    [MeasureAs=PrefixedMouseEventMovementX] readonly attribute long webkitMovementX;
+    [MeasureAs=PrefixedMouseEventMovementY] readonly attribute long webkitMovementY;
 
      void initMouseEvent([Default=Undefined] optional DOMString type,
                                        [Default=Undefined] optional boolean canBubble,
diff --git a/Source/core/events/TouchEvent.cpp b/Source/core/events/TouchEvent.cpp
index f252c9a..0abb4a3 100644
--- a/Source/core/events/TouchEvent.cpp
+++ b/Source/core/events/TouchEvent.cpp
@@ -29,6 +29,8 @@
 #include "core/events/TouchEvent.h"
 
 #include "core/events/EventDispatcher.h"
+#include "core/frame/FrameConsole.h"
+#include "core/frame/LocalFrame.h"
 
 namespace WebCore {
 
@@ -91,6 +93,18 @@
     return true;
 }
 
+void TouchEvent::preventDefault()
+{
+    MouseRelatedEvent::preventDefault();
+
+    // A common developer error is to wait too long before attempting to stop
+    // scrolling by consuming a touchmove event. Generate a warning if this
+    // event is uncancelable.
+    if (!cancelable() && view() && view()->frame()) {
+        view()->frame()->console().addMessage(JSMessageSource, WarningMessageLevel,
+            "Ignored attempt to cancel a " + type() + " event with cancelable=false, for example because scrolling is in progress and cannot be interrupted.");
+    }
+}
 void TouchEvent::trace(Visitor* visitor)
 {
     visitor->trace(m_touches);
diff --git a/Source/core/events/TouchEvent.h b/Source/core/events/TouchEvent.h
index b33060d..b384b14 100644
--- a/Source/core/events/TouchEvent.h
+++ b/Source/core/events/TouchEvent.h
@@ -70,6 +70,8 @@
 
     virtual const AtomicString& interfaceName() const OVERRIDE;
 
+    virtual void preventDefault() OVERRIDE;
+
     virtual void trace(Visitor*) OVERRIDE;
 
 private:
diff --git a/Source/core/events/WheelEvent.idl b/Source/core/events/WheelEvent.idl
index 1cba713..6c7acff 100644
--- a/Source/core/events/WheelEvent.idl
+++ b/Source/core/events/WheelEvent.idl
@@ -39,8 +39,10 @@
     readonly attribute long wheelDelta;
 
     // WebKit Extension
+    [MeasureAs=PrefixedWheelEventDirectionInvertedFromDevice]
     readonly attribute boolean webkitDirectionInvertedFromDevice;
 
+    [MeasureAs=PrefixedWheelEventInit]
     void initWebKitWheelEvent([Default=Undefined] optional long wheelDeltaX,
                               [Default=Undefined] optional long wheelDeltaY,
                               [Default=Undefined] optional Window view,
diff --git a/Source/core/fetch/CachingCorrectnessTest.cpp b/Source/core/fetch/CachingCorrectnessTest.cpp
index fa8e8dd..79f5eff 100644
--- a/Source/core/fetch/CachingCorrectnessTest.cpp
+++ b/Source/core/fetch/CachingCorrectnessTest.cpp
@@ -30,8 +30,11 @@
 
 #include "config.h"
 
+#include "core/fetch/ImageResource.h"
 #include "core/fetch/MemoryCache.h"
+#include "core/fetch/Resource.h"
 #include "core/fetch/ResourceFetcher.h"
+#include "core/fetch/ResourcePtr.h"
 #include "core/html/HTMLDocument.h"
 #include "core/loader/DocumentLoader.h"
 #include "platform/network/ResourceRequest.h"
@@ -64,24 +67,24 @@
         m_proxyPlatform.advanceClock(seconds);
     }
 
-    ResourcePtr<Resource> resourceFromResourceResponse(ResourceResponse response)
+    ResourcePtr<Resource> resourceFromResourceResponse(ResourceResponse response, Resource::Type type = Resource::Raw)
     {
         if (response.url().isNull())
             response.setURL(KURL(ParsedURLString, kResourceURL));
         ResourcePtr<Resource> resource =
-            new Resource(ResourceRequest(response.url()), Resource::Raw);
+            new Resource(ResourceRequest(response.url()), type);
         resource->setResponse(response);
         memoryCache()->add(resource.get());
 
         return resource;
     }
 
-    ResourcePtr<Resource> resourceFromResourceRequest(ResourceRequest request)
+    ResourcePtr<Resource> resourceFromResourceRequest(ResourceRequest request, Resource::Type type = Resource::Raw)
     {
         if (request.url().isNull())
             request.setURL(KURL(ParsedURLString, kResourceURL));
         ResourcePtr<Resource> resource =
-            new Resource(request, Resource::Raw);
+            new Resource(request, type);
         resource->setResponse(ResourceResponse(KURL(ParsedURLString, kResourceURL), "text/html", 0, nullAtom, String()));
         memoryCache()->add(resource.get());
 
@@ -94,6 +97,12 @@
         return m_fetcher->fetchSynchronously(fetchRequest);
     }
 
+    ResourcePtr<Resource> fetchImage()
+    {
+        FetchRequest fetchRequest(ResourceRequest(KURL(ParsedURLString, kResourceURL)), FetchInitiatorInfo());
+        return m_fetcher->fetchImage(fetchRequest);
+    }
+
     ResourceFetcher* fetcher() const { return m_fetcher.get(); }
 
 private:
@@ -166,7 +175,7 @@
     RefPtr<DocumentLoader> m_documentLoader;
 
     RefPtr<HTMLDocument> m_document;
-    RefPtr<ResourceFetcher> m_fetcher;
+    RefPtrWillBePersistent<ResourceFetcher> m_fetcher;
 };
 
 TEST_F(CachingCorrectnessTest, FreshFromLastModified)
@@ -250,6 +259,46 @@
     EXPECT_NE(expired200, fetched);
 }
 
+// If the image hasn't been loaded in this "document" before, then it shouldn't have list of available images logic.
+TEST_F(CachingCorrectnessTest, NewImageExpiredFromExpires)
+{
+    ResourceResponse expired200Response;
+    expired200Response.setHTTPStatusCode(200);
+    expired200Response.setHTTPHeaderField("Date", kOriginalRequestDateAsString);
+    expired200Response.setHTTPHeaderField("Expires", kOneDayAfterOriginalRequest);
+
+    ResourcePtr<Resource> expired200 = resourceFromResourceResponse(expired200Response, Resource::Image);
+
+    // Advance the clock within the expiredness period of this resource before we make a request.
+    advanceClock(24. * 60. * 60. + 15.);
+
+    ResourcePtr<Resource> fetched = fetchImage();
+    EXPECT_NE(expired200, fetched);
+}
+
+// If the image has been loaded in this "document" before, then it should have list of available images logic, and so
+// normal cache testing should be bypassed.
+TEST_F(CachingCorrectnessTest, ReuseImageExpiredFromExpires)
+{
+    ResourceResponse expired200Response;
+    expired200Response.setHTTPStatusCode(200);
+    expired200Response.setHTTPHeaderField("Date", kOriginalRequestDateAsString);
+    expired200Response.setHTTPHeaderField("Expires", kOneDayAfterOriginalRequest);
+
+    ResourcePtr<Resource> expired200 = resourceFromResourceResponse(expired200Response, Resource::Image);
+
+    // Advance the clock within the freshness period, and make a request to add this image to the document resources.
+    advanceClock(15.);
+    ResourcePtr<Resource> firstFetched = fetchImage();
+    EXPECT_EQ(expired200, firstFetched);
+
+    // Advance the clock within the expiredness period of this resource before we make a request.
+    advanceClock(24. * 60. * 60. + 15.);
+
+    ResourcePtr<Resource> fetched = fetchImage();
+    EXPECT_EQ(expired200, fetched);
+}
+
 TEST_F(CachingCorrectnessTest, ExpiredFromMaxAge)
 {
     ResourceResponse expired200Response;
diff --git a/Source/core/fetch/DocumentResource.cpp b/Source/core/fetch/DocumentResource.cpp
index 4cb90aa..b1a44ed 100644
--- a/Source/core/fetch/DocumentResource.cpp
+++ b/Source/core/fetch/DocumentResource.cpp
@@ -24,8 +24,8 @@
 
 #include "core/fetch/DocumentResource.h"
 
+#include "core/dom/XMLDocument.h"
 #include "platform/SharedBuffer.h"
-#include "core/svg/SVGDocument.h"
 #include "wtf/text/StringBuilder.h"
 
 namespace WebCore {
@@ -69,7 +69,7 @@
 {
     switch (type()) {
     case SVGDocument:
-        return SVGDocument::create(DocumentInit(url));
+        return XMLDocument::createSVG(DocumentInit(url));
     default:
         // FIXME: We'll add more types to support HTMLImports.
         ASSERT_NOT_REACHED();
diff --git a/Source/core/fetch/FontResource.cpp b/Source/core/fetch/FontResource.cpp
index 05db840..f764aa7 100644
--- a/Source/core/fetch/FontResource.cpp
+++ b/Source/core/fetch/FontResource.cpp
@@ -37,8 +37,8 @@
 
 #if ENABLE(SVG_FONTS)
 #include "SVGNames.h"
+#include "core/dom/XMLDocument.h"
 #include "core/html/HTMLCollection.h"
-#include "core/svg/SVGDocument.h"
 #include "core/svg/SVGFontElement.h"
 #endif
 
@@ -113,7 +113,7 @@
 {
     if (!m_externalSVGDocument && !errorOccurred() && !isLoading()) {
         if (m_data) {
-            m_externalSVGDocument = SVGDocument::create();
+            m_externalSVGDocument = XMLDocument::createSVG();
 
             OwnPtr<TextResourceDecoder> decoder = TextResourceDecoder::create("application/xml");
             String svgSource = decoder->decode(m_data->data(), m_data->size());
diff --git a/Source/core/fetch/FontResource.h b/Source/core/fetch/FontResource.h
index d15455d..f70a4c0 100644
--- a/Source/core/fetch/FontResource.h
+++ b/Source/core/fetch/FontResource.h
@@ -35,9 +35,9 @@
 
 namespace WebCore {
 
+class Document;
 class ResourceFetcher;
 class FontPlatformData;
-class SVGDocument;
 class SVGFontElement;
 class FontCustomPlatformData;
 
@@ -82,7 +82,7 @@
     Timer<FontResource> m_fontLoadWaitLimitTimer;
 
 #if ENABLE(SVG_FONTS)
-    RefPtr<WebCore::SVGDocument> m_externalSVGDocument;
+    RefPtr<WebCore::Document> m_externalSVGDocument;
 #endif
 
     friend class MemoryCache;
diff --git a/Source/core/fetch/Resource.cpp b/Source/core/fetch/Resource.cpp
index 5883066..b8084e9 100644
--- a/Source/core/fetch/Resource.cpp
+++ b/Source/core/fetch/Resource.cpp
@@ -731,7 +731,6 @@
     ASSERT(m_resourceToRevalidate);
     ASSERT(!memoryCache()->contains(m_resourceToRevalidate));
     ASSERT(m_resourceToRevalidate->isLoaded());
-    ASSERT(memoryCache()->contains(this));
 
     // Calling evict() can potentially delete revalidatingResource, which we use
     // below. This mustn't be the case since revalidation means it is loaded
diff --git a/Source/core/fetch/ResourceFetcher.cpp b/Source/core/fetch/ResourceFetcher.cpp
index 51383ae..30d6de9 100644
--- a/Source/core/fetch/ResourceFetcher.cpp
+++ b/Source/core/fetch/ResourceFetcher.cpp
@@ -227,7 +227,7 @@
 }
 
 ResourceFetcher::ResourceFetcher(DocumentLoader* documentLoader)
-    : m_document(0)
+    : m_document(nullptr)
     , m_documentLoader(documentLoader)
     , m_requestCount(0)
     , m_garbageCollectDocumentResourcesTimer(this, &ResourceFetcher::garbageCollectDocumentResourcesTimerFired)
@@ -241,7 +241,7 @@
 ResourceFetcher::~ResourceFetcher()
 {
     m_documentLoader = 0;
-    m_document = 0;
+    m_document = nullptr;
 
     clearPreloads();
 
@@ -978,6 +978,12 @@
         WTF_LOG(ResourceLoading, "ResourceFetcher::determineRevalidationPolicye reloading due to resource being in the error state");
         return Reload;
     }
+
+    // List of available images logic allows images to be re-used without cache validation. We restrict this only to images
+    // from memory cache which are the same as the version in the current document.
+    if (type == Resource::Image && existingResource == cachedResource(request.url()))
+        return Use;
+
     // If any of the redirects in the chain to loading the resource were not cacheable, we cannot reuse our cached resource.
     if (!existingResource->canReuseRedirectChain()) {
         WTF_LOG(ResourceLoading, "ResourceFetcher::determineRevalidationPolicy reloading due to an uncacheable redirect");
@@ -1072,7 +1078,7 @@
 void ResourceFetcher::didLoadResource(Resource* resource)
 {
     RefPtr<DocumentLoader> protectDocumentLoader(m_documentLoader);
-    RefPtr<Document> protectDocument(m_document);
+    RefPtrWillBeRawPtr<Document> protectDocument(m_document.get());
 
     if (resource && resource->response().isHTTP() && ((!resource->errorOccurred() && !resource->wasCanceled()) || resource->response().httpStatusCode() == 304) && document()) {
         ResourceTimingInfoMap::iterator it = m_resourceTimingInfoMap.find(resource);
@@ -1344,6 +1350,7 @@
     return true;
 }
 
+#if !ENABLE(OILPAN)
 void ResourceFetcher::refResourceLoaderHost()
 {
     ref();
@@ -1353,6 +1360,7 @@
 {
     deref();
 }
+#endif
 
 #if PRELOAD_DEBUG
 void ResourceFetcher::printPreloadStats()
@@ -1445,4 +1453,10 @@
     }
 }
 
+void ResourceFetcher::trace(Visitor* visitor)
+{
+    visitor->trace(m_document);
+    ResourceLoaderHost::trace(visitor);
+}
+
 }
diff --git a/Source/core/fetch/ResourceFetcher.h b/Source/core/fetch/ResourceFetcher.h
index 62f7323..740c476 100644
--- a/Source/core/fetch/ResourceFetcher.h
+++ b/Source/core/fetch/ResourceFetcher.h
@@ -69,17 +69,21 @@
 // RefPtr<ResourceFetcher> for their lifetime (and will create one if they
 // are initialized without a LocalFrame), so a Document can keep a ResourceFetcher
 // alive past detach if scripts still reference the Document.
-class ResourceFetcher FINAL : public RefCounted<ResourceFetcher>, public ResourceLoaderHost {
-    WTF_MAKE_NONCOPYABLE(ResourceFetcher); WTF_MAKE_FAST_ALLOCATED;
+class ResourceFetcher FINAL : public RefCountedWillBeGarbageCollectedFinalized<ResourceFetcher>, public ResourceLoaderHost {
+    WTF_MAKE_NONCOPYABLE(ResourceFetcher); WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED;
+    WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(ResourceFetcher);
 friend class ImageLoader;
 friend class ResourceCacheValidationSuppressor;
 
 public:
-    static PassRefPtr<ResourceFetcher> create(DocumentLoader* documentLoader) { return adoptRef(new ResourceFetcher(documentLoader)); }
+    static PassRefPtrWillBeRawPtr<ResourceFetcher> create(DocumentLoader* documentLoader) { return adoptRefWillBeNoop(new ResourceFetcher(documentLoader)); }
     virtual ~ResourceFetcher();
+    virtual void trace(Visitor*);
 
+#if !ENABLE(OILPAN)
     using RefCounted<ResourceFetcher>::ref;
     using RefCounted<ResourceFetcher>::deref;
+#endif
 
     ResourcePtr<Resource> fetchSynchronously(FetchRequest&);
     ResourcePtr<ImageResource> fetchImage(FetchRequest&);
@@ -115,7 +119,7 @@
     LocalFrame* frame() const; // Can be null
     FetchContext& context() const;
     Document* document() const { return m_document; } // Can be null
-    void setDocument(Document* document) { m_document = document; }
+    void setDocument(RawPtr<Document> document) { m_document = document; }
 
     DocumentLoader* documentLoader() const { return m_documentLoader; }
     void clearDocumentLoader() { m_documentLoader = 0; }
@@ -154,8 +158,10 @@
     virtual bool canAccessRedirect(Resource*, ResourceRequest&, const ResourceResponse&, ResourceLoaderOptions&) OVERRIDE;
     virtual bool canAccessResource(Resource*, SecurityOrigin*, const KURL&) const OVERRIDE;
 
+#if !ENABLE(OILPAN)
     virtual void refResourceLoaderHost() OVERRIDE;
     virtual void derefResourceLoaderHost() OVERRIDE;
+#endif
 
     enum ResourceLoadStartType {
         ResourceLoadingFromNetwork,
@@ -201,7 +207,7 @@
 
     HashSet<String> m_validatedURLs;
     mutable DocumentResourceMap m_documentResources;
-    Document* m_document;
+    RawPtrWillBeMember<Document> m_document;
     DocumentLoader* m_documentLoader;
 
     int m_requestCount;
diff --git a/Source/core/fetch/ResourceFetcherTest.cpp b/Source/core/fetch/ResourceFetcherTest.cpp
index 7f8639c..7f3bf55 100644
--- a/Source/core/fetch/ResourceFetcherTest.cpp
+++ b/Source/core/fetch/ResourceFetcherTest.cpp
@@ -53,7 +53,7 @@
     // any attach occurs), but ResourceFetcher can't tell the difference.
     RefPtr<DocumentLoader> documentLoader = DocumentLoader::create(0, ResourceRequest(testURL), SubstituteData());
     RefPtr<HTMLDocument> document = HTMLDocument::create();
-    RefPtr<ResourceFetcher> fetcher(documentLoader->fetcher());
+    RefPtrWillBeRawPtr<ResourceFetcher> fetcher(documentLoader->fetcher());
     fetcher->setDocument(document.get());
     EXPECT_EQ(fetcher->frame(), static_cast<LocalFrame*>(0));
 
diff --git a/Source/core/fetch/ResourceLoader.cpp b/Source/core/fetch/ResourceLoader.cpp
index 85659e8..8833ee0 100644
--- a/Source/core/fetch/ResourceLoader.cpp
+++ b/Source/core/fetch/ResourceLoader.cpp
@@ -61,6 +61,13 @@
     m_host->decrementRequestCount(m_resource);
 }
 
+ResourceLoader::RequestCountTracker::RequestCountTracker(const RequestCountTracker& other)
+{
+    m_host = other.m_host;
+    m_resource = other.m_resource;
+    m_host->incrementRequestCount(m_resource);
+}
+
 PassRefPtr<ResourceLoader> ResourceLoader::create(ResourceLoaderHost* host, Resource* resource, const ResourceRequest& request, const ResourceLoaderOptions& options)
 {
     RefPtr<ResourceLoader> loader(adoptRef(new ResourceLoader(host, resource, options)));
@@ -433,7 +440,7 @@
     WTF_LOG(ResourceLoading, "Failed to load '%s'.\n", m_resource->url().string().latin1().data());
 
     RefPtr<ResourceLoader> protect(this);
-    RefPtr<ResourceLoaderHost> protectHost(m_host);
+    RefPtrWillBeRawPtr<ResourceLoaderHost> protectHost(m_host.get());
     ResourcePtr<Resource> protectResource(m_resource);
     m_state = Finishing;
     m_resource->setResourceError(error);
@@ -465,7 +472,7 @@
     ASSERT(!m_request.downloadToFile());
 
     RefPtr<ResourceLoader> protect(this);
-    RefPtr<ResourceLoaderHost> protectHost(m_host);
+    RefPtrWillBeRawPtr<ResourceLoaderHost> protectHost(m_host.get());
     ResourcePtr<Resource> protectResource(m_resource);
 
     RELEASE_ASSERT(m_connectionState == ConnectionStateNew);
diff --git a/Source/core/fetch/ResourceLoader.h b/Source/core/fetch/ResourceLoader.h
index ab5e3a0..e54611e 100644
--- a/Source/core/fetch/ResourceLoader.h
+++ b/Source/core/fetch/ResourceLoader.h
@@ -89,6 +89,16 @@
     bool reachedTerminalState() const { return m_state == Terminated; }
     const ResourceRequest& request() const { return m_request; }
 
+    class RequestCountTracker {
+    public:
+        RequestCountTracker(ResourceLoaderHost*, Resource*);
+        RequestCountTracker(const RequestCountTracker&);
+        ~RequestCountTracker();
+    private:
+        ResourceLoaderHost* m_host;
+        Resource* m_resource;
+    };
+
 private:
     ResourceLoader(ResourceLoaderHost*, Resource*, const ResourceLoaderOptions&);
 
@@ -102,7 +112,7 @@
     ResourceRequest& applyOptions(ResourceRequest&) const;
 
     OwnPtr<blink::WebURLLoader> m_loader;
-    RefPtr<ResourceLoaderHost> m_host;
+    RefPtrWillBePersistent<ResourceLoaderHost> m_host;
 
     ResourceRequest m_request;
     ResourceRequest m_originalRequest; // Before redirects.
@@ -129,15 +139,6 @@
         ConnectionStateFailed,
     };
 
-    class RequestCountTracker {
-    public:
-        RequestCountTracker(ResourceLoaderHost*, Resource*);
-        ~RequestCountTracker();
-    private:
-        ResourceLoaderHost* m_host;
-        Resource* m_resource;
-    };
-
     Resource* m_resource;
     ResourceLoaderState m_state;
 
diff --git a/Source/core/fetch/ResourceLoaderHost.h b/Source/core/fetch/ResourceLoaderHost.h
index 5615a16..cbf79d3 100644
--- a/Source/core/fetch/ResourceLoaderHost.h
+++ b/Source/core/fetch/ResourceLoaderHost.h
@@ -45,11 +45,8 @@
 
 struct FetchInitiatorInfo;
 
-class ResourceLoaderHost {
+class ResourceLoaderHost : public WillBeGarbageCollectedMixin {
 public:
-    void ref() { refResourceLoaderHost(); }
-    void deref() { derefResourceLoaderHost(); }
-
     virtual void incrementRequestCount(const Resource*) = 0;
     virtual void decrementRequestCount(const Resource*) = 0;
     virtual void didLoadResource(Resource*) = 0;
@@ -74,8 +71,15 @@
     virtual bool defersLoading() const = 0;
     virtual bool isLoadedBy(ResourceLoaderHost*) const = 0;
 
+    virtual void trace(Visitor*) { }
+
+#if !ENABLE(OILPAN)
     virtual void refResourceLoaderHost() = 0;
     virtual void derefResourceLoaderHost() = 0;
+
+    void ref() { refResourceLoaderHost(); }
+    void deref() { derefResourceLoaderHost(); }
+#endif
 };
 
 }
diff --git a/Source/core/fetch/ResourceOwner.h b/Source/core/fetch/ResourceOwner.h
index ebadbe9..13bf70e 100644
--- a/Source/core/fetch/ResourceOwner.h
+++ b/Source/core/fetch/ResourceOwner.h
@@ -46,20 +46,22 @@
 
 protected:
     ResourceOwner();
-    ResourceOwner(const ResourceOwner& other) { setResource(other.resource()); }
+    ResourceOwner(const ResourceOwner& other) { setResource(other.resource(), other.m_subscribing); }
     explicit ResourceOwner(const ResourcePtr<ResourceType>&);
 
-    void setResource(const ResourcePtr<ResourceType>&);
+    void setResource(const ResourcePtr<ResourceType>&, bool subscribing = true);
     void clearResource();
 
     ResourceOwner& operator=(const ResourceOwner& other);
 
 private:
     ResourcePtr<ResourceType> m_resource;
+    bool m_subscribing;
 };
 
 template<class R, class C>
 inline ResourceOwner<R, C>::ResourceOwner()
+    : m_subscribing(false)
 {
 }
 
@@ -78,7 +80,7 @@
 }
 
 template<class R, class C>
-inline void ResourceOwner<R, C>::setResource(const ResourcePtr<R>& newResource)
+inline void ResourceOwner<R, C>::setResource(const ResourcePtr<R>& newResource, bool subscribe)
 {
     if (newResource == m_resource)
         return;
@@ -87,12 +89,15 @@
     // we need to prevent double removal.
     if (ResourcePtr<ResourceType> oldResource = m_resource) {
         m_resource.clear();
-        oldResource->removeClient(this);
+        if (m_subscribing)
+            oldResource->removeClient(this);
     }
 
     if (newResource) {
+        m_subscribing = subscribe;
         m_resource = newResource;
-        m_resource->addClient(this);
+        if (m_subscribing)
+            m_resource->addClient(this);
     }
 }
 
diff --git a/Source/core/fileapi/Blob.idl b/Source/core/fileapi/Blob.idl
index 32adc30..df6662d 100644
--- a/Source/core/fileapi/Blob.idl
+++ b/Source/core/fileapi/Blob.idl
@@ -32,7 +32,7 @@
     WillBeGarbageCollected,
     CustomConstructor,
     CustomConstructor(sequence<any> blobParts, optional BlobPropertyBag options),
-    GlobalContext=Window&WorkerGlobalScope,
+    Exposed=Window&Worker,
     SpecialWrapFor=File,
 ] interface Blob {
     readonly attribute unsigned long long size;
diff --git a/Source/core/fileapi/File.idl b/Source/core/fileapi/File.idl
index 4640ad3..db6c425 100644
--- a/Source/core/fileapi/File.idl
+++ b/Source/core/fileapi/File.idl
@@ -25,10 +25,10 @@
 
 [
     CustomConstructor(sequence<any> blobParts, DOMString fileName, optional BlobPropertyBag options),
-    GlobalContext=Window&WorkerGlobalScope,
+    Exposed=Window&Worker,
 ] interface File : Blob {
     readonly attribute DOMString name;
     [Custom=Getter, MeasureAs=FileGetLastModifiedDate] readonly attribute Date lastModifiedDate;
     [Custom=Getter, RuntimeEnabled=FileConstructor] readonly attribute long long lastModified;
-    readonly attribute DOMString webkitRelativePath;
+    [MeasureAs=PrefixedFileRelativePath] readonly attribute DOMString webkitRelativePath;
 };
diff --git a/Source/core/fileapi/FileReader.idl b/Source/core/fileapi/FileReader.idl
index fd2a781..07bb5a8 100644
--- a/Source/core/fileapi/FileReader.idl
+++ b/Source/core/fileapi/FileReader.idl
@@ -34,7 +34,7 @@
     ActiveDOMObject,
     Constructor,
     ConstructorCallWith=ExecutionContext,
-    GlobalContext=Window&WorkerGlobalScope,
+    Exposed=Window&Worker
 ] interface FileReader : EventTarget {
     // ready states
     const unsigned short EMPTY = 0;
diff --git a/Source/core/fileapi/FileReaderSync.idl b/Source/core/fileapi/FileReaderSync.idl
index 0067a66..8a15084 100644
--- a/Source/core/fileapi/FileReaderSync.idl
+++ b/Source/core/fileapi/FileReaderSync.idl
@@ -30,7 +30,7 @@
 
 [
     WillBeGarbageCollected,
-    GlobalContext=WorkerGlobalScope,
+    Exposed=Worker,
     Constructor
 ] interface FileReaderSync {
     [CallWith=ExecutionContext, RaisesException] ArrayBuffer readAsArrayBuffer(Blob blob);
diff --git a/Source/core/frame/Console.cpp b/Source/core/frame/Console.cpp
index e7a0aba..d8726a4 100644
--- a/Source/core/frame/Console.cpp
+++ b/Source/core/frame/Console.cpp
@@ -80,7 +80,7 @@
 {
     // FIXME: Because we create a new object here each time,
     // console.memory !== console.memory, which seems wrong.
-    return MemoryInfo::create(m_frame);
+    return MemoryInfo::create();
 }
 
 } // namespace WebCore
diff --git a/Source/core/frame/Console.h b/Source/core/frame/Console.h
index dae7df1..849538a 100644
--- a/Source/core/frame/Console.h
+++ b/Source/core/frame/Console.h
@@ -54,7 +54,7 @@
 
     PassRefPtrWillBeRawPtr<MemoryInfo> memory() const;
 
-    void trace(Visitor*) { }
+    virtual void trace(Visitor* visitor) OVERRIDE { ConsoleBase::trace(visitor); }
 
 protected:
     virtual ExecutionContext* context() OVERRIDE;
diff --git a/Source/core/frame/ConsoleBase.h b/Source/core/frame/ConsoleBase.h
index c3fa45a..0697c6b 100644
--- a/Source/core/frame/ConsoleBase.h
+++ b/Source/core/frame/ConsoleBase.h
@@ -71,7 +71,7 @@
     void groupCollapsed(ScriptState*, PassRefPtr<ScriptArguments>);
     void groupEnd();
 
-    virtual void trace(Visitor*) = 0;
+    virtual void trace(Visitor*) { }
 
     virtual ~ConsoleBase();
 
diff --git a/Source/core/frame/DOMTimer.cpp b/Source/core/frame/DOMTimer.cpp
index 15a698e..9013180 100644
--- a/Source/core/frame/DOMTimer.cpp
+++ b/Source/core/frame/DOMTimer.cpp
@@ -53,8 +53,7 @@
 {
     return UserGestureIndicator::processingUserGesture()
         && interval <= maxIntervalForUserGestureForwarding
-        && nestingLevel == 1
-        && !UserGestureIndicator::currentToken()->wasForwarded();
+        && nestingLevel == 1; // Gestures should not be forwarded to nested timers.
 }
 
 double DOMTimer::hiddenPageAlignmentInterval()
@@ -74,6 +73,7 @@
 {
     int timeoutID = context->installNewTimeout(action, timeout, singleShot);
     TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "TimerInstall", "data", InspectorTimerInstallEvent::data(context, timeoutID, timeout, singleShot));
+    TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline.stack"), "CallStack", "stack", InspectorCallStackEvent::currentCallStack());
     // FIXME(361045): remove InspectorInstrumentation calls once DevTools Timeline migrates to tracing.
     InspectorInstrumentation::didInstallTimer(context, timeoutID, timeout, singleShot);
     return timeoutID;
@@ -83,6 +83,7 @@
 {
     context->removeTimeoutByID(timeoutID);
     TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "TimerRemove", "data", InspectorTimerRemoveEvent::data(context, timeoutID));
+    TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline.stack"), "CallStack", "stack", InspectorCallStackEvent::currentCallStack());
     // FIXME(361045): remove InspectorInstrumentation calls once DevTools Timeline migrates to tracing.
     InspectorInstrumentation::didRemoveTimer(context, timeoutID);
 }
@@ -121,8 +122,6 @@
     timerNestingLevel = m_nestingLevel;
     ASSERT(!context->activeDOMObjectsAreSuspended());
     // Only the first execution of a multi-shot timer should get an affirmative user gesture indicator.
-    if (m_userGestureToken)
-        m_userGestureToken->setForwarded();
     UserGestureIndicator gestureIndicator(m_userGestureToken.release());
 
     TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "TimerFire", "data", InspectorTimerFireEvent::data(context, m_timeoutID));
@@ -154,6 +153,7 @@
     action->execute(context);
 
     InspectorInstrumentation::didFireTimer(cookie);
+    TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "UpdateCounters", "data", InspectorUpdateCountersEvent::data());
 
     timerNestingLevel = 0;
 }
diff --git a/Source/core/frame/DOMWindow.cpp b/Source/core/frame/DOMWindow.cpp
index 58eb5f8..9dfe253 100644
--- a/Source/core/frame/DOMWindow.cpp
+++ b/Source/core/frame/DOMWindow.cpp
@@ -59,6 +59,7 @@
 #include "core/frame/Console.h"
 #include "core/frame/DOMPoint.h"
 #include "core/frame/DOMWindowLifecycleNotifier.h"
+#include "core/frame/EventHandlerRegistry.h"
 #include "core/frame/FrameConsole.h"
 #include "core/frame/FrameHost.h"
 #include "core/frame/FrameView.h"
@@ -486,7 +487,12 @@
 
     removeAllEventListeners();
 
+#if ENABLE(OILPAN)
+    ASSERT(m_document->isDisposed());
+#else
     ASSERT(m_document->isStopped());
+#endif
+
     clearDocument();
 }
 
@@ -523,6 +529,7 @@
 
 void DOMWindow::willDetachFrameHost()
 {
+    m_frame->host()->eventHandlerRegistry().didRemoveAllEventHandlers(*this);
     InspectorInstrumentation::frameWindowDiscarded(m_frame, this);
 }
 
@@ -599,7 +606,13 @@
     if (!m_frame)
         return 0;
 
-    return m_frame->orientation();
+    int orientation = screenOrientationAngle(m_frame->view());
+    // For backward compatibility, we want to return a value in the range of
+    // [-90; 180] instead of [0; 360[ because window.orientation used to behave
+    // like that in WebKit (this is a WebKit proprietary API).
+    if (orientation == 270)
+        return -90;
+    return orientation;
 }
 
 Screen& DOMWindow::screen() const
@@ -847,10 +860,7 @@
     if (m_frame->loader().client()->willCheckAndDispatchMessageEvent(timer->targetOrigin(), event.get()))
         return;
 
-    UserGestureToken* token = timer->userGestureToken();
-    if (token)
-        token->setForwarded();
-    UserGestureIndicator gestureIndicator(token);
+    UserGestureIndicator gestureIndicator(timer->userGestureToken());
 
     event->entangleMessagePorts(document());
     dispatchMessageEventWithOriginCheck(timer->targetOrigin(), event, timer->stackTrace());
@@ -1271,7 +1281,7 @@
     return *m_media;
 }
 
-PassRefPtr<CSSStyleDeclaration> DOMWindow::getComputedStyle(Element* elt, const String& pseudoElt) const
+PassRefPtrWillBeRawPtr<CSSStyleDeclaration> DOMWindow::getComputedStyle(Element* elt, const String& pseudoElt) const
 {
     if (!elt)
         return nullptr;
@@ -1494,6 +1504,9 @@
     if (!EventTarget::addEventListener(eventType, listener, useCapture))
         return false;
 
+    if (m_frame && m_frame->host())
+        m_frame->host()->eventHandlerRegistry().didAddEventHandler(*this, eventType);
+
     if (Document* document = this->document()) {
         document->addListenerTypeIfNeeded(eventType);
         if (isTouchEventType(eventType))
@@ -1528,6 +1541,9 @@
     if (!EventTarget::removeEventListener(eventType, listener, useCapture))
         return false;
 
+    if (m_frame && m_frame->host())
+        m_frame->host()->eventHandlerRegistry().didRemoveEventHandler(*this, eventType);
+
     if (Document* document = this->document()) {
         if (isTouchEventType(eventType))
             document->didRemoveTouchEventHandler(document);
@@ -1598,6 +1614,9 @@
 
     lifecycleNotifier().notifyRemoveAllEventListeners(this);
 
+    if (m_frame && m_frame->host())
+        m_frame->host()->eventHandlerRegistry().didRemoveAllEventHandlers(*this);
+
     if (Document* document = this->document())
         document->didClearTouchEventHandlers(document);
 
diff --git a/Source/core/frame/DOMWindow.h b/Source/core/frame/DOMWindow.h
index 2dd0cc3..9c32d5f 100644
--- a/Source/core/frame/DOMWindow.h
+++ b/Source/core/frame/DOMWindow.h
@@ -212,7 +212,7 @@
 
         // DOM Level 2 Style Interface
 
-        PassRefPtr<CSSStyleDeclaration> getComputedStyle(Element*, const String& pseudoElt) const;
+        PassRefPtrWillBeRawPtr<CSSStyleDeclaration> getComputedStyle(Element*, const String& pseudoElt) const;
 
         // WebKit extensions
 
diff --git a/Source/core/frame/EventHandlerRegistry.cpp b/Source/core/frame/EventHandlerRegistry.cpp
new file mode 100644
index 0000000..5161cf9
--- /dev/null
+++ b/Source/core/frame/EventHandlerRegistry.cpp
@@ -0,0 +1,249 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "config.h"
+#include "core/frame/EventHandlerRegistry.h"
+
+#include "core/events/ThreadLocalEventNames.h"
+#include "core/frame/DOMWindow.h"
+#include "core/frame/LocalFrame.h"
+#include "core/html/HTMLFrameOwnerElement.h"
+#include "core/page/Page.h"
+#include "core/page/scrolling/ScrollingCoordinator.h"
+
+namespace WebCore {
+
+EventHandlerRegistry::EventHandlerRegistry(FrameHost& frameHost)
+    : m_frameHost(frameHost)
+{
+}
+
+EventHandlerRegistry::~EventHandlerRegistry()
+{
+    checkConsistency();
+}
+
+bool EventHandlerRegistry::eventTypeToClass(const AtomicString& eventType, EventHandlerClass* result)
+{
+    if (eventType == EventTypeNames::scroll) {
+        *result = ScrollEvent;
+#if ASSERT_ENABLED
+    } else if (eventType == EventTypeNames::load || eventType == EventTypeNames::mousemove || eventType == EventTypeNames::touchstart) {
+        *result = EventsForTesting;
+#endif
+    } else {
+        return false;
+    }
+    return true;
+}
+
+const EventTargetSet* EventHandlerRegistry::eventHandlerTargets(EventHandlerClass handlerClass) const
+{
+    checkConsistency();
+    return &m_targets[handlerClass];
+}
+
+bool EventHandlerRegistry::hasEventHandlers(EventHandlerClass handlerClass) const
+{
+    return m_targets[handlerClass].size();
+}
+
+bool EventHandlerRegistry::updateEventHandlerTargets(ChangeOperation op, EventHandlerClass handlerClass, EventTarget* target)
+{
+    EventTargetSet* targets = &m_targets[handlerClass];
+    if (op == Add) {
+        if (!targets->add(target).isNewEntry) {
+            // Just incremented refcount, no real change.
+            return false;
+        }
+    } else {
+        ASSERT(op == Remove || op == RemoveAll);
+        ASSERT(op == RemoveAll || targets->contains(target));
+
+        if (op == RemoveAll) {
+            if (!targets->contains(target))
+                return false;
+            targets->removeAll(target);
+        } else {
+            if (!targets->remove(target)) {
+                // Just decremented refcount, no real update.
+                return false;
+            }
+        }
+    }
+    return true;
+}
+
+void EventHandlerRegistry::updateEventHandlerInternal(ChangeOperation op, EventHandlerClass handlerClass, EventTarget* target)
+{
+    bool hadHandlers = hasEventHandlers(handlerClass);
+    updateEventHandlerTargets(op, handlerClass, target);
+    bool hasHandlers = hasEventHandlers(handlerClass);
+
+    if (hadHandlers != hasHandlers) {
+        notifyHasHandlersChanged(handlerClass, hasHandlers);
+    }
+    checkConsistency();
+}
+
+void EventHandlerRegistry::updateEventHandlerOfType(ChangeOperation op, const AtomicString& eventType, EventTarget* target)
+{
+    EventHandlerClass handlerClass;
+    if (!eventTypeToClass(eventType, &handlerClass))
+        return;
+    updateEventHandlerInternal(op, handlerClass, target);
+}
+
+void EventHandlerRegistry::didAddEventHandler(EventTarget& target, const AtomicString& eventType)
+{
+    updateEventHandlerOfType(Add, eventType, &target);
+}
+
+void EventHandlerRegistry::didRemoveEventHandler(EventTarget& target, const AtomicString& eventType)
+{
+    updateEventHandlerOfType(Remove, eventType, &target);
+}
+
+void EventHandlerRegistry::didAddEventHandler(EventTarget& target, EventHandlerClass handlerClass)
+{
+    updateEventHandlerInternal(Add, handlerClass, &target);
+}
+
+void EventHandlerRegistry::didRemoveEventHandler(EventTarget& target, EventHandlerClass handlerClass)
+{
+    updateEventHandlerInternal(Remove, handlerClass, &target);
+}
+
+void EventHandlerRegistry::didMoveIntoFrameHost(EventTarget& target)
+{
+    updateAllEventHandlers(Add, target);
+}
+
+void EventHandlerRegistry::didMoveOutOfFrameHost(EventTarget& target)
+{
+    updateAllEventHandlers(RemoveAll, target);
+}
+
+void EventHandlerRegistry::didRemoveAllEventHandlers(EventTarget& target)
+{
+    for (size_t i = 0; i < EventHandlerClassCount; ++i) {
+        EventHandlerClass handlerClass = static_cast<EventHandlerClass>(i);
+        updateEventHandlerInternal(RemoveAll, handlerClass, &target);
+    }
+}
+
+void EventHandlerRegistry::updateAllEventHandlers(ChangeOperation op, EventTarget& target)
+{
+    if (!target.hasEventListeners())
+        return;
+
+    Vector<AtomicString> eventTypes = target.eventTypes();
+    for (size_t i = 0; i < eventTypes.size(); ++i) {
+        EventHandlerClass handlerClass;
+        if (!eventTypeToClass(eventTypes[i], &handlerClass))
+            continue;
+        if (op == RemoveAll) {
+            updateEventHandlerInternal(op, handlerClass, &target);
+            continue;
+        }
+        for (unsigned count = target.getEventListeners(eventTypes[i]).size(); count > 0; --count)
+            updateEventHandlerInternal(op, handlerClass, &target);
+    }
+}
+
+void EventHandlerRegistry::notifyHasHandlersChanged(EventHandlerClass handlerClass, bool hasActiveHandlers)
+{
+    ScrollingCoordinator* scrollingCoordinator = m_frameHost.page().scrollingCoordinator();
+
+    switch (handlerClass) {
+    case ScrollEvent:
+        if (scrollingCoordinator)
+            scrollingCoordinator->updateHaveScrollEventHandlers();
+        break;
+#if ASSERT_ENABLED
+    case EventsForTesting:
+        break;
+#endif
+    default:
+        ASSERT_NOT_REACHED();
+        break;
+    }
+}
+
+void EventHandlerRegistry::trace(Visitor* visitor)
+{
+    visitor->registerWeakMembers<EventHandlerRegistry, &EventHandlerRegistry::clearWeakMembers>(this);
+}
+
+void EventHandlerRegistry::clearWeakMembers(Visitor* visitor)
+{
+    Vector<EventTarget*> deadTargets;
+    for (size_t i = 0; i < EventHandlerClassCount; ++i) {
+        EventHandlerClass handlerClass = static_cast<EventHandlerClass>(i);
+        const EventTargetSet* targets = &m_targets[handlerClass];
+        for (EventTargetSet::const_iterator it = targets->begin(); it != targets->end(); ++it) {
+            Node* node = it->key->toNode();
+            DOMWindow* window = it->key->toDOMWindow();
+            if (node && !visitor->isAlive(node)) {
+                deadTargets.append(node);
+            } else if (window && !visitor->isAlive(window)) {
+                deadTargets.append(window);
+            }
+        }
+    }
+    for (size_t i = 0; i < deadTargets.size(); ++i)
+        didRemoveAllEventHandlers(*deadTargets[i]);
+}
+
+void EventHandlerRegistry::documentDetached(Document& document)
+{
+    // Remove all event targets under the detached document.
+    for (size_t handlerClassIndex = 0; handlerClassIndex < EventHandlerClassCount; ++handlerClassIndex) {
+        EventHandlerClass handlerClass = static_cast<EventHandlerClass>(handlerClassIndex);
+        Vector<EventTarget*> targetsToRemove;
+        const EventTargetSet* targets = &m_targets[handlerClass];
+        for (EventTargetSet::const_iterator iter = targets->begin(); iter != targets->end(); ++iter) {
+            if (Node* node = iter->key->toNode()) {
+                for (Document* doc = &node->document(); doc; doc = doc->ownerElement() ? &doc->ownerElement()->document() : 0) {
+                    if (doc == &document) {
+                        targetsToRemove.append(iter->key);
+                        break;
+                    }
+                }
+            } else if (iter->key->toDOMWindow()) {
+                // DOMWindows may outlive their documents, so we shouldn't remove their handlers
+                // here.
+            } else {
+                ASSERT_NOT_REACHED();
+            }
+        }
+        for (size_t i = 0; i < targetsToRemove.size(); ++i)
+            updateEventHandlerInternal(RemoveAll, handlerClass, targetsToRemove[i]);
+    }
+}
+
+void EventHandlerRegistry::checkConsistency() const
+{
+#if ASSERT_ENABLED
+    for (size_t i = 0; i < EventHandlerClassCount; ++i) {
+        EventHandlerClass handlerClass = static_cast<EventHandlerClass>(i);
+        const EventTargetSet* targets = &m_targets[handlerClass];
+        for (EventTargetSet::const_iterator iter = targets->begin(); iter != targets->end(); ++iter) {
+            if (Node* node = iter->key->toNode()) {
+                // See the comment for |documentDetached| if either of these assertions fails.
+                ASSERT(node->document().frameHost());
+                ASSERT(node->document().frameHost() == &m_frameHost);
+            } else if (DOMWindow* window = iter->key->toDOMWindow()) {
+                // If any of these assertions fail, DOMWindow failed to unregister its handlers
+                // properly.
+                ASSERT(window->frame());
+                ASSERT(window->frame()->host());
+                ASSERT(window->frame()->host() == &m_frameHost);
+            }
+        }
+    }
+#endif // ASSERT_ENABLED
+}
+
+} // namespace WebCore
diff --git a/Source/core/dom/EventHandlerRegistry.h b/Source/core/frame/EventHandlerRegistry.h
similarity index 69%
rename from Source/core/dom/EventHandlerRegistry.h
rename to Source/core/frame/EventHandlerRegistry.h
index 94245af..3a49d51 100644
--- a/Source/core/dom/EventHandlerRegistry.h
+++ b/Source/core/frame/EventHandlerRegistry.h
@@ -5,40 +5,37 @@
 #ifndef EventHandlerRegistry_h
 #define EventHandlerRegistry_h
 
-#include "core/dom/DocumentSupplementable.h"
 #include "core/events/Event.h"
+#include "core/frame/FrameHost.h"
 #include "wtf/HashCountedSet.h"
 
 namespace WebCore {
 
 typedef HashCountedSet<EventTarget*> EventTargetSet;
 
-// Registry for keeping track of event handlers. Handlers can either be
-// associated with an EventTarget or be "external" handlers which live outside
-// the DOM (e.g., WebViewImpl).
-class EventHandlerRegistry FINAL : public NoBaseWillBeGarbageCollectedFinalized<EventHandlerRegistry>, public DocumentSupplement {
-    WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(EventHandlerRegistry);
+// Registry for keeping track of event handlers. Note that only handlers on
+// documents that can be rendered or can receive input (i.e., are attached to a
+// FrameHost) are registered here.
+class EventHandlerRegistry FINAL : public NoBaseWillBeGarbageCollectedFinalized<EventHandlerRegistry> {
 public:
+    explicit EventHandlerRegistry(FrameHost&);
     virtual ~EventHandlerRegistry();
 
     // Supported event handler classes. Note that each one may correspond to
     // multiple event types.
     enum EventHandlerClass {
         ScrollEvent,
+#if ASSERT_ENABLED
+        // Additional event categories for verifying handler tracking logic.
+        EventsForTesting,
+#endif
         EventHandlerClassCount, // Must be the last entry.
     };
 
-    static const char* supplementName();
-    static EventHandlerRegistry* from(Document&);
-
-    // Returns true if the host Document or any child documents have any
-    // registered event handlers of the class.
+    // Returns true if the FrameHost has event handlers of the specified class.
     bool hasEventHandlers(EventHandlerClass) const;
 
-    // Returns a set of EventTargets which have registered handlers of the
-    // given class. Only contains targets directly in this document; all
-    // handlers in a child Document are collapsed to a single respective
-    // Document instance in the set.
+    // Returns a set of EventTargets which have registered handlers of the given class.
     const EventTargetSet* eventHandlerTargets(EventHandlerClass) const;
 
     // Registration and management of event handlers attached to EventTargets.
@@ -46,15 +43,20 @@
     void didAddEventHandler(EventTarget&, EventHandlerClass);
     void didRemoveEventHandler(EventTarget&, const AtomicString& eventType);
     void didRemoveEventHandler(EventTarget&, EventHandlerClass);
-    void didMoveFromOtherDocument(EventTarget&, Document& oldDocument);
     void didRemoveAllEventHandlers(EventTarget&);
+    void didMoveIntoFrameHost(EventTarget&);
+    void didMoveOutOfFrameHost(EventTarget&);
 
-    virtual void trace(Visitor*) OVERRIDE;
+    // Either |documentDetached| or |didMoveOutOfFrameHost| must be called
+    // whenever the FrameHost that is associated with a registered event target
+    // changes. This ensures the registry does not end up with stale references
+    // to handlers that are no longer related to it.
+    void documentDetached(Document&);
+
+    void trace(Visitor*);
     void clearWeakMembers(Visitor*);
 
 private:
-    explicit EventHandlerRegistry(Document&);
-
     enum ChangeOperation {
         Add, // Add a new event handler.
         Remove, // Remove an existing event handler.
@@ -80,15 +82,12 @@
 
     void updateEventHandlerInternal(ChangeOperation, EventHandlerClass, EventTarget*);
 
-    struct HandlerState {
-        HandlerState();
-        ~HandlerState();
+    void updateAllEventHandlers(ChangeOperation, EventTarget&);
 
-        OwnPtr<EventTargetSet> targets;
-    };
+    void checkConsistency() const;
 
-    Document& m_document;
-    HandlerState m_eventHandlers[EventHandlerClassCount];
+    FrameHost& m_frameHost;
+    EventTargetSet m_targets[EventHandlerClassCount];
 };
 
 } // namespace WebCore
diff --git a/Source/core/frame/FrameHost.cpp b/Source/core/frame/FrameHost.cpp
index 002bb72..cc562c9 100644
--- a/Source/core/frame/FrameHost.cpp
+++ b/Source/core/frame/FrameHost.cpp
@@ -31,20 +31,22 @@
 #include "config.h"
 #include "core/frame/FrameHost.h"
 
+#include "core/frame/EventHandlerRegistry.h"
 #include "core/page/Chrome.h"
 #include "core/page/ChromeClient.h"
 #include "core/page/Page.h"
 
 namespace WebCore {
 
-PassOwnPtr<FrameHost> FrameHost::create(Page& page)
+PassOwnPtrWillBeRawPtr<FrameHost> FrameHost::create(Page& page)
 {
-    return adoptPtr(new FrameHost(page));
+    return adoptPtrWillBeNoop(new FrameHost(page));
 }
 
 FrameHost::FrameHost(Page& page)
-    : m_page(page)
+    : m_page(&page)
     , m_pinchViewport(adoptPtr(new PinchViewport(*this)))
+    , m_eventHandlerRegistry(adoptPtrWillBeNoop(new EventHandlerRegistry(*this)))
 {
 }
 
@@ -55,22 +57,22 @@
 
 Settings& FrameHost::settings() const
 {
-    return m_page.settings();
+    return m_page->settings();
 }
 
 Chrome& FrameHost::chrome() const
 {
-    return m_page.chrome();
+    return m_page->chrome();
 }
 
 UseCounter& FrameHost::useCounter() const
 {
-    return m_page.useCounter();
+    return m_page->useCounter();
 }
 
 float FrameHost::deviceScaleFactor() const
 {
-    return m_page.deviceScaleFactor();
+    return m_page->deviceScaleFactor();
 }
 
 PinchViewport& FrameHost::pinchViewport() const
@@ -78,4 +80,15 @@
     return *m_pinchViewport;
 }
 
+EventHandlerRegistry& FrameHost::eventHandlerRegistry() const
+{
+    return *m_eventHandlerRegistry;
+}
+
+void FrameHost::trace(Visitor* visitor)
+{
+    visitor->trace(m_page);
+    visitor->trace(m_eventHandlerRegistry);
+}
+
 }
diff --git a/Source/core/frame/FrameHost.h b/Source/core/frame/FrameHost.h
index f570105..494e171 100644
--- a/Source/core/frame/FrameHost.h
+++ b/Source/core/frame/FrameHost.h
@@ -32,6 +32,7 @@
 #define FrameHost_h
 
 #include "core/frame/PinchViewport.h"
+#include "platform/heap/Handle.h"
 #include "wtf/FastAllocBase.h"
 #include "wtf/Noncopyable.h"
 #include "wtf/OwnPtr.h"
@@ -40,10 +41,12 @@
 namespace WebCore {
 
 class Chrome;
+class EventHandlerRegistry;
 class Page;
 class PinchViewport;
 class Settings;
 class UseCounter;
+class Visitor;
 
 // FrameHost is the set of global data shared between multiple frames
 // and is provided by the embedder to each frame when created.
@@ -54,15 +57,14 @@
 // browser-level concept and Blink core/ only knows about its LocalFrame (and FrameHost).
 // Separating Page from the rest of core/ through this indirection
 // allows us to slowly refactor Page without breaking the rest of core.
-class FrameHost {
-    WTF_MAKE_NONCOPYABLE(FrameHost); WTF_MAKE_FAST_ALLOCATED;
+class FrameHost FINAL : public NoBaseWillBeGarbageCollectedFinalized<FrameHost> {
+    WTF_MAKE_NONCOPYABLE(FrameHost); WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED;
 public:
-    static PassOwnPtr<FrameHost> create(Page&);
+    static PassOwnPtrWillBeRawPtr<FrameHost> create(Page&);
     ~FrameHost();
 
     // Careful: This function will eventually be removed.
-    Page& page() const { return m_page; }
-
+    Page& page() const { return *m_page; }
     Settings& settings() const;
     Chrome& chrome() const;
     UseCounter& useCounter() const;
@@ -73,12 +75,16 @@
     float deviceScaleFactor() const;
 
     PinchViewport& pinchViewport() const;
+    EventHandlerRegistry& eventHandlerRegistry() const;
+
+    void trace(Visitor*);
 
 private:
     explicit FrameHost(Page&);
 
-    Page& m_page;
+    RawPtrWillBeMember<Page> m_page;
     const OwnPtr<PinchViewport> m_pinchViewport;
+    const OwnPtrWillBeMember<EventHandlerRegistry> m_eventHandlerRegistry;
 };
 
 }
diff --git a/Source/core/frame/FrameView.cpp b/Source/core/frame/FrameView.cpp
index 94a1e6d..933b633 100644
--- a/Source/core/frame/FrameView.cpp
+++ b/Source/core/frame/FrameView.cpp
@@ -70,7 +70,7 @@
 #include "core/rendering/compositing/RenderLayerCompositor.h"
 #include "core/rendering/style/RenderStyle.h"
 #include "core/rendering/svg/RenderSVGRoot.h"
-#include "core/svg/SVGDocument.h"
+#include "core/svg/SVGDocumentExtensions.h"
 #include "core/svg/SVGSVGElement.h"
 #include "platform/TraceEvent.h"
 #include "platform/fonts/FontCache.h"
@@ -224,7 +224,6 @@
     m_layoutSchedulingEnabled = true;
     m_inPerformLayout = false;
     m_canRepaintDuringPerformLayout = false;
-    m_doingPreLayoutStyleUpdate = false;
     m_inSynchronousPostLayout = false;
     m_layoutCount = 0;
     m_nestedLayoutCount = 0;
@@ -397,6 +396,11 @@
     }
 
     viewportConstrainedVisibleContentSizeChanged(newRect.width() != oldRect.width(), newRect.height() != oldRect.height());
+
+    if (oldRect.size() != newRect.size()
+        && m_frame->isMainFrame()
+        && m_frame->settings()->pinchVirtualViewportEnabled())
+        page()->frameHost().pinchViewport().mainFrameDidChangeSize();
 }
 
 bool FrameView::scheduleAnimation()
@@ -634,13 +638,6 @@
     RenderView* renderView = this->renderView();
     if (!renderView)
         return;
-
-    // FIXME: These early returns are probably not necessary anymore now that we
-    // just set dirty bits below.
-    // If we expect to update compositing after an incipient layout, don't do so here.
-    if (m_doingPreLayoutStyleUpdate || layoutPending() || renderView->needsLayout())
-        return;
-
     renderView->compositor()->setNeedsCompositingUpdate(CompositingUpdateAfterStyleChange);
 }
 
@@ -775,9 +772,6 @@
         document->evaluateMediaQueryList();
     }
 
-    // Always ensure our style info is up-to-date. This can happen in situations where
-    // the layout beats any sort of style recalc update that needs to occur.
-    TemporaryChange<bool> changeDoingPreLayoutStyleUpdate(m_doingPreLayoutStyleUpdate, true);
     document->updateRenderTreeIfNeeded();
     lifecycle().advanceTo(DocumentLifecycle::StyleClean);
 }
@@ -871,6 +865,7 @@
     RELEASE_ASSERT(!isPainting());
 
     TRACE_EVENT_BEGIN1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "Layout", "beginData", InspectorLayoutEvent::beginData(this));
+    TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline.stack"), "CallStack", "stack", InspectorCallStackEvent::currentCallStack());
     // FIXME(361045): remove InspectorInstrumentation calls once DevTools Timeline migrates to tracing.
     InspectorInstrumentationCookie cookie = InspectorInstrumentation::willLayout(m_frame.get());
 
@@ -1534,7 +1529,7 @@
     m_frame->document()->setCSSTarget(anchorNode);
 
     if (m_frame->document()->isSVGDocument()) {
-        if (SVGSVGElement* svg = toSVGDocument(m_frame->document())->rootElement()) {
+        if (SVGSVGElement* svg = SVGDocumentExtensions::rootElement(*m_frame->document())) {
             svg->setupInitialView(name, anchorNode);
             if (!anchorNode)
                 return true;
@@ -1740,6 +1735,10 @@
         IntRect repaintRect = r;
         repaintRect.move(-scrollOffset());
         m_trackedRepaintRects.append(repaintRect);
+        // FIXME: http://crbug.com/368518. Eventually, repaintContentRectangle
+        // is going away entirely once all layout tests are FCM. In the short
+        // term, no code should be tracking non-composited FrameView repaints.
+        RELEASE_ASSERT_NOT_REACHED();
     }
 
     ScrollView::repaintContentRectangle(r);
@@ -1805,6 +1804,7 @@
     if (!m_frame->document()->shouldScheduleLayout())
         return;
     TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "InvalidateLayout", "frame", m_frame.get());
+    TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline.stack"), "CallStack", "stack", InspectorCallStackEvent::currentCallStack());
     // FIXME(361045): remove InspectorInstrumentation calls once DevTools Timeline migrates to tracing.
     InspectorInstrumentation::didInvalidateLayout(m_frame.get());
 
@@ -1868,6 +1868,7 @@
         lifecycle().ensureStateAtMost(DocumentLifecycle::StyleClean);
     }
     TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "InvalidateLayout", "frame", m_frame.get());
+    TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline.stack"), "CallStack", "stack", InspectorCallStackEvent::currentCallStack());
     // FIXME(361045): remove InspectorInstrumentation calls once DevTools Timeline migrates to tracing.
     InspectorInstrumentation::didInvalidateLayout(m_frame.get());
 }
@@ -2704,6 +2705,7 @@
         return;
 
     TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "Paint", "data", InspectorPaintEvent::data(renderView, rect, 0));
+    TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline.stack"), "CallStack", "stack", InspectorCallStackEvent::currentCallStack());
     // FIXME(361045): remove InspectorInstrumentation calls once DevTools Timeline migrates to tracing.
     InspectorInstrumentation::willPaint(renderView, 0);
 
diff --git a/Source/core/frame/FrameView.h b/Source/core/frame/FrameView.h
index 99c6108..2eaddd3 100644
--- a/Source/core/frame/FrameView.h
+++ b/Source/core/frame/FrameView.h
@@ -445,7 +445,6 @@
     bool m_layoutSchedulingEnabled;
     bool m_inPerformLayout;
     bool m_canRepaintDuringPerformLayout;
-    bool m_doingPreLayoutStyleUpdate;
     bool m_inSynchronousPostLayout;
     int m_layoutCount;
     unsigned m_nestedLayoutCount;
diff --git a/Source/core/frame/ImageBitmap.cpp b/Source/core/frame/ImageBitmap.cpp
index cd66f75..f2bb539 100644
--- a/Source/core/frame/ImageBitmap.cpp
+++ b/Source/core/frame/ImageBitmap.cpp
@@ -224,8 +224,9 @@
     return FloatSize(width(), height());
 }
 
-void ImageBitmap::trace(Visitor*)
+void ImageBitmap::trace(Visitor* visitor)
 {
+    ImageLoaderClient::trace(visitor);
 }
 
 }
diff --git a/Source/core/frame/LocalFrame.cpp b/Source/core/frame/LocalFrame.cpp
index d1f6be3..f85e1c3 100644
--- a/Source/core/frame/LocalFrame.cpp
+++ b/Source/core/frame/LocalFrame.cpp
@@ -58,7 +58,7 @@
 #include "core/rendering/RenderLayer.h"
 #include "core/rendering/RenderView.h"
 #include "core/rendering/compositing/RenderLayerCompositor.h"
-#include "core/svg/SVGDocument.h"
+#include "core/svg/SVGDocumentExtensions.h"
 #include "platform/DragImage.h"
 #include "platform/graphics/GraphicsContext.h"
 #include "platform/graphics/ImageBuffer.h"
@@ -101,7 +101,6 @@
     , m_inputMethodController(InputMethodController::create(*this))
     , m_pageZoomFactor(parentPageZoomFactor(this))
     , m_textZoomFactor(parentTextZoomFactor(this))
-    , m_orientation(0)
     , m_inViewSourceMode(false)
 {
 }
@@ -154,16 +153,19 @@
 
     m_view = view;
 
-    if (m_view && isMainFrame())
-        m_view->setVisibleContentScaleFactor(page()->pageScaleFactor());
+    if (m_view && isMainFrame()) {
+        if (settings()->pinchVirtualViewportEnabled())
+            m_host->pinchViewport().mainFrameDidChangeSize();
+        else
+            m_view->setVisibleContentScaleFactor(page()->pageScaleFactor());
+    }
 }
 
-void LocalFrame::sendOrientationChangeEvent(int orientation)
+void LocalFrame::sendOrientationChangeEvent()
 {
     if (!RuntimeEnabledFeatures::orientationEventEnabled())
         return;
 
-    m_orientation = orientation;
     if (DOMWindow* window = domWindow())
         window->dispatchEvent(Event::create(EventTypeNames::orientationchange));
 }
@@ -444,7 +446,7 @@
     // Respect SVGs zoomAndPan="disabled" property in standalone SVG documents.
     // FIXME: How to handle compound documents + zoomAndPan="disabled"? Needs SVG WG clarification.
     if (document->isSVGDocument()) {
-        if (!toSVGDocument(document)->zoomAndPanEnabled())
+        if (!document->accessSVGExtensions().zoomAndPanEnabled())
             return;
     }
 
diff --git a/Source/core/frame/LocalFrame.h b/Source/core/frame/LocalFrame.h
index 3e96c2b..ab782be 100644
--- a/Source/core/frame/LocalFrame.h
+++ b/Source/core/frame/LocalFrame.h
@@ -130,11 +130,7 @@
         void deviceOrPageScaleFactorChanged();
         double devicePixelRatio() const;
 
-        // Orientation is the interface orientation in degrees. Some examples are:
-        //  0 is straight up; -90 is when the device is rotated 90 clockwise;
-        //  90 is when rotated counter clockwise.
-        void sendOrientationChangeEvent(int orientation);
-        int orientation() const { return m_orientation; }
+        void sendOrientationChangeEvent();
 
         String documentTypeString() const;
 
@@ -175,8 +171,6 @@
         float m_pageZoomFactor;
         float m_textZoomFactor;
 
-        int m_orientation;
-
         bool m_inViewSourceMode;
     };
 
diff --git a/Source/core/frame/Location.cpp b/Source/core/frame/Location.cpp
index 0498b75..c252b20 100644
--- a/Source/core/frame/Location.cpp
+++ b/Source/core/frame/Location.cpp
@@ -115,9 +115,9 @@
     return DOMURLUtilsReadOnly::origin(url());
 }
 
-PassRefPtr<DOMStringList> Location::ancestorOrigins() const
+PassRefPtrWillBeRawPtr<DOMStringList> Location::ancestorOrigins() const
 {
-    RefPtr<DOMStringList> origins = DOMStringList::create();
+    RefPtrWillBeRawPtr<DOMStringList> origins = DOMStringList::create();
     if (!m_frame)
         return origins.release();
     for (LocalFrame* frame = m_frame->tree().parent(); frame; frame = frame->tree().parent())
diff --git a/Source/core/frame/Location.h b/Source/core/frame/Location.h
index e8a0d6d..2e09edc 100644
--- a/Source/core/frame/Location.h
+++ b/Source/core/frame/Location.h
@@ -73,7 +73,7 @@
     String hash() const;
     String origin() const;
 
-    PassRefPtr<DOMStringList> ancestorOrigins() const;
+    PassRefPtrWillBeRawPtr<DOMStringList> ancestorOrigins() const;
 
     void trace(Visitor*) { }
 
diff --git a/Source/core/frame/PRESUBMIT.py b/Source/core/frame/PRESUBMIT.py
new file mode 100644
index 0000000..eba4c2f
--- /dev/null
+++ b/Source/core/frame/PRESUBMIT.py
@@ -0,0 +1,57 @@
+# Copyright 2014 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""Blink frame presubmit script
+
+See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
+for more details about the presubmit API built into gcl.
+"""
+
+
+def _RunUseCounterChecks(input_api, output_api):
+    for f in input_api.AffectedFiles():
+        if f.LocalPath().endswith('UseCounter.cpp'):
+            useCounterCpp = f
+            break
+    else:
+        return []
+
+    largestFoundBucket = 0
+    maximumBucket = 0
+    # Looking for a line like "case CSSPropertyGrid: return 453;"
+    bucketFinder = input_api.re.compile(r'.*CSSProperty.*return\s*([0-9]+).*')
+    # Looking for a line like "static int maximumCSSSampleId() { return 452; }"
+    maximumFinder = input_api.re.compile(
+        r'static int maximumCSSSampleId\(\) { return ([0-9]+)')
+    for line in useCounterCpp.NewContents():
+        bucketMatch = bucketFinder.match(line)
+        if bucketMatch:
+            bucket = int(bucketMatch.group(1))
+            largestFoundBucket = max(largestFoundBucket, bucket)
+        else:
+            maximumMatch = maximumFinder.match(line)
+            if maximumMatch:
+                maximumBucket = int(maximumMatch.group(1))
+
+    if largestFoundBucket != maximumBucket:
+        if input_api.is_committing:
+            message_type = output_api.PresubmitError
+        else:
+            message_type = output_api.PresubmitPromptWarning
+
+        return [message_type(
+            'Largest found CSSProperty bucket Id (%d) does not match '
+            'maximumCSSSampleId (%d)' %
+                    (largestFoundBucket, maximumBucket),
+            items=[useCounterCpp.LocalPath()])]
+
+    return []
+
+
+def CheckChangeOnUpload(input_api, output_api):
+    return _RunUseCounterChecks(input_api, output_api)
+
+
+def CheckChangeOnCommit(input_api, output_api):
+    return _RunUseCounterChecks(input_api, output_api)
diff --git a/Source/core/frame/PinchViewport.cpp b/Source/core/frame/PinchViewport.cpp
index da300fc..505a889 100644
--- a/Source/core/frame/PinchViewport.cpp
+++ b/Source/core/frame/PinchViewport.cpp
@@ -77,12 +77,10 @@
     if (!m_innerViewportContainerLayer || !m_innerViewportScrollLayer)
         return;
 
-    IntSize newSize = clampToOuterViewportSize(size);
-
-    if (m_size == newSize)
+    if (m_size == size)
         return;
 
-    m_size = newSize;
+    m_size = size;
     m_innerViewportContainerLayer->setSize(m_size);
 
     // Make sure we clamp the offset to within the new bounds.
@@ -95,14 +93,6 @@
 
 void PinchViewport::mainFrameDidChangeSize()
 {
-    // If we didn't set a size yet (the pinch viewport is initialized before the main frame's view),
-    // set it now to the main frame's size; otherwise, just make sure the inner viewport's size is
-    // clamped to the new frame size.
-    if (m_size.isZero())
-        setSize(contentsSize());
-    else
-        setSize(m_size);
-
     // In unit tests we may not have initialized the layer tree.
     if (m_innerViewportScrollLayer)
         m_innerViewportScrollLayer->setSize(contentsSize());
@@ -129,7 +119,6 @@
 
     ScrollingCoordinator* coordinator = m_frameHost.page().scrollingCoordinator();
     ASSERT(coordinator);
-
     coordinator->scrollableAreaScrollLayerDidChange(this);
 }
 
@@ -378,11 +367,6 @@
     return clampedOffset;
 }
 
-IntSize PinchViewport::clampToOuterViewportSize(const IntSize& size)
-{
-    return size.shrunkTo(contentsSize());
-}
-
 String PinchViewport::debugName(const GraphicsLayer* graphicsLayer)
 {
     String name;
diff --git a/Source/core/frame/PinchViewport.h b/Source/core/frame/PinchViewport.h
index ef7fbc8..d477e37 100644
--- a/Source/core/frame/PinchViewport.h
+++ b/Source/core/frame/PinchViewport.h
@@ -124,7 +124,6 @@
 
     void setupScrollbar(blink::WebScrollbar::Orientation);
     FloatPoint clampOffsetToBoundaries(const FloatPoint&);
-    IntSize clampToOuterViewportSize(const IntSize&);
 
     LocalFrame* mainFrame() const;
 
diff --git a/Source/core/frame/RemoteFrame.h b/Source/core/frame/RemoteFrame.h
index 1146064..739d619 100644
--- a/Source/core/frame/RemoteFrame.h
+++ b/Source/core/frame/RemoteFrame.h
@@ -21,12 +21,19 @@
     void setView(PassRefPtr<RemoteFrameView>);
     void createView();
 
+    RemoteFrameView* view() const;
+
 private:
     RemoteFrame(FrameHost*, HTMLFrameOwnerElement*);
 
     RefPtr<RemoteFrameView> m_view;
 };
 
+inline RemoteFrameView* RemoteFrame::view() const
+{
+    return m_view.get();
+}
+
 DEFINE_TYPE_CASTS(RemoteFrame, Frame, remoteFrame, remoteFrame->isRemoteFrame(), remoteFrame.isRemoteFrame());
 
 } // namespace WebCore
diff --git a/Source/core/frame/Settings.cpp b/Source/core/frame/Settings.cpp
index dc2bcaa..960f89b 100644
--- a/Source/core/frame/Settings.cpp
+++ b/Source/core/frame/Settings.cpp
@@ -26,6 +26,7 @@
 #include "config.h"
 #include "core/frame/Settings.h"
 
+#include "RuntimeEnabledFeatures.h"
 #include "platform/scroll/ScrollbarTheme.h"
 
 namespace WebCore {
diff --git a/Source/core/frame/Settings.in b/Source/core/frame/Settings.in
index 0980740..9c7ce1b 100644
--- a/Source/core/frame/Settings.in
+++ b/Source/core/frame/Settings.in
@@ -79,7 +79,7 @@
 offlineWebApplicationCacheEnabled initial=false
 usesEncodingDetector initial=false
 allowScriptsToCloseWindows initial=false
-deferredFiltersEnabled initial=false
+deferredFiltersEnabled initial=true
 regionBasedColumnsEnabled initial=false
 
 containerCullingEnabled initial=false
@@ -99,7 +99,6 @@
 acceleratedCompositingForFixedPositionEnabled initial=false, invalidate=AcceleratedCompositing
 acceleratedCompositingForOverflowScrollEnabled initial=false, invalidate=AcceleratedCompositing
 acceleratedCompositingForFixedRootBackgroundEnabled initial=false
-acceleratedCompositingForGpuRasterizationHintEnabled initial=false, invalidate=AcceleratedCompositing
 
 forceCompositingMode initial=false, invalidate=AcceleratedCompositing
 
@@ -119,7 +118,6 @@
 webAudioEnabled initial=false
 
 asynchronousSpellCheckingEnabled initial=false
-preciseMemoryInfoEnabled initial=false
 
 hyperlinkAuditingEnabled initial=false
 allowDisplayOfInsecureContent initial=true
diff --git a/Source/core/frame/UseCounter.cpp b/Source/core/frame/UseCounter.cpp
index 8e9cdf0..4537d99 100644
--- a/Source/core/frame/UseCounter.cpp
+++ b/Source/core/frame/UseCounter.cpp
@@ -528,7 +528,7 @@
     return 0;
 }
 
-static int maximumCSSSampleId() { return 451; }
+static int maximumCSSSampleId() { return 453; }
 
 void UseCounter::muteForInspector()
 {
@@ -682,9 +682,6 @@
     case MediaErrorEncrypted:
         return "'MediaError.MEDIA_ERR_ENCRYPTED' is deprecated. This error code is never used.";
 
-    case PrefixedSpeechAttribute:
-        return "The 'x-webkit-speech' input field attribute is deprecated. Please use the JavaScript API instead.";
-
     case PrefixedGamepad:
         return "'navigator.webkitGetGamepads' is deprecated. Please use 'navigator.getGamepads' instead.";
 
diff --git a/Source/core/frame/UseCounter.h b/Source/core/frame/UseCounter.h
index 6a64140..75eb2f7 100644
--- a/Source/core/frame/UseCounter.h
+++ b/Source/core/frame/UseCounter.h
@@ -99,7 +99,6 @@
         PlaceholderAttribute = 45,
         PrecisionAttribute = 46,
         PrefixedDirectoryAttribute = 47,
-        PrefixedSpeechAttribute = 48,
         RequiredAttribute = 49,
         ResultsAttribute = 50,
         StepAttribute = 51,
@@ -247,10 +246,7 @@
         PrefixedDevicePixelRatioMediaFeature = 233,
         PrefixedMaxDevicePixelRatioMediaFeature = 234,
         PrefixedMinDevicePixelRatioMediaFeature = 235,
-        PrefixedTransform2dMediaFeature = 236,
         PrefixedTransform3dMediaFeature = 237,
-        PrefixedAnimationMediaFeature = 238,
-        PrefixedViewModeMediaFeature = 239,
         PrefixedStorageQuota = 240,
         ContentSecurityPolicyReportOnlyInMeta = 241,
         ResetReferrerPolicy = 243,
@@ -261,7 +257,6 @@
         FormAssociationByParser = 248,
         SVGSVGElementInDocument = 250,
         SVGDocumentRootElement = 251,
-        DocumentCreateEventOptionalArgument = 252,
         MediaErrorEncrypted = 253,
         EventSourceURL = 254,
         WebSocketURL = 255,
@@ -383,8 +378,51 @@
         DocumentImportNodeOptionalArgument = 373,
         HTMLTableElementVspace = 374,
         HTMLTableElementHspace = 375,
+        PrefixedDocumentExitPointerLock = 376,
+        PrefixedDocumentPointerLockElement = 377,
+        PrefixedTouchRadiusX = 378,
+        PrefixedTouchRadiusY = 379,
+        PrefixedTouchRotationAngle = 380,
+        PrefixedTouchForce = 381,
+        PrefixedMouseEventMovementX = 382,
+        PrefixedMouseEventMovementY = 383,
+        PrefixedWheelEventDirectionInvertedFromDevice = 384,
+        PrefixedWheelEventInit = 385,
+        PrefixedFileRelativePath = 386,
+        DocumentCaretRangeFromPoint = 387,
+        DocumentGetCSSCanvasContext = 388,
+        ElementScrollIntoViewIfNeeded = 389,
+        ElementScrollByLines = 390,
+        ElementScrollByPages = 391,
+        RangeCompareNode = 392,
+        RangeExpand = 393,
+        HTMLFrameElementWidth = 394,
+        HTMLFrameElementHeight = 395,
+        HTMLImageElementX = 396,
+        HTMLImageElementY = 397,
+        HTMLOptionsCollectionRemoveElement = 398,
+        HTMLPreElementWrap = 399,
+        SelectionBaseNode = 400,
+        SelectionBaseOffset = 401,
+        SelectionExtentNode = 402,
+        SelectionExtentOffset = 403,
+        SelectionType = 404,
+        SelectionModify = 405,
+        SelectionSetBaseAndExtent = 406,
+        SelectionEmpty = 407,
+        SVGFEMorphologyElementSetRadius = 408,
+        VTTCue = 409,
+        VTTCueRender = 410,
+        VTTCueRenderVertical = 411,
+        VTTCueRenderSnapToLinesFalse = 412,
+        VTTCueRenderLineNotAuto = 413,
+        VTTCueRenderPositionNot50 = 414,
+        VTTCueRenderSizeNot100 = 415,
+        VTTCueRenderAlignNotMiddle = 416,
         // Add new features immediately above this line. Don't change assigned
         // numbers of any item, and don't reuse removed slots.
+        // Also, run update_use_counter_feature_enum.py in chromium/src/tools/metrics/histograms/
+        // to update the UMA mapping.
         NumberOfFeatures, // This enum value must be last.
     };
 
diff --git a/Source/core/frame/Window.idl b/Source/core/frame/Window.idl
index 703cad7..32ced37 100644
--- a/Source/core/frame/Window.idl
+++ b/Source/core/frame/Window.idl
@@ -31,6 +31,7 @@
     CheckSecurity=Frame,
     Custom=ToV8,
     ImplementedAs=DOMWindow,
+    PrimaryGlobal,
     WillBeGarbageCollected,
 ] interface Window : EventTarget {
     // DOM Level 0
@@ -204,29 +205,6 @@
     [RuntimeEnabled=CSSAnimationUnprefixed] attribute WebKitAnimationEventConstructor AnimationEvent;
     [MeasureAs=PrefixedWindowURL] attribute URLConstructor webkitURL; // FIXME: deprecate this.
     [MeasureAs=PrefixedMutationObserverConstructor] attribute MutationObserverConstructor WebKitMutationObserver;
-    [MeasureAs=PrefixedIDBCursorConstructor] attribute IDBCursorConstructor webkitIDBCursor;
-    [MeasureAs=PrefixedIDBDatabaseConstructor] attribute IDBDatabaseConstructor webkitIDBDatabase;
-    [MeasureAs=PrefixedIDBFactoryConstructor] attribute IDBFactoryConstructor webkitIDBFactory;
-    [MeasureAs=PrefixedIDBIndexConstructor] attribute IDBIndexConstructor webkitIDBIndex;
-    [MeasureAs=PrefixedIDBKeyRangeConstructor] attribute IDBKeyRangeConstructor webkitIDBKeyRange;
-    [MeasureAs=PrefixedIDBObjectStoreConstructor] attribute IDBObjectStoreConstructor webkitIDBObjectStore;
-    [MeasureAs=PrefixedIDBRequestConstructor] attribute IDBRequestConstructor webkitIDBRequest;
-    [MeasureAs=PrefixedIDBTransactionConstructor] attribute IDBTransactionConstructor webkitIDBTransaction;
-
-    // Constructors whose name does not match the interface name.
-    // FIXME: Remove these once [ImplementedAs] is used and once constructor names match interface names.
-    [RuntimeEnabled=MediaStream] attribute MediaStreamConstructor webkitMediaStream;
-    // Support both prefixed and unprefixed WebAudio
-    [Conditional=WEB_AUDIO, RuntimeEnabled=WebAudio] attribute AudioContextConstructor AudioContext;
-    [Conditional=WEB_AUDIO, RuntimeEnabled=WebAudio] attribute OfflineAudioContextConstructor OfflineAudioContext;
-    [Conditional=WEB_AUDIO, RuntimeEnabled=WebAudio] attribute AudioContextConstructor webkitAudioContext;
-    [Conditional=WEB_AUDIO, RuntimeEnabled=WebAudio] attribute OfflineAudioContextConstructor webkitOfflineAudioContext;
-    [RuntimeEnabled=PeerConnection] attribute RTCPeerConnectionConstructor webkitRTCPeerConnection;
-    [RuntimeEnabled=ScriptedSpeech] attribute SpeechGrammarConstructor webkitSpeechGrammar;
-    [RuntimeEnabled=ScriptedSpeech] attribute SpeechGrammarListConstructor webkitSpeechGrammarList;
-    [RuntimeEnabled=ScriptedSpeech] attribute SpeechRecognitionConstructor webkitSpeechRecognition;
-    [RuntimeEnabled=ScriptedSpeech] attribute SpeechRecognitionErrorConstructor webkitSpeechRecognitionError;
-    [RuntimeEnabled=ScriptedSpeech] attribute SpeechRecognitionEventConstructor webkitSpeechRecognitionEvent;
 
     // window.toString() requires special handling in V8
     [DoNotCheckSignature, DoNotCheckSecurity, Custom, NotEnumerable] DOMString toString();
@@ -236,7 +214,6 @@
 };
 
 Window implements GlobalEventHandlers;
-Window implements ImageBitmapFactories;
 Window implements WindowBase64;
 Window implements WindowEventHandlers;
 Window implements WindowTimers;
diff --git a/Source/core/generate_inspector_protocol_version.target.darwin-arm.mk b/Source/core/generate_inspector_protocol_version.target.darwin-arm.mk
index 2c6cefd..9c29946 100644
--- a/Source/core/generate_inspector_protocol_version.target.darwin-arm.mk
+++ b/Source/core/generate_inspector_protocol_version.target.darwin-arm.mk
@@ -16,6 +16,7 @@
 
 ### Rules for action "generateInspectorProtocolVersion":
 $(gyp_shared_intermediate_dir)/blink/InspectorProtocolVersion.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/InspectorProtocolVersion.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/InspectorProtocolVersion.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InspectorProtocolVersion.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InspectorProtocolVersion.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/generate_inspector_protocol_version.target.darwin-arm64.mk b/Source/core/generate_inspector_protocol_version.target.darwin-arm64.mk
index 2c6cefd..9c29946 100644
--- a/Source/core/generate_inspector_protocol_version.target.darwin-arm64.mk
+++ b/Source/core/generate_inspector_protocol_version.target.darwin-arm64.mk
@@ -16,6 +16,7 @@
 
 ### Rules for action "generateInspectorProtocolVersion":
 $(gyp_shared_intermediate_dir)/blink/InspectorProtocolVersion.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/InspectorProtocolVersion.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/InspectorProtocolVersion.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InspectorProtocolVersion.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InspectorProtocolVersion.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/generate_inspector_protocol_version.target.darwin-mips.mk b/Source/core/generate_inspector_protocol_version.target.darwin-mips.mk
index 2c6cefd..9c29946 100644
--- a/Source/core/generate_inspector_protocol_version.target.darwin-mips.mk
+++ b/Source/core/generate_inspector_protocol_version.target.darwin-mips.mk
@@ -16,6 +16,7 @@
 
 ### Rules for action "generateInspectorProtocolVersion":
 $(gyp_shared_intermediate_dir)/blink/InspectorProtocolVersion.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/InspectorProtocolVersion.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/InspectorProtocolVersion.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InspectorProtocolVersion.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InspectorProtocolVersion.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/generate_inspector_protocol_version.target.darwin-x86.mk b/Source/core/generate_inspector_protocol_version.target.darwin-x86.mk
index 2c6cefd..9c29946 100644
--- a/Source/core/generate_inspector_protocol_version.target.darwin-x86.mk
+++ b/Source/core/generate_inspector_protocol_version.target.darwin-x86.mk
@@ -16,6 +16,7 @@
 
 ### Rules for action "generateInspectorProtocolVersion":
 $(gyp_shared_intermediate_dir)/blink/InspectorProtocolVersion.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/InspectorProtocolVersion.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/InspectorProtocolVersion.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InspectorProtocolVersion.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InspectorProtocolVersion.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/generate_inspector_protocol_version.target.darwin-x86_64.mk b/Source/core/generate_inspector_protocol_version.target.darwin-x86_64.mk
index 2c6cefd..9c29946 100644
--- a/Source/core/generate_inspector_protocol_version.target.darwin-x86_64.mk
+++ b/Source/core/generate_inspector_protocol_version.target.darwin-x86_64.mk
@@ -16,6 +16,7 @@
 
 ### Rules for action "generateInspectorProtocolVersion":
 $(gyp_shared_intermediate_dir)/blink/InspectorProtocolVersion.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/InspectorProtocolVersion.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/InspectorProtocolVersion.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InspectorProtocolVersion.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InspectorProtocolVersion.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/generate_inspector_protocol_version.target.linux-arm.mk b/Source/core/generate_inspector_protocol_version.target.linux-arm.mk
index 2c6cefd..9c29946 100644
--- a/Source/core/generate_inspector_protocol_version.target.linux-arm.mk
+++ b/Source/core/generate_inspector_protocol_version.target.linux-arm.mk
@@ -16,6 +16,7 @@
 
 ### Rules for action "generateInspectorProtocolVersion":
 $(gyp_shared_intermediate_dir)/blink/InspectorProtocolVersion.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/InspectorProtocolVersion.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/InspectorProtocolVersion.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InspectorProtocolVersion.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InspectorProtocolVersion.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/generate_inspector_protocol_version.target.linux-arm64.mk b/Source/core/generate_inspector_protocol_version.target.linux-arm64.mk
index 2c6cefd..9c29946 100644
--- a/Source/core/generate_inspector_protocol_version.target.linux-arm64.mk
+++ b/Source/core/generate_inspector_protocol_version.target.linux-arm64.mk
@@ -16,6 +16,7 @@
 
 ### Rules for action "generateInspectorProtocolVersion":
 $(gyp_shared_intermediate_dir)/blink/InspectorProtocolVersion.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/InspectorProtocolVersion.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/InspectorProtocolVersion.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InspectorProtocolVersion.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InspectorProtocolVersion.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/generate_inspector_protocol_version.target.linux-mips.mk b/Source/core/generate_inspector_protocol_version.target.linux-mips.mk
index 2c6cefd..9c29946 100644
--- a/Source/core/generate_inspector_protocol_version.target.linux-mips.mk
+++ b/Source/core/generate_inspector_protocol_version.target.linux-mips.mk
@@ -16,6 +16,7 @@
 
 ### Rules for action "generateInspectorProtocolVersion":
 $(gyp_shared_intermediate_dir)/blink/InspectorProtocolVersion.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/InspectorProtocolVersion.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/InspectorProtocolVersion.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InspectorProtocolVersion.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InspectorProtocolVersion.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/generate_inspector_protocol_version.target.linux-x86.mk b/Source/core/generate_inspector_protocol_version.target.linux-x86.mk
index 2c6cefd..9c29946 100644
--- a/Source/core/generate_inspector_protocol_version.target.linux-x86.mk
+++ b/Source/core/generate_inspector_protocol_version.target.linux-x86.mk
@@ -16,6 +16,7 @@
 
 ### Rules for action "generateInspectorProtocolVersion":
 $(gyp_shared_intermediate_dir)/blink/InspectorProtocolVersion.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/InspectorProtocolVersion.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/InspectorProtocolVersion.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InspectorProtocolVersion.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InspectorProtocolVersion.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/generate_inspector_protocol_version.target.linux-x86_64.mk b/Source/core/generate_inspector_protocol_version.target.linux-x86_64.mk
index 2c6cefd..9c29946 100644
--- a/Source/core/generate_inspector_protocol_version.target.linux-x86_64.mk
+++ b/Source/core/generate_inspector_protocol_version.target.linux-x86_64.mk
@@ -16,6 +16,7 @@
 
 ### Rules for action "generateInspectorProtocolVersion":
 $(gyp_shared_intermediate_dir)/blink/InspectorProtocolVersion.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/InspectorProtocolVersion.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/InspectorProtocolVersion.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InspectorProtocolVersion.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InspectorProtocolVersion.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/generated_testing_idls.target.darwin-arm.mk b/Source/core/generated_testing_idls.target.darwin-arm.mk
index fca19e8..d9179af 100644
--- a/Source/core/generated_testing_idls.target.darwin-arm.mk
+++ b/Source/core/generated_testing_idls.target.darwin-arm.mk
@@ -16,6 +16,7 @@
 
 ### Rules for action "Settings":
 $(gyp_shared_intermediate_dir)/blink/SettingsMacros.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/SettingsMacros.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/SettingsMacros.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/SettingsMacros.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/SettingsMacros.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -29,6 +30,7 @@
 
 ### Rules for action "InternalRuntimeFlags":
 $(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/generated_testing_idls.target.darwin-arm64.mk b/Source/core/generated_testing_idls.target.darwin-arm64.mk
index fca19e8..d9179af 100644
--- a/Source/core/generated_testing_idls.target.darwin-arm64.mk
+++ b/Source/core/generated_testing_idls.target.darwin-arm64.mk
@@ -16,6 +16,7 @@
 
 ### Rules for action "Settings":
 $(gyp_shared_intermediate_dir)/blink/SettingsMacros.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/SettingsMacros.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/SettingsMacros.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/SettingsMacros.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/SettingsMacros.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -29,6 +30,7 @@
 
 ### Rules for action "InternalRuntimeFlags":
 $(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/generated_testing_idls.target.darwin-mips.mk b/Source/core/generated_testing_idls.target.darwin-mips.mk
index fca19e8..d9179af 100644
--- a/Source/core/generated_testing_idls.target.darwin-mips.mk
+++ b/Source/core/generated_testing_idls.target.darwin-mips.mk
@@ -16,6 +16,7 @@
 
 ### Rules for action "Settings":
 $(gyp_shared_intermediate_dir)/blink/SettingsMacros.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/SettingsMacros.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/SettingsMacros.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/SettingsMacros.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/SettingsMacros.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -29,6 +30,7 @@
 
 ### Rules for action "InternalRuntimeFlags":
 $(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/generated_testing_idls.target.darwin-x86.mk b/Source/core/generated_testing_idls.target.darwin-x86.mk
index fca19e8..d9179af 100644
--- a/Source/core/generated_testing_idls.target.darwin-x86.mk
+++ b/Source/core/generated_testing_idls.target.darwin-x86.mk
@@ -16,6 +16,7 @@
 
 ### Rules for action "Settings":
 $(gyp_shared_intermediate_dir)/blink/SettingsMacros.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/SettingsMacros.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/SettingsMacros.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/SettingsMacros.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/SettingsMacros.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -29,6 +30,7 @@
 
 ### Rules for action "InternalRuntimeFlags":
 $(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/generated_testing_idls.target.darwin-x86_64.mk b/Source/core/generated_testing_idls.target.darwin-x86_64.mk
index fca19e8..d9179af 100644
--- a/Source/core/generated_testing_idls.target.darwin-x86_64.mk
+++ b/Source/core/generated_testing_idls.target.darwin-x86_64.mk
@@ -16,6 +16,7 @@
 
 ### Rules for action "Settings":
 $(gyp_shared_intermediate_dir)/blink/SettingsMacros.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/SettingsMacros.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/SettingsMacros.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/SettingsMacros.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/SettingsMacros.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -29,6 +30,7 @@
 
 ### Rules for action "InternalRuntimeFlags":
 $(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/generated_testing_idls.target.linux-arm.mk b/Source/core/generated_testing_idls.target.linux-arm.mk
index fca19e8..d9179af 100644
--- a/Source/core/generated_testing_idls.target.linux-arm.mk
+++ b/Source/core/generated_testing_idls.target.linux-arm.mk
@@ -16,6 +16,7 @@
 
 ### Rules for action "Settings":
 $(gyp_shared_intermediate_dir)/blink/SettingsMacros.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/SettingsMacros.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/SettingsMacros.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/SettingsMacros.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/SettingsMacros.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -29,6 +30,7 @@
 
 ### Rules for action "InternalRuntimeFlags":
 $(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/generated_testing_idls.target.linux-arm64.mk b/Source/core/generated_testing_idls.target.linux-arm64.mk
index fca19e8..d9179af 100644
--- a/Source/core/generated_testing_idls.target.linux-arm64.mk
+++ b/Source/core/generated_testing_idls.target.linux-arm64.mk
@@ -16,6 +16,7 @@
 
 ### Rules for action "Settings":
 $(gyp_shared_intermediate_dir)/blink/SettingsMacros.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/SettingsMacros.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/SettingsMacros.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/SettingsMacros.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/SettingsMacros.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -29,6 +30,7 @@
 
 ### Rules for action "InternalRuntimeFlags":
 $(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/generated_testing_idls.target.linux-mips.mk b/Source/core/generated_testing_idls.target.linux-mips.mk
index fca19e8..d9179af 100644
--- a/Source/core/generated_testing_idls.target.linux-mips.mk
+++ b/Source/core/generated_testing_idls.target.linux-mips.mk
@@ -16,6 +16,7 @@
 
 ### Rules for action "Settings":
 $(gyp_shared_intermediate_dir)/blink/SettingsMacros.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/SettingsMacros.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/SettingsMacros.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/SettingsMacros.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/SettingsMacros.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -29,6 +30,7 @@
 
 ### Rules for action "InternalRuntimeFlags":
 $(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/generated_testing_idls.target.linux-x86.mk b/Source/core/generated_testing_idls.target.linux-x86.mk
index fca19e8..d9179af 100644
--- a/Source/core/generated_testing_idls.target.linux-x86.mk
+++ b/Source/core/generated_testing_idls.target.linux-x86.mk
@@ -16,6 +16,7 @@
 
 ### Rules for action "Settings":
 $(gyp_shared_intermediate_dir)/blink/SettingsMacros.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/SettingsMacros.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/SettingsMacros.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/SettingsMacros.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/SettingsMacros.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -29,6 +30,7 @@
 
 ### Rules for action "InternalRuntimeFlags":
 $(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/generated_testing_idls.target.linux-x86_64.mk b/Source/core/generated_testing_idls.target.linux-x86_64.mk
index fca19e8..d9179af 100644
--- a/Source/core/generated_testing_idls.target.linux-x86_64.mk
+++ b/Source/core/generated_testing_idls.target.linux-x86_64.mk
@@ -16,6 +16,7 @@
 
 ### Rules for action "Settings":
 $(gyp_shared_intermediate_dir)/blink/SettingsMacros.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/SettingsMacros.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/SettingsMacros.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/SettingsMacros.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/SettingsMacros.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -29,6 +30,7 @@
 
 ### Rules for action "InternalRuntimeFlags":
 $(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/html/ClassList.cpp b/Source/core/html/ClassList.cpp
index ba44f7b..431af7b 100644
--- a/Source/core/html/ClassList.cpp
+++ b/Source/core/html/ClassList.cpp
@@ -32,6 +32,7 @@
 
 ClassList::ClassList(Element* element) : m_element(element) { }
 
+#if !ENABLE(OILPAN)
 void ClassList::ref()
 {
     m_element->ref();
@@ -41,6 +42,7 @@
 {
     m_element->deref();
 }
+#endif
 
 unsigned ClassList::length() const
 {
@@ -70,4 +72,10 @@
     return m_element->elementData()->classNames();
 }
 
+void ClassList::trace(Visitor* visitor)
+{
+    visitor->trace(m_element);
+    DOMTokenList::trace(visitor);
+}
+
 } // namespace WebCore
diff --git a/Source/core/html/ClassList.h b/Source/core/html/ClassList.h
index 9453631..f795a45 100644
--- a/Source/core/html/ClassList.h
+++ b/Source/core/html/ClassList.h
@@ -40,13 +40,15 @@
 
 class ClassList FINAL : public DOMTokenList {
 public:
-    static PassOwnPtr<ClassList> create(Element* element)
+    static PassOwnPtrWillBeRawPtr<ClassList> create(Element* element)
     {
-        return adoptPtr(new ClassList(element));
+        return adoptPtrWillBeNoop(new ClassList(element));
     }
 
+#if !ENABLE(OILPAN)
     virtual void ref() OVERRIDE;
     virtual void deref() OVERRIDE;
+#endif
 
     virtual unsigned length() const OVERRIDE;
     virtual const AtomicString item(unsigned index) const OVERRIDE;
@@ -55,8 +57,10 @@
 
     void clearValueForQuirksMode() { m_classNamesForQuirksMode = nullptr; }
 
+    virtual void trace(Visitor*) OVERRIDE;
+
 private:
-    ClassList(Element*);
+    explicit ClassList(Element*);
 
     virtual bool containsInternal(const AtomicString&) const OVERRIDE;
 
@@ -65,7 +69,7 @@
     virtual const AtomicString& value() const OVERRIDE { return m_element->getAttribute(HTMLNames::classAttr); }
     virtual void setValue(const AtomicString& value) OVERRIDE { m_element->setAttribute(HTMLNames::classAttr, value); }
 
-    Element* m_element;
+    RawPtrWillBeMember<Element> m_element;
     mutable OwnPtr<SpaceSplitString> m_classNamesForQuirksMode;
 };
 
diff --git a/Source/core/html/FormAssociatedElement.cpp b/Source/core/html/FormAssociatedElement.cpp
index a34beaa..6a809af 100644
--- a/Source/core/html/FormAssociatedElement.cpp
+++ b/Source/core/html/FormAssociatedElement.cpp
@@ -36,16 +36,18 @@
 
 using namespace HTMLNames;
 
-class FormAttributeTargetObserver : IdTargetObserver {
-    WTF_MAKE_FAST_ALLOCATED;
+// FIXME: Oilpan: IdTargetObserver should be on-heap.
+class FormAttributeTargetObserver : public NoBaseWillBeGarbageCollectedFinalized<FormAttributeTargetObserver>, public IdTargetObserver {
+    WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED;
 public:
-    static PassOwnPtr<FormAttributeTargetObserver> create(const AtomicString& id, FormAssociatedElement*);
+    static PassOwnPtrWillBeRawPtr<FormAttributeTargetObserver> create(const AtomicString& id, FormAssociatedElement*);
+    void trace(Visitor* visitor) { visitor->trace(m_element); }
     virtual void idTargetChanged() OVERRIDE;
 
 private:
     FormAttributeTargetObserver(const AtomicString& id, FormAssociatedElement*);
 
-    FormAssociatedElement* m_element;
+    RawPtrWillBeMember<FormAssociatedElement> m_element;
 };
 
 FormAssociatedElement::FormAssociatedElement()
@@ -58,6 +60,13 @@
     // We can't call setForm here because it contains virtual calls.
 }
 
+void FormAssociatedElement::trace(Visitor* visitor)
+{
+    visitor->trace(m_formAttributeTargetObserver);
+    visitor->trace(m_form);
+    visitor->trace(m_validityState);
+}
+
 ValidityState* FormAssociatedElement::validity()
 {
     if (!m_validityState)
@@ -70,7 +79,7 @@
 {
     HTMLElement* element = toHTMLElement(this);
     if (element->fastHasAttribute(formAttr))
-        m_formAttributeTargetObserver = nullptr;
+        setFormAttributeTargetObserver(nullptr);
 }
 
 void FormAssociatedElement::insertedInto(ContainerNode* insertionPoint)
@@ -90,7 +99,7 @@
 {
     HTMLElement* element = toHTMLElement(this);
     if (insertionPoint->inDocument() && element->fastHasAttribute(formAttr))
-        m_formAttributeTargetObserver = nullptr;
+        setFormAttributeTargetObserver(nullptr);
     // If the form and element are both in the same tree, preserve the connection to the form.
     // Otherwise, null out our form and remove ourselves from the form's list of elements.
     if (m_form && element->highestAncestorOrSelf() != m_form->highestAncestorOrSelf())
@@ -142,10 +151,18 @@
     if (m_form)
         m_form->disassociate(*this);
     if (newForm) {
+#if ENABLE(OILPAN)
+        m_form = newForm;
+#else
         m_form = newForm->createWeakPtr();
+#endif
         m_form->associate(*this);
     } else {
+#if ENABLE(OILPAN)
+        m_form = nullptr;
+#else
         m_form = WeakPtr<HTMLFormElement>();
+#endif
     }
     didChangeForm();
 }
@@ -253,14 +270,21 @@
     m_customValidationMessage = error;
 }
 
+void FormAssociatedElement::setFormAttributeTargetObserver(PassOwnPtrWillBeRawPtr<FormAttributeTargetObserver> newObserver)
+{
+    if (m_formAttributeTargetObserver)
+        m_formAttributeTargetObserver->unregister();
+    m_formAttributeTargetObserver = newObserver;
+}
+
 void FormAssociatedElement::resetFormAttributeTargetObserver()
 {
     HTMLElement* element = toHTMLElement(this);
     const AtomicString& formId(element->fastGetAttribute(formAttr));
     if (!formId.isNull() && element->inDocument())
-        m_formAttributeTargetObserver = FormAttributeTargetObserver::create(formId, this);
+        setFormAttributeTargetObserver(FormAttributeTargetObserver::create(formId, this));
     else
-        m_formAttributeTargetObserver = nullptr;
+        setFormAttributeTargetObserver(nullptr);
 }
 
 void FormAssociatedElement::formAttributeTargetChanged()
@@ -303,9 +327,9 @@
     return const_cast<HTMLElement&>(toHTMLElement(static_cast<const FormAssociatedElement&>(associatedElement)));
 }
 
-PassOwnPtr<FormAttributeTargetObserver> FormAttributeTargetObserver::create(const AtomicString& id, FormAssociatedElement* element)
+PassOwnPtrWillBeRawPtr<FormAttributeTargetObserver> FormAttributeTargetObserver::create(const AtomicString& id, FormAssociatedElement* element)
 {
-    return adoptPtr(new FormAttributeTargetObserver(id, element));
+    return adoptPtrWillBeNoop(new FormAttributeTargetObserver(id, element));
 }
 
 FormAttributeTargetObserver::FormAttributeTargetObserver(const AtomicString& id, FormAssociatedElement* element)
diff --git a/Source/core/html/FormAssociatedElement.h b/Source/core/html/FormAssociatedElement.h
index f0f1851..e41483a 100644
--- a/Source/core/html/FormAssociatedElement.h
+++ b/Source/core/html/FormAssociatedElement.h
@@ -24,6 +24,7 @@
 #ifndef FormAssociatedElement_h
 #define FormAssociatedElement_h
 
+#include "platform/heap/Handle.h"
 #include "wtf/WeakPtr.h"
 #include "wtf/text/WTFString.h"
 
@@ -40,12 +41,14 @@
 class ValidityState;
 class VisibleSelection;
 
-class FormAssociatedElement {
+class FormAssociatedElement : public WillBeGarbageCollectedMixin {
 public:
     virtual ~FormAssociatedElement();
 
+#if !ENABLE(OILPAN)
     void ref() { refFormAssociatedElement(); }
     void deref() { derefFormAssociatedElement(); }
+#endif
 
     static HTMLFormElement* findAssociatedForm(const HTMLElement*);
     HTMLFormElement* form() const { return m_form.get(); }
@@ -87,9 +90,12 @@
 
     void formAttributeTargetChanged();
 
+    typedef WillBeHeapVector<RawPtrWillBeMember<FormAssociatedElement> > List;
+
 protected:
     FormAssociatedElement();
 
+    void trace(Visitor*);
     void insertedInto(ContainerNode*);
     void removedFrom(ContainerNode*);
     void didMoveToNewDocument(Document& oldDocument);
@@ -109,15 +115,21 @@
     String customValidationMessage() const;
 
 private:
+#if !ENABLE(OILPAN)
     virtual void refFormAssociatedElement() = 0;
     virtual void derefFormAssociatedElement() = 0;
+#endif
 
+    void setFormAttributeTargetObserver(PassOwnPtrWillBeRawPtr<FormAttributeTargetObserver>);
     void resetFormAttributeTargetObserver();
 
-    OwnPtr<FormAttributeTargetObserver> m_formAttributeTargetObserver;
-    // m_form should be a strong reference in Oilpan.
+    OwnPtrWillBeMember<FormAttributeTargetObserver> m_formAttributeTargetObserver;
+#if ENABLE(OILPAN)
+    Member<HTMLFormElement> m_form;
+#else
     WeakPtr<HTMLFormElement> m_form;
-    OwnPtr<ValidityState> m_validityState;
+#endif
+    OwnPtrWillBeMember<ValidityState> m_validityState;
     String m_customValidationMessage;
     bool m_formWasSetByParser;
 };
diff --git a/Source/core/html/FormData.idl b/Source/core/html/FormData.idl
index ddbd513..af47b46 100644
--- a/Source/core/html/FormData.idl
+++ b/Source/core/html/FormData.idl
@@ -30,7 +30,7 @@
 
 [
     Constructor(optional HTMLFormElement form),
-    GlobalContext=Window&WorkerGlobalScope,
+    Exposed=Window&Worker,
     ImplementedAs=DOMFormData,
     WillBeGarbageCollected,
 ] interface FormData {
diff --git a/Source/core/html/HTMLAnchorElement.cpp b/Source/core/html/HTMLAnchorElement.cpp
index 23399c3..633b316 100644
--- a/Source/core/html/HTMLAnchorElement.cpp
+++ b/Source/core/html/HTMLAnchorElement.cpp
@@ -115,14 +115,9 @@
     ScriptWrappable::init(this);
 }
 
-PassRefPtr<HTMLAnchorElement> HTMLAnchorElement::create(Document& document)
+PassRefPtrWillBeRawPtr<HTMLAnchorElement> HTMLAnchorElement::create(Document& document)
 {
-    return adoptRef(new HTMLAnchorElement(aTag, document));
-}
-
-PassRefPtr<HTMLAnchorElement> HTMLAnchorElement::create(const QualifiedName& tagName, Document& document)
-{
-    return adoptRef(new HTMLAnchorElement(tagName, document));
+    return adoptRefWillBeRefCountedGarbageCollected(new HTMLAnchorElement(aTag, document));
 }
 
 HTMLAnchorElement::~HTMLAnchorElement()
@@ -342,12 +337,6 @@
     return getAttribute(targetAttr);
 }
 
-
-String HTMLAnchorElement::text()
-{
-    return innerText();
-}
-
 bool HTMLAnchorElement::isLiveLink() const
 {
     return isLink() && !rendererIsEditable();
diff --git a/Source/core/html/HTMLAnchorElement.h b/Source/core/html/HTMLAnchorElement.h
index d1bbe83..d7215b9 100644
--- a/Source/core/html/HTMLAnchorElement.h
+++ b/Source/core/html/HTMLAnchorElement.h
@@ -56,8 +56,7 @@
 
 class HTMLAnchorElement : public HTMLElement, public DOMURLUtils {
 public:
-    static PassRefPtr<HTMLAnchorElement> create(Document&);
-    static PassRefPtr<HTMLAnchorElement> create(const QualifiedName&, Document&);
+    static PassRefPtrWillBeRawPtr<HTMLAnchorElement> create(Document&);
 
     virtual ~HTMLAnchorElement();
 
@@ -72,8 +71,6 @@
     virtual String input() const OVERRIDE FINAL;
     virtual void setInput(const String&) OVERRIDE FINAL;
 
-    String text();
-
     bool isLiveLink() const;
 
     virtual bool willRespondToMouseClickEvents() OVERRIDE FINAL;
diff --git a/Source/core/html/HTMLAnchorElement.idl b/Source/core/html/HTMLAnchorElement.idl
index 9b87fd6..63775c2 100644
--- a/Source/core/html/HTMLAnchorElement.idl
+++ b/Source/core/html/HTMLAnchorElement.idl
@@ -31,7 +31,7 @@
     [Reflect] attribute DOMString target;
     [Reflect] attribute DOMString type;
 
-    readonly attribute DOMString text;
+    [ImplementedAs=textContent] attribute DOMString text;
 
     [Reflect, RuntimeEnabled=SubresourceIntegrity] attribute DOMString integrity;
 };
diff --git a/Source/core/html/HTMLAppletElement.cpp b/Source/core/html/HTMLAppletElement.cpp
index a2cfd0d..a19da1b 100644
--- a/Source/core/html/HTMLAppletElement.cpp
+++ b/Source/core/html/HTMLAppletElement.cpp
@@ -49,9 +49,9 @@
     m_serviceType = "application/x-java-applet";
 }
 
-PassRefPtr<HTMLAppletElement> HTMLAppletElement::create(Document& document, bool createdByParser)
+PassRefPtrWillBeRawPtr<HTMLAppletElement> HTMLAppletElement::create(Document& document, bool createdByParser)
 {
-    RefPtr<HTMLAppletElement> element = adoptRef(new HTMLAppletElement(document, createdByParser));
+    RefPtrWillBeRawPtr<HTMLAppletElement> element = adoptRefWillBeRefCountedGarbageCollected(new HTMLAppletElement(document, createdByParser));
     element->ensureUserAgentShadowRoot();
     return element.release();
 }
diff --git a/Source/core/html/HTMLAppletElement.h b/Source/core/html/HTMLAppletElement.h
index 063b641..fbba123 100644
--- a/Source/core/html/HTMLAppletElement.h
+++ b/Source/core/html/HTMLAppletElement.h
@@ -31,7 +31,7 @@
 
 class HTMLAppletElement FINAL : public HTMLPlugInElement {
 public:
-    static PassRefPtr<HTMLAppletElement> create(Document&, bool createdByParser);
+    static PassRefPtrWillBeRawPtr<HTMLAppletElement> create(Document&, bool createdByParser);
 
 protected:
     virtual RenderWidget* renderWidgetForJSBindings() const OVERRIDE;
diff --git a/Source/core/html/HTMLAreaElement.cpp b/Source/core/html/HTMLAreaElement.cpp
index 8ee3c06..ac8d97c 100644
--- a/Source/core/html/HTMLAreaElement.cpp
+++ b/Source/core/html/HTMLAreaElement.cpp
@@ -46,9 +46,9 @@
     ScriptWrappable::init(this);
 }
 
-PassRefPtr<HTMLAreaElement> HTMLAreaElement::create(Document& document)
+PassRefPtrWillBeRawPtr<HTMLAreaElement> HTMLAreaElement::create(Document& document)
 {
-    return adoptRef(new HTMLAreaElement(document));
+    return adoptRefWillBeRefCountedGarbageCollected(new HTMLAreaElement(document));
 }
 
 void HTMLAreaElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
diff --git a/Source/core/html/HTMLAreaElement.h b/Source/core/html/HTMLAreaElement.h
index 6f11a73..d9ffef4 100644
--- a/Source/core/html/HTMLAreaElement.h
+++ b/Source/core/html/HTMLAreaElement.h
@@ -34,7 +34,7 @@
 
 class HTMLAreaElement FINAL : public HTMLAnchorElement {
 public:
-    static PassRefPtr<HTMLAreaElement> create(Document&);
+    static PassRefPtrWillBeRawPtr<HTMLAreaElement> create(Document&);
 
     bool isDefault() const { return m_shape == Default; }
 
diff --git a/Source/core/html/HTMLAudioElement.cpp b/Source/core/html/HTMLAudioElement.cpp
index 30764e5..ba03326 100644
--- a/Source/core/html/HTMLAudioElement.cpp
+++ b/Source/core/html/HTMLAudioElement.cpp
@@ -38,16 +38,16 @@
     ScriptWrappable::init(this);
 }
 
-PassRefPtr<HTMLAudioElement> HTMLAudioElement::create(Document& document)
+PassRefPtrWillBeRawPtr<HTMLAudioElement> HTMLAudioElement::create(Document& document)
 {
-    RefPtr<HTMLAudioElement> audioElement(adoptRef(new HTMLAudioElement(document)));
+    RefPtrWillBeRawPtr<HTMLAudioElement> audioElement(adoptRefWillBeRefCountedGarbageCollected(new HTMLAudioElement(document)));
     audioElement->suspendIfNeeded();
     return audioElement.release();
 }
 
-PassRefPtr<HTMLAudioElement> HTMLAudioElement::createForJSConstructor(Document& document, const AtomicString& src)
+PassRefPtrWillBeRawPtr<HTMLAudioElement> HTMLAudioElement::createForJSConstructor(Document& document, const AtomicString& src)
 {
-    RefPtr<HTMLAudioElement> audio = adoptRef(new HTMLAudioElement(document));
+    RefPtrWillBeRawPtr<HTMLAudioElement> audio = adoptRefWillBeRefCountedGarbageCollected(new HTMLAudioElement(document));
     audio->setPreload(AtomicString("auto", AtomicString::ConstructFromLiteral));
     if (!src.isNull())
         audio->setSrc(src);
diff --git a/Source/core/html/HTMLAudioElement.h b/Source/core/html/HTMLAudioElement.h
index be7c5fc..9969491 100644
--- a/Source/core/html/HTMLAudioElement.h
+++ b/Source/core/html/HTMLAudioElement.h
@@ -35,8 +35,8 @@
 
 class HTMLAudioElement FINAL : public HTMLMediaElement {
 public:
-    static PassRefPtr<HTMLAudioElement> create(Document&);
-    static PassRefPtr<HTMLAudioElement> createForJSConstructor(Document&, const AtomicString& src);
+    static PassRefPtrWillBeRawPtr<HTMLAudioElement> create(Document&);
+    static PassRefPtrWillBeRawPtr<HTMLAudioElement> createForJSConstructor(Document&, const AtomicString& src);
 
 private:
     HTMLAudioElement(Document&);
diff --git a/Source/core/html/HTMLBDIElement.h b/Source/core/html/HTMLBDIElement.h
index b5050a6..852a852 100644
--- a/Source/core/html/HTMLBDIElement.h
+++ b/Source/core/html/HTMLBDIElement.h
@@ -27,9 +27,9 @@
 
 class HTMLBDIElement FINAL : public HTMLElement {
 public:
-    static PassRefPtr<HTMLBDIElement> create(Document& document)
+    static PassRefPtrWillBeRawPtr<HTMLBDIElement> create(Document& document)
     {
-        return adoptRef(new HTMLBDIElement(document));
+        return adoptRefWillBeRefCountedGarbageCollected(new HTMLBDIElement(document));
     }
 
 private:
diff --git a/Source/core/html/HTMLBRElement.cpp b/Source/core/html/HTMLBRElement.cpp
index 19b3aa9..d80a76b 100644
--- a/Source/core/html/HTMLBRElement.cpp
+++ b/Source/core/html/HTMLBRElement.cpp
@@ -38,9 +38,9 @@
     ScriptWrappable::init(this);
 }
 
-PassRefPtr<HTMLBRElement> HTMLBRElement::create(Document& document)
+PassRefPtrWillBeRawPtr<HTMLBRElement> HTMLBRElement::create(Document& document)
 {
-    return adoptRef(new HTMLBRElement(document));
+    return adoptRefWillBeRefCountedGarbageCollected(new HTMLBRElement(document));
 }
 
 bool HTMLBRElement::isPresentationAttribute(const QualifiedName& name) const
diff --git a/Source/core/html/HTMLBRElement.h b/Source/core/html/HTMLBRElement.h
index 483e5cd..391a9c6 100644
--- a/Source/core/html/HTMLBRElement.h
+++ b/Source/core/html/HTMLBRElement.h
@@ -30,7 +30,7 @@
 
 class HTMLBRElement FINAL : public HTMLElement {
 public:
-    static PassRefPtr<HTMLBRElement> create(Document&);
+    static PassRefPtrWillBeRawPtr<HTMLBRElement> create(Document&);
 
     virtual bool canContainRangeEndPoint() const OVERRIDE { return false; }
 
diff --git a/Source/core/html/HTMLBaseElement.cpp b/Source/core/html/HTMLBaseElement.cpp
index 2e7d353..2de51fe 100644
--- a/Source/core/html/HTMLBaseElement.cpp
+++ b/Source/core/html/HTMLBaseElement.cpp
@@ -39,9 +39,9 @@
     ScriptWrappable::init(this);
 }
 
-PassRefPtr<HTMLBaseElement> HTMLBaseElement::create(Document& document)
+PassRefPtrWillBeRawPtr<HTMLBaseElement> HTMLBaseElement::create(Document& document)
 {
-    return adoptRef(new HTMLBaseElement(document));
+    return adoptRefWillBeRefCountedGarbageCollected(new HTMLBaseElement(document));
 }
 
 void HTMLBaseElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
diff --git a/Source/core/html/HTMLBaseElement.h b/Source/core/html/HTMLBaseElement.h
index 1c511de..9dee27b 100644
--- a/Source/core/html/HTMLBaseElement.h
+++ b/Source/core/html/HTMLBaseElement.h
@@ -29,7 +29,7 @@
 
 class HTMLBaseElement FINAL : public HTMLElement {
 public:
-    static PassRefPtr<HTMLBaseElement> create(Document&);
+    static PassRefPtrWillBeRawPtr<HTMLBaseElement> create(Document&);
 
     KURL href() const;
     void setHref(const AtomicString&);
diff --git a/Source/core/html/HTMLBodyElement.cpp b/Source/core/html/HTMLBodyElement.cpp
index 9c4e37d..6f8c4d2 100644
--- a/Source/core/html/HTMLBodyElement.cpp
+++ b/Source/core/html/HTMLBodyElement.cpp
@@ -47,9 +47,9 @@
     ScriptWrappable::init(this);
 }
 
-PassRefPtr<HTMLBodyElement> HTMLBodyElement::create(Document& document)
+PassRefPtrWillBeRawPtr<HTMLBodyElement> HTMLBodyElement::create(Document& document)
 {
-    return adoptRef(new HTMLBodyElement(document));
+    return adoptRefWillBeRefCountedGarbageCollected(new HTMLBodyElement(document));
 }
 
 HTMLBodyElement::~HTMLBodyElement()
@@ -198,16 +198,13 @@
     return rendererIsEditable() || HTMLElement::supportsFocus();
 }
 
-static int adjustForZoom(int value, Document* document)
+static double adjustForZoom(int value, Document* document)
 {
     LocalFrame* frame = document->frame();
     float zoomFactor = frame->pageZoomFactor();
     if (zoomFactor == 1)
-        return value;
-    // Needed because of truncation (rather than rounding) when scaling up.
-    if (zoomFactor > 1)
-        value++;
-    return static_cast<int>(value / zoomFactor);
+        return static_cast<double>(value);
+    return static_cast<double>(value) / zoomFactor;
 }
 
 // Blink, Gecko and Presto's quirks mode implementations of overflow set to the
@@ -221,7 +218,7 @@
 // That said, Blink's {set}scroll{Top,Left} behaviors match Gecko's: even if there is a non-overflown
 // scrollable area, scrolling should not get propagated to the viewport in neither strict
 // or quirks modes.
-int HTMLBodyElement::scrollLeft()
+double HTMLBodyElement::scrollLeft()
 {
     Document& document = this->document();
     document.updateLayoutIgnorePendingStylesheets();
@@ -240,7 +237,7 @@
     return view ? adjustForZoom(view->scrollX(), &document) : 0;
 }
 
-void HTMLBodyElement::setScrollLeft(int scrollLeft)
+void HTMLBodyElement::setScrollLeft(double scrollLeft)
 {
     Document& document = this->document();
     document.updateLayoutIgnorePendingStylesheets();
@@ -267,7 +264,7 @@
     view->setScrollPosition(IntPoint(static_cast<int>(scrollLeft * frame->pageZoomFactor()), view->scrollY()));
 }
 
-int HTMLBodyElement::scrollTop()
+double HTMLBodyElement::scrollTop()
 {
     Document& document = this->document();
     document.updateLayoutIgnorePendingStylesheets();
@@ -286,7 +283,7 @@
     return view ? adjustForZoom(view->scrollY(), &document) : 0;
 }
 
-void HTMLBodyElement::setScrollTop(int scrollTop)
+void HTMLBodyElement::setScrollTop(double scrollTop)
 {
     Document& document = this->document();
     document.updateLayoutIgnorePendingStylesheets();
@@ -313,7 +310,7 @@
     view->setScrollPosition(IntPoint(view->scrollX(), static_cast<int>(scrollTop * frame->pageZoomFactor())));
 }
 
-int HTMLBodyElement::scrollHeight()
+double HTMLBodyElement::scrollHeight()
 {
     // Update the document's layout.
     Document& document = this->document();
@@ -322,7 +319,7 @@
     return view ? adjustForZoom(view->contentsHeight(), &document) : 0;
 }
 
-int HTMLBodyElement::scrollWidth()
+double HTMLBodyElement::scrollWidth()
 {
     // Update the document's layout.
     Document& document = this->document();
diff --git a/Source/core/html/HTMLBodyElement.h b/Source/core/html/HTMLBodyElement.h
index fc7bb47..dc55a24 100644
--- a/Source/core/html/HTMLBodyElement.h
+++ b/Source/core/html/HTMLBodyElement.h
@@ -32,7 +32,7 @@
 
 class HTMLBodyElement FINAL : public HTMLElement {
 public:
-    static PassRefPtr<HTMLBodyElement> create(Document&);
+    static PassRefPtrWillBeRawPtr<HTMLBodyElement> create(Document&);
     virtual ~HTMLBodyElement();
 
     DEFINE_WINDOW_ATTRIBUTE_EVENT_LISTENER(blur);
@@ -59,14 +59,14 @@
 
     virtual bool supportsFocus() const OVERRIDE;
 
-    virtual int scrollLeft() OVERRIDE;
-    virtual void setScrollLeft(int) OVERRIDE;
+    virtual double scrollLeft() OVERRIDE;
+    virtual void setScrollLeft(double) OVERRIDE;
 
-    virtual int scrollTop() OVERRIDE;
-    virtual void setScrollTop(int) OVERRIDE;
+    virtual double scrollTop() OVERRIDE;
+    virtual void setScrollTop(double) OVERRIDE;
 
-    virtual int scrollHeight() OVERRIDE;
-    virtual int scrollWidth() OVERRIDE;
+    virtual double scrollHeight() OVERRIDE;
+    virtual double scrollWidth() OVERRIDE;
 };
 
 } //namespace
diff --git a/Source/core/html/HTMLButtonElement.cpp b/Source/core/html/HTMLButtonElement.cpp
index b50689a..1efd6bd 100644
--- a/Source/core/html/HTMLButtonElement.cpp
+++ b/Source/core/html/HTMLButtonElement.cpp
@@ -46,9 +46,9 @@
     ScriptWrappable::init(this);
 }
 
-PassRefPtr<HTMLButtonElement> HTMLButtonElement::create(Document& document, HTMLFormElement* form)
+PassRefPtrWillBeRawPtr<HTMLButtonElement> HTMLButtonElement::create(Document& document, HTMLFormElement* form)
 {
-    return adoptRef(new HTMLButtonElement(document, form));
+    return adoptRefWillBeRefCountedGarbageCollected(new HTMLButtonElement(document, form));
 }
 
 void HTMLButtonElement::setType(const AtomicString& type)
diff --git a/Source/core/html/HTMLButtonElement.h b/Source/core/html/HTMLButtonElement.h
index a2328e7..110e411 100644
--- a/Source/core/html/HTMLButtonElement.h
+++ b/Source/core/html/HTMLButtonElement.h
@@ -30,7 +30,7 @@
 
 class HTMLButtonElement FINAL : public HTMLFormControlElement {
 public:
-    static PassRefPtr<HTMLButtonElement> create(Document&, HTMLFormElement*);
+    static PassRefPtrWillBeRawPtr<HTMLButtonElement> create(Document&, HTMLFormElement*);
 
     void setType(const AtomicString&);
 
diff --git a/Source/core/html/HTMLCanvasElement.cpp b/Source/core/html/HTMLCanvasElement.cpp
index e84ea23..88f05be 100644
--- a/Source/core/html/HTMLCanvasElement.cpp
+++ b/Source/core/html/HTMLCanvasElement.cpp
@@ -28,7 +28,6 @@
 #include "config.h"
 #include "core/html/HTMLCanvasElement.h"
 
-#include <math.h>
 #include "HTMLNames.h"
 #include "RuntimeEnabledFeatures.h"
 #include "bindings/v8/ExceptionMessages.h"
@@ -53,6 +52,7 @@
 #include "platform/graphics/gpu/WebGLImageBufferSurface.h"
 #include "platform/transforms/AffineTransform.h"
 #include "public/platform/Platform.h"
+#include <math.h>
 
 namespace WebCore {
 
@@ -74,7 +74,6 @@
     : HTMLElement(canvasTag, document)
     , DocumentVisibilityObserver(document)
     , m_size(DefaultWidth, DefaultHeight)
-    , m_rendererIsCanvas(false)
     , m_ignoreReset(false)
     , m_accelerationDisabled(false)
     , m_externallyAllocatedMemory(0)
@@ -85,9 +84,9 @@
     ScriptWrappable::init(this);
 }
 
-PassRefPtr<HTMLCanvasElement> HTMLCanvasElement::create(Document& document)
+PassRefPtrWillBeRawPtr<HTMLCanvasElement> HTMLCanvasElement::create(Document& document)
 {
-    return adoptRef(new HTMLCanvasElement(document));
+    return adoptRefWillBeRefCountedGarbageCollected(new HTMLCanvasElement(document));
 }
 
 HTMLCanvasElement::~HTMLCanvasElement()
@@ -112,12 +111,8 @@
 RenderObject* HTMLCanvasElement::createRenderer(RenderStyle* style)
 {
     LocalFrame* frame = document().frame();
-    if (frame && frame->script().canExecuteScripts(NotAboutToExecuteScript)) {
-        m_rendererIsCanvas = true;
+    if (frame && frame->script().canExecuteScripts(NotAboutToExecuteScript))
         return new RenderHTMLCanvas(this);
-    }
-
-    m_rendererIsCanvas = false;
     return HTMLElement::createRenderer(style);
 }
 
@@ -171,19 +166,15 @@
         if (!m_context) {
             blink::Platform::current()->histogramEnumeration("Canvas.ContextType", Context2d, ContextTypeCount);
             m_context = CanvasRenderingContext2D::create(this, static_cast<Canvas2DContextAttributes*>(attrs), document().inQuirksMode());
-            if (m_context)
-                scheduleLayerUpdate();
+            setNeedsCompositingUpdate();
         }
         return m_context.get();
     }
 
-    // Accept the legacy "webkit-3d" name as well as the provisional "experimental-webgl" name.
-    // Now that WebGL is ratified, we will also accept "webgl" as the context name in Chrome.
+    // Accept the the provisional "experimental-webgl" or official "webgl" context ID.
     ContextType contextType;
     bool is3dContext = true;
-    if (type == "webkit-3d")
-        contextType = ContextWebkit3d;
-    else if (type == "experimental-webgl")
+    if (type == "experimental-webgl")
         contextType = ContextExperimentalWebgl;
     else if (type == "webgl")
         contextType = ContextWebgl;
@@ -198,10 +189,8 @@
         if (!m_context) {
             blink::Platform::current()->histogramEnumeration("Canvas.ContextType", contextType, ContextTypeCount);
             m_context = WebGLRenderingContext::create(this, static_cast<WebGLContextAttributes*>(attrs));
-            if (m_context) {
-                scheduleLayerUpdate();
-                updateExternallyAllocatedMemory();
-            }
+            setNeedsCompositingUpdate();
+            updateExternallyAllocatedMemory();
         }
         return m_context.get();
     }
@@ -275,7 +264,7 @@
         toWebGLRenderingContext(m_context.get())->reshape(width(), height());
 
     if (RenderObject* renderer = this->renderer()) {
-        if (m_rendererIsCanvas) {
+        if (renderer->isCanvas()) {
             if (oldSize != size()) {
                 toRenderHTMLCanvas(renderer)->canvasSizeChanged();
                 if (renderBox() && renderBox()->hasAcceleratedCompositing())
@@ -383,13 +372,13 @@
     return lowercaseMimeType;
 }
 
-String HTMLCanvasElement::toDataURL(const String& mimeType, const double* quality, ExceptionState& exceptionState)
+const AtomicString HTMLCanvasElement::imageSourceURL() const
 {
-    if (!m_originClean) {
-        exceptionState.throwSecurityError("Tainted canvases may not be exported.");
-        return String();
-    }
+    return AtomicString(toDataURLInternal("image/png", 0));
+}
 
+String HTMLCanvasElement::toDataURLInternal(const String& mimeType, const double* quality) const
+{
     if (m_size.isEmpty() || !buffer())
         return String("data:,");
 
@@ -407,7 +396,17 @@
     return buffer()->toDataURL(encodingMimeType, quality);
 }
 
-PassRefPtrWillBeRawPtr<ImageData> HTMLCanvasElement::getImageData()
+String HTMLCanvasElement::toDataURL(const String& mimeType, const double* quality, ExceptionState& exceptionState) const
+{
+    if (!m_originClean) {
+        exceptionState.throwSecurityError("Tainted canvases may not be exported.");
+        return String();
+    }
+
+    return toDataURLInternal(mimeType, quality);
+}
+
+PassRefPtrWillBeRawPtr<ImageData> HTMLCanvasElement::getImageData() const
 {
     if (!m_context || !m_context->is3d())
         return nullptr;
@@ -517,10 +516,8 @@
     m_imageBuffer->context()->setStrokeThickness(1);
     m_contextStateSaver = adoptPtr(new GraphicsContextStateSaver(*m_imageBuffer->context()));
 
-    // Recalculate compositing requirements if acceleration state changed.
     if (m_context)
-        scheduleLayerUpdate();
-    return;
+        setNeedsCompositingUpdate();
 }
 
 void HTMLCanvasElement::notifySurfaceInvalid()
diff --git a/Source/core/html/HTMLCanvasElement.h b/Source/core/html/HTMLCanvasElement.h
index 634a27e..17a617d 100644
--- a/Source/core/html/HTMLCanvasElement.h
+++ b/Source/core/html/HTMLCanvasElement.h
@@ -66,7 +66,7 @@
 class HTMLCanvasElement FINAL : public HTMLElement, public DocumentVisibilityObserver, public CanvasImageSource, public ImageBufferClient {
     WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(HTMLCanvasElement);
 public:
-    static PassRefPtr<HTMLCanvasElement> create(Document&);
+    static PassRefPtrWillBeRawPtr<HTMLCanvasElement> create(Document&);
     virtual ~HTMLCanvasElement();
 
     void addObserver(CanvasObserver*);
@@ -97,8 +97,8 @@
     CanvasRenderingContext* getContext(const String&, CanvasContextAttributes* attributes = 0);
 
     static String toEncodingMimeType(const String& mimeType);
-    String toDataURL(const String& mimeType, const double* quality, ExceptionState&);
-    String toDataURL(const String& mimeType, ExceptionState& exceptionState) { return toDataURL(mimeType, 0, exceptionState); }
+    String toDataURL(const String& mimeType, const double* quality, ExceptionState&) const;
+    String toDataURL(const String& mimeType, ExceptionState& exceptionState) const { return toDataURL(mimeType, 0, exceptionState); }
 
     // Used for rendering
     void didDraw(const FloatRect&);
@@ -115,7 +115,7 @@
     ImageBuffer* buffer() const;
     Image* copiedImage() const;
     void clearCopiedImage();
-    PassRefPtrWillBeRawPtr<ImageData> getImageData();
+    PassRefPtrWillBeRawPtr<ImageData> getImageData() const;
     void makePresentationCopy();
     void clearPresentationCopy();
 
@@ -133,6 +133,8 @@
 
     bool shouldAccelerate(const IntSize&) const;
 
+    virtual const AtomicString imageSourceURL() const OVERRIDE;
+
     virtual InsertionNotificationRequest insertedInto(ContainerNode*) OVERRIDE;
 
     // DocumentVisibilityObserver implementation
@@ -171,14 +173,14 @@
 
     void updateExternallyAllocatedMemory() const;
 
+    String toDataURLInternal(const String& mimeType, const double* quality) const;
+
     HashSet<CanvasObserver*> m_observers;
 
     IntSize m_size;
 
     OwnPtrWillBeMember<CanvasRenderingContext> m_context;
 
-    bool m_rendererIsCanvas;
-
     bool m_ignoreReset;
     bool m_accelerationDisabled;
     FloatRect m_dirtyRect;
diff --git a/Source/core/html/HTMLContentElement.cpp b/Source/core/html/HTMLContentElement.cpp
index 62eaf75..696a257 100644
--- a/Source/core/html/HTMLContentElement.cpp
+++ b/Source/core/html/HTMLContentElement.cpp
@@ -40,9 +40,9 @@
 
 using namespace HTMLNames;
 
-PassRefPtr<HTMLContentElement> HTMLContentElement::create(Document& document)
+PassRefPtrWillBeRawPtr<HTMLContentElement> HTMLContentElement::create(Document& document)
 {
-    return adoptRef(new HTMLContentElement(document));
+    return adoptRefWillBeRefCountedGarbageCollected(new HTMLContentElement(document));
 }
 
 HTMLContentElement::HTMLContentElement(Document& document)
diff --git a/Source/core/html/HTMLContentElement.h b/Source/core/html/HTMLContentElement.h
index 5518122..f1c0fe4 100644
--- a/Source/core/html/HTMLContentElement.h
+++ b/Source/core/html/HTMLContentElement.h
@@ -38,7 +38,7 @@
 
 class HTMLContentElement FINAL : public InsertionPoint {
 public:
-    static PassRefPtr<HTMLContentElement> create(Document&);
+    static PassRefPtrWillBeRawPtr<HTMLContentElement> create(Document&);
 
     virtual ~HTMLContentElement();
 
diff --git a/Source/core/html/HTMLDListElement.cpp b/Source/core/html/HTMLDListElement.cpp
index 7196698..e181f4a 100644
--- a/Source/core/html/HTMLDListElement.cpp
+++ b/Source/core/html/HTMLDListElement.cpp
@@ -35,9 +35,9 @@
     ScriptWrappable::init(this);
 }
 
-PassRefPtr<HTMLDListElement> HTMLDListElement::create(Document& document)
+PassRefPtrWillBeRawPtr<HTMLDListElement> HTMLDListElement::create(Document& document)
 {
-    return adoptRef(new HTMLDListElement(document));
+    return adoptRefWillBeRefCountedGarbageCollected(new HTMLDListElement(document));
 }
 
 }
diff --git a/Source/core/html/HTMLDListElement.h b/Source/core/html/HTMLDListElement.h
index 24aeb81..8b691a3 100644
--- a/Source/core/html/HTMLDListElement.h
+++ b/Source/core/html/HTMLDListElement.h
@@ -29,7 +29,7 @@
 
 class HTMLDListElement FINAL : public HTMLElement {
 public:
-    static PassRefPtr<HTMLDListElement> create(Document&);
+    static PassRefPtrWillBeRawPtr<HTMLDListElement> create(Document&);
 
 private:
     explicit HTMLDListElement(Document&);
diff --git a/Source/core/html/HTMLDataListElement.cpp b/Source/core/html/HTMLDataListElement.cpp
index d8666e8..adf5bc3 100644
--- a/Source/core/html/HTMLDataListElement.cpp
+++ b/Source/core/html/HTMLDataListElement.cpp
@@ -44,10 +44,10 @@
     ScriptWrappable::init(this);
 }
 
-PassRefPtr<HTMLDataListElement> HTMLDataListElement::create(Document& document)
+PassRefPtrWillBeRawPtr<HTMLDataListElement> HTMLDataListElement::create(Document& document)
 {
     UseCounter::count(document, UseCounter::DataListElement);
-    return adoptRef(new HTMLDataListElement(document));
+    return adoptRefWillBeRefCountedGarbageCollected(new HTMLDataListElement(document));
 }
 
 PassRefPtr<HTMLCollection> HTMLDataListElement::options()
diff --git a/Source/core/html/HTMLDataListElement.h b/Source/core/html/HTMLDataListElement.h
index f46756a..479c899 100644
--- a/Source/core/html/HTMLDataListElement.h
+++ b/Source/core/html/HTMLDataListElement.h
@@ -39,7 +39,7 @@
 
 class HTMLDataListElement FINAL : public HTMLElement {
 public:
-    static PassRefPtr<HTMLDataListElement> create(Document&);
+    static PassRefPtrWillBeRawPtr<HTMLDataListElement> create(Document&);
 
     PassRefPtr<HTMLCollection> options();
 
diff --git a/Source/core/html/HTMLDetailsElement.cpp b/Source/core/html/HTMLDetailsElement.cpp
index fed6fac..729b08c 100644
--- a/Source/core/html/HTMLDetailsElement.cpp
+++ b/Source/core/html/HTMLDetailsElement.cpp
@@ -45,9 +45,9 @@
     return sharedToggleEventSender;
 }
 
-PassRefPtr<HTMLDetailsElement> HTMLDetailsElement::create(Document& document)
+PassRefPtrWillBeRawPtr<HTMLDetailsElement> HTMLDetailsElement::create(Document& document)
 {
-    RefPtr<HTMLDetailsElement> details = adoptRef(new HTMLDetailsElement(document));
+    RefPtrWillBeRawPtr<HTMLDetailsElement> details = adoptRefWillBeRefCountedGarbageCollected(new HTMLDetailsElement(document));
     details->ensureUserAgentShadowRoot();
     return details.release();
 }
diff --git a/Source/core/html/HTMLDetailsElement.h b/Source/core/html/HTMLDetailsElement.h
index d9f0035..2e9d762 100644
--- a/Source/core/html/HTMLDetailsElement.h
+++ b/Source/core/html/HTMLDetailsElement.h
@@ -30,7 +30,7 @@
 
 class HTMLDetailsElement FINAL : public HTMLElement {
 public:
-    static PassRefPtr<HTMLDetailsElement> create(Document&);
+    static PassRefPtrWillBeRawPtr<HTMLDetailsElement> create(Document&);
     void toggleOpen();
     virtual ~HTMLDetailsElement();
 
diff --git a/Source/core/html/HTMLDialogElement.cpp b/Source/core/html/HTMLDialogElement.cpp
index b868465..feda559 100644
--- a/Source/core/html/HTMLDialogElement.cpp
+++ b/Source/core/html/HTMLDialogElement.cpp
@@ -98,9 +98,9 @@
     ScriptWrappable::init(this);
 }
 
-PassRefPtr<HTMLDialogElement> HTMLDialogElement::create(Document& document)
+PassRefPtrWillBeRawPtr<HTMLDialogElement> HTMLDialogElement::create(Document& document)
 {
-    return adoptRef(new HTMLDialogElement(document));
+    return adoptRefWillBeRefCountedGarbageCollected(new HTMLDialogElement(document));
 }
 
 void HTMLDialogElement::close(const String& returnValue, ExceptionState& exceptionState)
diff --git a/Source/core/html/HTMLDialogElement.h b/Source/core/html/HTMLDialogElement.h
index db930c1..80ee642 100644
--- a/Source/core/html/HTMLDialogElement.h
+++ b/Source/core/html/HTMLDialogElement.h
@@ -36,7 +36,7 @@
 
 class HTMLDialogElement FINAL : public HTMLElement {
 public:
-    static PassRefPtr<HTMLDialogElement> create(Document&);
+    static PassRefPtrWillBeRawPtr<HTMLDialogElement> create(Document&);
 
     void close(const String& returnValue, ExceptionState&);
     void closeDialog(const String& returnValue = String());
diff --git a/Source/core/html/HTMLDirectoryElement.cpp b/Source/core/html/HTMLDirectoryElement.cpp
index 2010c5a..5c6eea3 100644
--- a/Source/core/html/HTMLDirectoryElement.cpp
+++ b/Source/core/html/HTMLDirectoryElement.cpp
@@ -35,9 +35,9 @@
     ScriptWrappable::init(this);
 }
 
-PassRefPtr<HTMLDirectoryElement> HTMLDirectoryElement::create(Document& document)
+PassRefPtrWillBeRawPtr<HTMLDirectoryElement> HTMLDirectoryElement::create(Document& document)
 {
-    return adoptRef(new HTMLDirectoryElement(document));
+    return adoptRefWillBeRefCountedGarbageCollected(new HTMLDirectoryElement(document));
 }
 
 }
diff --git a/Source/core/html/HTMLDirectoryElement.h b/Source/core/html/HTMLDirectoryElement.h
index 7c0dcaa..dcd2236 100644
--- a/Source/core/html/HTMLDirectoryElement.h
+++ b/Source/core/html/HTMLDirectoryElement.h
@@ -29,7 +29,7 @@
 
 class HTMLDirectoryElement FINAL : public HTMLElement {
 public:
-    static PassRefPtr<HTMLDirectoryElement> create(Document&);
+    static PassRefPtrWillBeRawPtr<HTMLDirectoryElement> create(Document&);
 
 private:
     explicit HTMLDirectoryElement(Document&);
diff --git a/Source/core/html/HTMLDivElement.cpp b/Source/core/html/HTMLDivElement.cpp
index 9882a75..7be56ea 100644
--- a/Source/core/html/HTMLDivElement.cpp
+++ b/Source/core/html/HTMLDivElement.cpp
@@ -37,9 +37,9 @@
     ScriptWrappable::init(this);
 }
 
-PassRefPtr<HTMLDivElement> HTMLDivElement::create(Document& document)
+PassRefPtrWillBeRawPtr<HTMLDivElement> HTMLDivElement::create(Document& document)
 {
-    return adoptRef(new HTMLDivElement(document));
+    return adoptRefWillBeRefCountedGarbageCollected(new HTMLDivElement(document));
 }
 
 void HTMLDivElement::collectStyleForPresentationAttribute(const QualifiedName& name, const AtomicString& value, MutableStylePropertySet* style)
diff --git a/Source/core/html/HTMLDivElement.h b/Source/core/html/HTMLDivElement.h
index 69338d2..d804590 100644
--- a/Source/core/html/HTMLDivElement.h
+++ b/Source/core/html/HTMLDivElement.h
@@ -29,7 +29,7 @@
 
 class HTMLDivElement : public HTMLElement {
 public:
-    static PassRefPtr<HTMLDivElement> create(Document&);
+    static PassRefPtrWillBeRawPtr<HTMLDivElement> create(Document&);
 
 protected:
     explicit HTMLDivElement(Document&);
diff --git a/Source/core/html/HTMLDocument.h b/Source/core/html/HTMLDocument.h
index 741b09f..c33a4c5 100644
--- a/Source/core/html/HTMLDocument.h
+++ b/Source/core/html/HTMLDocument.h
@@ -35,9 +35,9 @@
 
 class HTMLDocument : public Document, public ResourceClient {
 public:
-    static PassRefPtr<HTMLDocument> create(const DocumentInit& initializer = DocumentInit())
+    static PassRefPtrWillBeRawPtr<HTMLDocument> create(const DocumentInit& initializer = DocumentInit())
     {
-        return adoptRef(new HTMLDocument(initializer));
+        return adoptRefWillBeRefCountedGarbageCollected(new HTMLDocument(initializer));
     }
     virtual ~HTMLDocument();
 
diff --git a/Source/core/html/HTMLElement.cpp b/Source/core/html/HTMLElement.cpp
index 0b12ef0..c7e6eec 100644
--- a/Source/core/html/HTMLElement.cpp
+++ b/Source/core/html/HTMLElement.cpp
@@ -63,9 +63,9 @@
 using std::min;
 using std::max;
 
-PassRefPtr<HTMLElement> HTMLElement::create(const QualifiedName& tagName, Document& document)
+PassRefPtrWillBeRawPtr<HTMLElement> HTMLElement::create(const QualifiedName& tagName, Document& document)
 {
-    return adoptRef(new HTMLElement(tagName, document));
+    return adoptRefWillBeRefCountedGarbageCollected(new HTMLElement(tagName, document));
 }
 
 String HTMLElement::nodeName() const
diff --git a/Source/core/html/HTMLElement.h b/Source/core/html/HTMLElement.h
index 90e1ecd..9b3f37a 100644
--- a/Source/core/html/HTMLElement.h
+++ b/Source/core/html/HTMLElement.h
@@ -40,7 +40,7 @@
 
 class HTMLElement : public Element {
 public:
-    static PassRefPtr<HTMLElement> create(const QualifiedName& tagName, Document&);
+    static PassRefPtrWillBeRawPtr<HTMLElement> create(const QualifiedName& tagName, Document&);
 
     virtual String title() const OVERRIDE FINAL;
     virtual short tabIndex() const OVERRIDE;
diff --git a/Source/core/html/HTMLEmbedElement.cpp b/Source/core/html/HTMLEmbedElement.cpp
index 7514159..10662d9 100644
--- a/Source/core/html/HTMLEmbedElement.cpp
+++ b/Source/core/html/HTMLEmbedElement.cpp
@@ -45,9 +45,9 @@
     ScriptWrappable::init(this);
 }
 
-PassRefPtr<HTMLEmbedElement> HTMLEmbedElement::create(Document& document, bool createdByParser)
+PassRefPtrWillBeRawPtr<HTMLEmbedElement> HTMLEmbedElement::create(Document& document, bool createdByParser)
 {
-    RefPtr<HTMLEmbedElement> element = adoptRef(new HTMLEmbedElement(document, createdByParser));
+    RefPtrWillBeRawPtr<HTMLEmbedElement> element = adoptRefWillBeRefCountedGarbageCollected(new HTMLEmbedElement(document, createdByParser));
     element->ensureUserAgentShadowRoot();
     return element.release();
 }
diff --git a/Source/core/html/HTMLEmbedElement.h b/Source/core/html/HTMLEmbedElement.h
index 42b21ef..becba85 100644
--- a/Source/core/html/HTMLEmbedElement.h
+++ b/Source/core/html/HTMLEmbedElement.h
@@ -29,7 +29,7 @@
 
 class HTMLEmbedElement FINAL : public HTMLPlugInElement {
 public:
-    static PassRefPtr<HTMLEmbedElement> create(Document&, bool createdByParser = false);
+    static PassRefPtrWillBeRawPtr<HTMLEmbedElement> create(Document&, bool createdByParser = false);
 
     bool isExposed() const;
 
diff --git a/Source/core/html/HTMLEmbedElement.idl b/Source/core/html/HTMLEmbedElement.idl
index 20dc995..1273b40 100644
--- a/Source/core/html/HTMLEmbedElement.idl
+++ b/Source/core/html/HTMLEmbedElement.idl
@@ -24,7 +24,7 @@
     [Reflect] attribute DOMString align;
     [Reflect] attribute DOMString height;
     [Reflect] attribute DOMString name;
-    [Reflect, URL, PerWorldBindings, LogActivity=SetterOnly] attribute DOMString src;
+    [Reflect, URL, PerWorldBindings, LogActivity=SetterOnly, LogPreviousValue] attribute DOMString src;
     [Reflect] attribute DOMString type;
     [Reflect] attribute DOMString width;
     [Custom, NotEnumerable] getter boolean (unsigned long index);
diff --git a/Source/core/html/HTMLFieldSetElement.cpp b/Source/core/html/HTMLFieldSetElement.cpp
index 578fc59..f8dae3b 100644
--- a/Source/core/html/HTMLFieldSetElement.cpp
+++ b/Source/core/html/HTMLFieldSetElement.cpp
@@ -44,9 +44,17 @@
     ScriptWrappable::init(this);
 }
 
-PassRefPtr<HTMLFieldSetElement> HTMLFieldSetElement::create(Document& document, HTMLFormElement* form)
+PassRefPtrWillBeRawPtr<HTMLFieldSetElement> HTMLFieldSetElement::create(Document& document, HTMLFormElement* form)
 {
-    return adoptRef(new HTMLFieldSetElement(document, form));
+    return adoptRefWillBeRefCountedGarbageCollected(new HTMLFieldSetElement(document, form));
+}
+
+void HTMLFieldSetElement::trace(Visitor* visitor)
+{
+#if ENABLE(OILPAN)
+    visitor->trace(m_associatedElements);
+#endif
+    HTMLFormControlElement::trace(visitor);
 }
 
 void HTMLFieldSetElement::invalidateDisabledStateUnder(Element& base)
@@ -120,7 +128,7 @@
     }
 }
 
-const Vector<FormAssociatedElement*>& HTMLFieldSetElement::associatedElements() const
+const FormAssociatedElement::List& HTMLFieldSetElement::associatedElements() const
 {
     refreshElementsIfNeeded();
     return m_associatedElements;
diff --git a/Source/core/html/HTMLFieldSetElement.h b/Source/core/html/HTMLFieldSetElement.h
index 3a7afb7..f7a75eb 100644
--- a/Source/core/html/HTMLFieldSetElement.h
+++ b/Source/core/html/HTMLFieldSetElement.h
@@ -33,12 +33,13 @@
 
 class HTMLFieldSetElement FINAL : public HTMLFormControlElement {
 public:
-    static PassRefPtr<HTMLFieldSetElement> create(Document&, HTMLFormElement*);
+    static PassRefPtrWillBeRawPtr<HTMLFieldSetElement> create(Document&, HTMLFormElement*);
+    virtual void trace(Visitor*) OVERRIDE;
     HTMLLegendElement* legend() const;
 
     PassRefPtr<HTMLCollection> elements();
 
-    const Vector<FormAssociatedElement*>& associatedElements() const;
+    const FormAssociatedElement::List& associatedElements() const;
 
 protected:
     virtual void disabledAttributeChanged() OVERRIDE;
@@ -57,7 +58,7 @@
     static void invalidateDisabledStateUnder(Element&);
     void refreshElementsIfNeeded() const;
 
-    mutable Vector<FormAssociatedElement*> m_associatedElements;
+    mutable FormAssociatedElement::List m_associatedElements;
     // When dom tree is modified, we have to refresh the m_associatedElements array.
     mutable uint64_t m_documentVersion;
 };
diff --git a/Source/core/html/HTMLFontElement.cpp b/Source/core/html/HTMLFontElement.cpp
index 5972e6f..9932dc2 100644
--- a/Source/core/html/HTMLFontElement.cpp
+++ b/Source/core/html/HTMLFontElement.cpp
@@ -44,9 +44,9 @@
     ScriptWrappable::init(this);
 }
 
-PassRefPtr<HTMLFontElement> HTMLFontElement::create(Document& document)
+PassRefPtrWillBeRawPtr<HTMLFontElement> HTMLFontElement::create(Document& document)
 {
-    return adoptRef(new HTMLFontElement(document));
+    return adoptRefWillBeRefCountedGarbageCollected(new HTMLFontElement(document));
 }
 
 // http://www.whatwg.org/specs/web-apps/current-work/multipage/rendering.html#fonts-and-colors
diff --git a/Source/core/html/HTMLFontElement.h b/Source/core/html/HTMLFontElement.h
index 229c5c9..0f99880 100644
--- a/Source/core/html/HTMLFontElement.h
+++ b/Source/core/html/HTMLFontElement.h
@@ -30,7 +30,7 @@
 
 class HTMLFontElement FINAL : public HTMLElement {
 public:
-    static PassRefPtr<HTMLFontElement> create(Document&);
+    static PassRefPtrWillBeRawPtr<HTMLFontElement> create(Document&);
 
     static bool cssValueFromFontSizeNumber(const String&, CSSValueID&);
 
diff --git a/Source/core/html/HTMLFormControlElement.cpp b/Source/core/html/HTMLFormControlElement.cpp
index cdb8c28..5bfb04b 100644
--- a/Source/core/html/HTMLFormControlElement.cpp
+++ b/Source/core/html/HTMLFormControlElement.cpp
@@ -68,6 +68,12 @@
 #endif
 }
 
+void HTMLFormControlElement::trace(Visitor* visitor)
+{
+    FormAssociatedElement::trace(visitor);
+    LabelableElement::trace(visitor);
+}
+
 String HTMLFormControlElement::formEnctype() const
 {
     const AtomicString& formEnctypeAttr = fastGetAttribute(formenctypeAttr);
@@ -247,6 +253,7 @@
 
 void HTMLFormControlElement::removedFrom(ContainerNode* insertionPoint)
 {
+    hideVisibleValidationMessage();
     m_validationMessage = nullptr;
     m_ancestorDisabledState = AncestorDisabledStateUnknown;
     m_dataListAncestorState = Unknown;
@@ -416,13 +423,13 @@
         m_validationMessage->requestToHideMessage();
 }
 
-bool HTMLFormControlElement::checkValidity(Vector<RefPtr<FormAssociatedElement> >* unhandledInvalidControls)
+bool HTMLFormControlElement::checkValidity(WillBeHeapVector<RefPtrWillBeMember<FormAssociatedElement> >* unhandledInvalidControls)
 {
     if (!willValidate() || isValidFormControlElement())
         return true;
     // An event handler can deref this object.
-    RefPtr<HTMLFormControlElement> protector(this);
-    RefPtr<Document> originalDocument(document());
+    RefPtrWillBeRawPtr<HTMLFormControlElement> protector(this);
+    RefPtrWillBeRawPtr<Document> originalDocument(document());
     bool needsDefaultAction = dispatchEvent(Event::createCancelable(EventTypeNames::invalid));
     if (needsDefaultAction && unhandledInvalidControls && inDocument() && originalDocument == document())
         unhandledInvalidControls->append(this);
diff --git a/Source/core/html/HTMLFormControlElement.h b/Source/core/html/HTMLFormControlElement.h
index 0c50a8c..dd8cb43 100644
--- a/Source/core/html/HTMLFormControlElement.h
+++ b/Source/core/html/HTMLFormControlElement.h
@@ -40,8 +40,11 @@
 // and form-associated element implementations should use HTMLFormControlElement
 // unless there is a special reason.
 class HTMLFormControlElement : public LabelableElement, public FormAssociatedElement {
+    WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(HTMLFormControlElement);
+
 public:
     virtual ~HTMLFormControlElement();
+    virtual void trace(Visitor*) OVERRIDE;
 
     String formEnctype() const;
     void setFormEnctype(const AtomicString&);
@@ -87,7 +90,7 @@
     virtual bool willValidate() const OVERRIDE;
     void updateVisibleValidationMessage();
     void hideVisibleValidationMessage();
-    bool checkValidity(Vector<RefPtr<FormAssociatedElement> >* unhandledInvalidControls = 0);
+    bool checkValidity(WillBeHeapVector<RefPtrWillBeMember<FormAssociatedElement> >* unhandledInvalidControls = 0);
     // This must be called when a validation constraint or control value is changed.
     void setNeedsValidityCheck();
     virtual void setCustomValidity(const String&) OVERRIDE FINAL;
@@ -138,8 +141,10 @@
     virtual bool supportsAutofocus() const;
 
 private:
+#if !ENABLE(OILPAN)
     virtual void refFormAssociatedElement() OVERRIDE FINAL { ref(); }
     virtual void derefFormAssociatedElement() OVERRIDE FINAL { deref(); }
+#endif
 
     virtual bool isFormControlElement() const OVERRIDE FINAL { return true; }
     virtual bool alwaysCreateUserAgentShadowRoot() const OVERRIDE { return true; }
diff --git a/Source/core/html/HTMLFormControlsCollection.cpp b/Source/core/html/HTMLFormControlsCollection.cpp
index 6d431e4..19c5961 100644
--- a/Source/core/html/HTMLFormControlsCollection.cpp
+++ b/Source/core/html/HTMLFormControlsCollection.cpp
@@ -56,7 +56,7 @@
 {
 }
 
-const Vector<FormAssociatedElement*>& HTMLFormControlsCollection::formControlElements() const
+const FormAssociatedElement::List& HTMLFormControlsCollection::formControlElements() const
 {
     ASSERT(isHTMLFormElement(ownerNode()) || isHTMLFieldSetElement(ownerNode()));
     if (isHTMLFormElement(ownerNode()))
@@ -69,7 +69,7 @@
     return toHTMLFormElement(ownerNode()).imageElements();
 }
 
-static unsigned findFormAssociatedElement(const Vector<FormAssociatedElement*>& associatedElements, Element* element)
+static unsigned findFormAssociatedElement(const FormAssociatedElement::List& associatedElements, Element* element)
 {
     unsigned i = 0;
     for (; i < associatedElements.size(); ++i) {
@@ -82,7 +82,7 @@
 
 Element* HTMLFormControlsCollection::virtualItemAfter(Element* previous) const
 {
-    const Vector<FormAssociatedElement*>& associatedElements = formControlElements();
+    const FormAssociatedElement::List& associatedElements = formControlElements();
     unsigned offset;
     if (!previous)
         offset = 0;
@@ -109,7 +109,7 @@
     m_cachedElementOffsetInArray = 0;
 }
 
-static HTMLElement* firstNamedItem(const Vector<FormAssociatedElement*>& elementsArray,
+static HTMLElement* firstNamedItem(const FormAssociatedElement::List& elementsArray,
     const Vector<HTMLImageElement*>* imageElementsArray, const QualifiedName& attrName, const String& name)
 {
     ASSERT(attrName == idAttr || attrName == nameAttr);
@@ -156,7 +156,7 @@
     OwnPtr<NamedItemCache> cache = NamedItemCache::create();
     HashSet<StringImpl*> foundInputElements;
 
-    const Vector<FormAssociatedElement*>& elementsArray = formControlElements();
+    const FormAssociatedElement::List& elementsArray = formControlElements();
 
     for (unsigned i = 0; i < elementsArray.size(); ++i) {
         FormAssociatedElement* associatedElement = elementsArray[i];
diff --git a/Source/core/html/HTMLFormControlsCollection.h b/Source/core/html/HTMLFormControlsCollection.h
index fcec719..6fbd47b 100644
--- a/Source/core/html/HTMLFormControlsCollection.h
+++ b/Source/core/html/HTMLFormControlsCollection.h
@@ -24,12 +24,12 @@
 #ifndef HTMLFormControlsCollection_h
 #define HTMLFormControlsCollection_h
 
+#include "core/html/FormAssociatedElement.h"
 #include "core/html/HTMLCollection.h"
 #include "core/html/RadioNodeList.h"
 
 namespace WebCore {
 
-class FormAssociatedElement;
 class HTMLElement;
 class HTMLImageElement;
 class QualifiedName;
@@ -52,7 +52,7 @@
     virtual void updateIdNameCache() const OVERRIDE;
     virtual void supportedPropertyNames(Vector<String>& names) OVERRIDE;
 
-    const Vector<FormAssociatedElement*>& formControlElements() const;
+    const FormAssociatedElement::List& formControlElements() const;
     const Vector<HTMLImageElement*>& formImageElements() const;
     virtual Element* virtualItemAfter(Element*) const OVERRIDE;
     virtual void invalidateCache(Document* oldDocument = 0) const OVERRIDE;
diff --git a/Source/core/html/HTMLFormElement.cpp b/Source/core/html/HTMLFormElement.cpp
index e2190df..69b2e00 100644
--- a/Source/core/html/HTMLFormElement.cpp
+++ b/Source/core/html/HTMLFormElement.cpp
@@ -75,10 +75,10 @@
     ScriptWrappable::init(this);
 }
 
-PassRefPtr<HTMLFormElement> HTMLFormElement::create(Document& document)
+PassRefPtrWillBeRawPtr<HTMLFormElement> HTMLFormElement::create(Document& document)
 {
     UseCounter::count(document, UseCounter::FormElement);
-    return adoptRef(new HTMLFormElement(document));
+    return adoptRefWillBeRefCountedGarbageCollected(new HTMLFormElement(document));
 }
 
 HTMLFormElement::~HTMLFormElement()
@@ -91,6 +91,14 @@
 #endif
 }
 
+void HTMLFormElement::trace(Visitor* visitor)
+{
+#if ENABLE(OILPAN)
+    visitor->trace(m_associatedElements);
+#endif
+    HTMLElement::trace(visitor);
+}
+
 bool HTMLFormElement::rendererIsNeeded(const RenderStyle& style)
 {
     if (!m_wasDemoted)
@@ -129,7 +137,7 @@
 }
 
 template<class T>
-void notifyFormRemovedFromTree(const Vector<T*>& elements, Node& root)
+void notifyFormRemovedFromTree(const T& elements, Node& root)
 {
     size_t size = elements.size();
     for (size_t i = 0; i < size; ++i)
@@ -144,10 +152,10 @@
     if (m_hasElementsAssociatedByParser) {
         Node& root = highestAncestorOrSelf();
         if (!m_associatedElementsAreDirty) {
-            Vector<FormAssociatedElement*> elements(associatedElements());
+            FormAssociatedElement::List elements(associatedElements());
             notifyFormRemovedFromTree(elements, root);
         } else {
-            Vector<FormAssociatedElement*> elements;
+            FormAssociatedElement::List elements;
             collectAssociatedElements(insertionPoint->highestAncestorOrSelf(), elements);
             notifyFormRemovedFromTree(elements, root);
             collectAssociatedElements(root, elements);
@@ -183,7 +191,7 @@
 
 unsigned HTMLFormElement::length() const
 {
-    const Vector<FormAssociatedElement*>& elements = associatedElements();
+    const FormAssociatedElement::List& elements = associatedElements();
     unsigned len = 0;
     for (unsigned i = 0; i < elements.size(); ++i) {
         if (elements[i]->isEnumeratable())
@@ -201,7 +209,7 @@
 {
     int submissionTriggerCount = 0;
     bool seenDefaultButton = false;
-    const Vector<FormAssociatedElement*>& elements = associatedElements();
+    const FormAssociatedElement::List& elements = associatedElements();
     for (unsigned i = 0; i < elements.size(); ++i) {
         FormAssociatedElement* formAssociatedElement = elements[i];
         if (!formAssociatedElement->isFormControlElement())
@@ -245,13 +253,13 @@
     if (submitElement && submitElement->formNoValidate())
         return true;
 
-    const Vector<FormAssociatedElement*>& elements = associatedElements();
+    const FormAssociatedElement::List& elements = associatedElements();
     for (unsigned i = 0; i < elements.size(); ++i) {
         if (elements[i]->isFormControlElement())
             toHTMLFormControlElement(elements[i])->hideVisibleValidationMessage();
     }
 
-    Vector<RefPtr<FormAssociatedElement> > unhandledInvalidControls;
+    WillBeHeapVector<RefPtrWillBeMember<FormAssociatedElement> > unhandledInvalidControls;
     if (!checkInvalidControlsAndCollectUnhandled(&unhandledInvalidControls))
         return true;
     // Because the form has invalid controls, we abort the form submission and
@@ -335,10 +343,10 @@
 
     m_wasUserSubmitted = processingUserGesture;
 
-    RefPtr<HTMLFormControlElement> firstSuccessfulSubmitButton;
+    RefPtrWillBeRawPtr<HTMLFormControlElement> firstSuccessfulSubmitButton = nullptr;
     bool needButtonActivation = activateSubmitButton; // do we need to activate a submit button?
 
-    const Vector<FormAssociatedElement*>& elements = associatedElements();
+    const FormAssociatedElement::List& elements = associatedElements();
     for (unsigned i = 0; i < elements.size(); ++i) {
         FormAssociatedElement* associatedElement = elements[i];
         if (!associatedElement->isFormControlElement())
@@ -416,7 +424,7 @@
         return;
     }
 
-    const Vector<FormAssociatedElement*>& elements = associatedElements();
+    const FormAssociatedElement::List& elements = associatedElements();
     for (unsigned i = 0; i < elements.size(); ++i) {
         if (elements[i]->isFormControlElement())
             toHTMLFormControlElement(elements[i])->reset();
@@ -536,7 +544,7 @@
     return ensureCachedHTMLCollection(FormControls);
 }
 
-void HTMLFormElement::collectAssociatedElements(Node& root, Vector<FormAssociatedElement*>& elements) const
+void HTMLFormElement::collectAssociatedElements(Node& root, FormAssociatedElement::List& elements) const
 {
     elements.clear();
     for (HTMLElement* element = Traversal<HTMLElement>::firstWithin(root); element; element = Traversal<HTMLElement>::next(*element)) {
@@ -554,7 +562,7 @@
 
 // This function should be const conceptually. However we update some fields
 // because of lazy evaluation.
-const Vector<FormAssociatedElement*>& HTMLFormElement::associatedElements() const
+const FormAssociatedElement::List& HTMLFormElement::associatedElements() const
 {
     if (!m_associatedElementsAreDirty)
         return m_associatedElements;
@@ -628,7 +636,7 @@
 
 HTMLFormControlElement* HTMLFormElement::defaultButton() const
 {
-    const Vector<FormAssociatedElement*>& elements = associatedElements();
+    const FormAssociatedElement::List& elements = associatedElements();
     for (unsigned i = 0; i < elements.size(); ++i) {
         if (!elements[i]->isFormControlElement())
             continue;
@@ -645,13 +653,13 @@
     return !checkInvalidControlsAndCollectUnhandled(0);
 }
 
-bool HTMLFormElement::checkInvalidControlsAndCollectUnhandled(Vector<RefPtr<FormAssociatedElement> >* unhandledInvalidControls)
+bool HTMLFormElement::checkInvalidControlsAndCollectUnhandled(WillBeHeapVector<RefPtrWillBeMember<FormAssociatedElement> >* unhandledInvalidControls)
 {
     RefPtr<HTMLFormElement> protector(this);
     // Copy associatedElements because event handlers called from
     // HTMLFormControlElement::checkValidity() might change associatedElements.
-    const Vector<FormAssociatedElement*>& associatedElements = this->associatedElements();
-    Vector<RefPtr<FormAssociatedElement> > elements;
+    const FormAssociatedElement::List& associatedElements = this->associatedElements();
+    WillBeHeapVector<RefPtrWillBeMember<FormAssociatedElement> > elements;
     elements.reserveCapacity(associatedElements.size());
     for (unsigned i = 0; i < associatedElements.size(); ++i)
         elements.append(associatedElements[i]);
diff --git a/Source/core/html/HTMLFormElement.h b/Source/core/html/HTMLFormElement.h
index a589fdf..5ea8a7a 100644
--- a/Source/core/html/HTMLFormElement.h
+++ b/Source/core/html/HTMLFormElement.h
@@ -47,8 +47,9 @@
 
 class HTMLFormElement FINAL : public HTMLElement {
 public:
-    static PassRefPtr<HTMLFormElement> create(Document&);
+    static PassRefPtrWillBeRawPtr<HTMLFormElement> create(Document&);
     virtual ~HTMLFormElement();
+    virtual void trace(Visitor*) OVERRIDE;
 
     PassRefPtr<HTMLCollection> elements();
     void getNamedElements(const AtomicString&, Vector<RefPtr<Element> >&);
@@ -110,7 +111,7 @@
 
     RadioButtonGroupScope& radioButtonGroupScope() { return m_radioButtonGroupScope; }
 
-    const Vector<FormAssociatedElement*>& associatedElements() const;
+    const FormAssociatedElement::List& associatedElements() const;
     const Vector<HTMLImageElement*>& imageElements();
 
     void anonymousNamedGetter(const AtomicString& name, bool&, RefPtr<RadioNodeList>&, bool&, RefPtr<Element>&);
@@ -138,7 +139,7 @@
 
     void scheduleFormSubmission(PassRefPtr<FormSubmission>);
 
-    void collectAssociatedElements(Node& root, Vector<FormAssociatedElement*>&) const;
+    void collectAssociatedElements(Node& root, FormAssociatedElement::List&) const;
     void collectImageElements(Node& root, Vector<HTMLImageElement*>&);
 
     // Returns true if the submission should proceed.
@@ -147,7 +148,7 @@
     // Validates each of the controls, and stores controls of which 'invalid'
     // event was not canceled to the specified vector. Returns true if there
     // are any invalid controls in this form.
-    bool checkInvalidControlsAndCollectUnhandled(Vector<RefPtr<FormAssociatedElement> >*);
+    bool checkInvalidControlsAndCollectUnhandled(WillBeHeapVector<RefPtrWillBeMember<FormAssociatedElement> >*);
 
     Element* elementFromPastNamesMap(const AtomicString&);
     void addToPastNamesMap(Element*, const AtomicString& pastName);
@@ -161,7 +162,7 @@
     RadioButtonGroupScope m_radioButtonGroupScope;
 
     // Do not access m_associatedElements directly. Use associatedElements() instead.
-    Vector<FormAssociatedElement*> m_associatedElements;
+    FormAssociatedElement::List m_associatedElements;
     // Do not access m_imageElements directly. Use imageElements() instead.
     Vector<HTMLImageElement*> m_imageElements;
     WeakPtrFactory<HTMLFormElement> m_weakPtrFactory;
diff --git a/Source/core/html/HTMLFrameElement.cpp b/Source/core/html/HTMLFrameElement.cpp
index e12efe3..fd4397b 100644
--- a/Source/core/html/HTMLFrameElement.cpp
+++ b/Source/core/html/HTMLFrameElement.cpp
@@ -40,9 +40,9 @@
     ScriptWrappable::init(this);
 }
 
-PassRefPtr<HTMLFrameElement> HTMLFrameElement::create(Document& document)
+PassRefPtrWillBeRawPtr<HTMLFrameElement> HTMLFrameElement::create(Document& document)
 {
-    return adoptRef(new HTMLFrameElement(document));
+    return adoptRefWillBeRefCountedGarbageCollected(new HTMLFrameElement(document));
 }
 
 bool HTMLFrameElement::rendererIsNeeded(const RenderStyle&)
diff --git a/Source/core/html/HTMLFrameElement.h b/Source/core/html/HTMLFrameElement.h
index f1c2621..f614de8 100644
--- a/Source/core/html/HTMLFrameElement.h
+++ b/Source/core/html/HTMLFrameElement.h
@@ -30,7 +30,7 @@
 
 class HTMLFrameElement FINAL : public HTMLFrameElementBase {
 public:
-    static PassRefPtr<HTMLFrameElement> create(Document&);
+    static PassRefPtrWillBeRawPtr<HTMLFrameElement> create(Document&);
 
     bool hasFrameBorder() const { return m_frameBorder; }
 
diff --git a/Source/core/html/HTMLFrameElement.idl b/Source/core/html/HTMLFrameElement.idl
index 364ffba..619801b 100644
--- a/Source/core/html/HTMLFrameElement.idl
+++ b/Source/core/html/HTMLFrameElement.idl
@@ -37,6 +37,6 @@
 
     [CheckSecurity=Node, RaisesException] Document getSVGDocument();
 
-    readonly attribute long width;
-    readonly attribute long height;
+    [MeasureAs=HTMLFrameElementWidth] readonly attribute long width;
+    [MeasureAs=HTMLFrameElementHeight] readonly attribute long height;
 };
diff --git a/Source/core/html/HTMLFrameElementBase.cpp b/Source/core/html/HTMLFrameElementBase.cpp
index db7d079..05ad91a 100644
--- a/Source/core/html/HTMLFrameElementBase.cpp
+++ b/Source/core/html/HTMLFrameElementBase.cpp
@@ -199,7 +199,7 @@
 
 bool HTMLFrameElementBase::hasLegalLinkAttribute(const QualifiedName& name) const
 {
-    return name == hrefAttr || HTMLFrameOwnerElement::hasLegalLinkAttribute(name);
+    return name == srcAttr || HTMLFrameOwnerElement::hasLegalLinkAttribute(name);
 }
 
 bool HTMLFrameElementBase::isHTMLContentAttribute(const Attribute& attribute) const
diff --git a/Source/core/html/HTMLFrameOwnerElement.cpp b/Source/core/html/HTMLFrameOwnerElement.cpp
index ee505a7..0b722db 100644
--- a/Source/core/html/HTMLFrameOwnerElement.cpp
+++ b/Source/core/html/HTMLFrameOwnerElement.cpp
@@ -32,7 +32,6 @@
 #include "core/rendering/RenderLayer.h"
 #include "core/rendering/RenderPart.h"
 #include "core/rendering/compositing/RenderLayerCompositor.h"
-#include "core/svg/SVGDocument.h"
 #include "platform/weborigin/SecurityOrigin.h"
 #include "platform/weborigin/SecurityPolicy.h"
 
@@ -170,11 +169,11 @@
     return m_contentFrame && HTMLElement::isKeyboardFocusable();
 }
 
-SVGDocument* HTMLFrameOwnerElement::getSVGDocument(ExceptionState& exceptionState) const
+Document* HTMLFrameOwnerElement::getSVGDocument(ExceptionState& exceptionState) const
 {
     Document* doc = contentDocument();
     if (doc && doc->isSVGDocument())
-        return toSVGDocument(doc);
+        return doc;
     return 0;
 }
 
diff --git a/Source/core/html/HTMLFrameOwnerElement.h b/Source/core/html/HTMLFrameOwnerElement.h
index cc418ad..e3d2add 100644
--- a/Source/core/html/HTMLFrameOwnerElement.h
+++ b/Source/core/html/HTMLFrameOwnerElement.h
@@ -22,7 +22,6 @@
 #define HTMLFrameOwnerElement_h
 
 #include "core/html/HTMLElement.h"
-#include "core/svg/SVGDocument.h"
 #include "wtf/HashCountedSet.h"
 
 namespace WebCore {
@@ -51,7 +50,7 @@
     // RenderObject when using fallback content.
     RenderPart* renderPart() const;
 
-    SVGDocument* getSVGDocument(ExceptionState&) const;
+    Document* getSVGDocument(ExceptionState&) const;
 
     virtual ScrollbarMode scrollingMode() const { return ScrollbarAuto; }
 
diff --git a/Source/core/html/HTMLFrameSetElement.cpp b/Source/core/html/HTMLFrameSetElement.cpp
index 8392d4f..60ef8ff 100644
--- a/Source/core/html/HTMLFrameSetElement.cpp
+++ b/Source/core/html/HTMLFrameSetElement.cpp
@@ -53,9 +53,9 @@
     setHasCustomStyleCallbacks();
 }
 
-PassRefPtr<HTMLFrameSetElement> HTMLFrameSetElement::create(Document& document)
+PassRefPtrWillBeRawPtr<HTMLFrameSetElement> HTMLFrameSetElement::create(Document& document)
 {
-    return adoptRef(new HTMLFrameSetElement(document));
+    return adoptRefWillBeRefCountedGarbageCollected(new HTMLFrameSetElement(document));
 }
 
 bool HTMLFrameSetElement::isPresentationAttribute(const QualifiedName& name) const
diff --git a/Source/core/html/HTMLFrameSetElement.h b/Source/core/html/HTMLFrameSetElement.h
index cf64096..3ada24f 100644
--- a/Source/core/html/HTMLFrameSetElement.h
+++ b/Source/core/html/HTMLFrameSetElement.h
@@ -31,7 +31,7 @@
 
 class HTMLFrameSetElement FINAL : public HTMLElement {
 public:
-    static PassRefPtr<HTMLFrameSetElement> create(Document&);
+    static PassRefPtrWillBeRawPtr<HTMLFrameSetElement> create(Document&);
 
     bool hasFrameBorder() const { return m_frameborder; }
     bool noResize() const { return m_noresize; }
diff --git a/Source/core/html/HTMLHRElement.cpp b/Source/core/html/HTMLHRElement.cpp
index 912c589..c3eac33 100644
--- a/Source/core/html/HTMLHRElement.cpp
+++ b/Source/core/html/HTMLHRElement.cpp
@@ -39,9 +39,9 @@
     ScriptWrappable::init(this);
 }
 
-PassRefPtr<HTMLHRElement> HTMLHRElement::create(Document& document)
+PassRefPtrWillBeRawPtr<HTMLHRElement> HTMLHRElement::create(Document& document)
 {
-    return adoptRef(new HTMLHRElement(document));
+    return adoptRefWillBeRefCountedGarbageCollected(new HTMLHRElement(document));
 }
 
 bool HTMLHRElement::isPresentationAttribute(const QualifiedName& name) const
diff --git a/Source/core/html/HTMLHRElement.h b/Source/core/html/HTMLHRElement.h
index 6d67e7d..4c4c10f 100644
--- a/Source/core/html/HTMLHRElement.h
+++ b/Source/core/html/HTMLHRElement.h
@@ -29,7 +29,7 @@
 
 class HTMLHRElement FINAL : public HTMLElement {
 public:
-    static PassRefPtr<HTMLHRElement> create(Document&);
+    static PassRefPtrWillBeRawPtr<HTMLHRElement> create(Document&);
 
     virtual bool canContainRangeEndPoint() const OVERRIDE { return hasChildren(); }
 
diff --git a/Source/core/html/HTMLHeadElement.cpp b/Source/core/html/HTMLHeadElement.cpp
index 8a25aa6..fd00ab4 100644
--- a/Source/core/html/HTMLHeadElement.cpp
+++ b/Source/core/html/HTMLHeadElement.cpp
@@ -36,9 +36,9 @@
     ScriptWrappable::init(this);
 }
 
-PassRefPtr<HTMLHeadElement> HTMLHeadElement::create(Document& document)
+PassRefPtrWillBeRawPtr<HTMLHeadElement> HTMLHeadElement::create(Document& document)
 {
-    return adoptRef(new HTMLHeadElement(document));
+    return adoptRefWillBeRefCountedGarbageCollected(new HTMLHeadElement(document));
 }
 
 }
diff --git a/Source/core/html/HTMLHeadElement.h b/Source/core/html/HTMLHeadElement.h
index 68d66c1..2961834 100644
--- a/Source/core/html/HTMLHeadElement.h
+++ b/Source/core/html/HTMLHeadElement.h
@@ -30,7 +30,7 @@
 
 class HTMLHeadElement FINAL : public HTMLElement {
 public:
-    static PassRefPtr<HTMLHeadElement> create(Document&);
+    static PassRefPtrWillBeRawPtr<HTMLHeadElement> create(Document&);
 
 private:
     explicit HTMLHeadElement(Document&);
diff --git a/Source/core/html/HTMLHeadingElement.cpp b/Source/core/html/HTMLHeadingElement.cpp
index 7e9c986..de6bdf2 100644
--- a/Source/core/html/HTMLHeadingElement.cpp
+++ b/Source/core/html/HTMLHeadingElement.cpp
@@ -31,9 +31,9 @@
     ScriptWrappable::init(this);
 }
 
-PassRefPtr<HTMLHeadingElement> HTMLHeadingElement::create(const QualifiedName& tagName, Document& document)
+PassRefPtrWillBeRawPtr<HTMLHeadingElement> HTMLHeadingElement::create(const QualifiedName& tagName, Document& document)
 {
-    return adoptRef(new HTMLHeadingElement(tagName, document));
+    return adoptRefWillBeRefCountedGarbageCollected(new HTMLHeadingElement(tagName, document));
 }
 
 }
diff --git a/Source/core/html/HTMLHeadingElement.h b/Source/core/html/HTMLHeadingElement.h
index e99bac5..dda619e 100644
--- a/Source/core/html/HTMLHeadingElement.h
+++ b/Source/core/html/HTMLHeadingElement.h
@@ -29,7 +29,7 @@
 
 class HTMLHeadingElement FINAL : public HTMLElement {
 public:
-    static PassRefPtr<HTMLHeadingElement> create(const QualifiedName&, Document&);
+    static PassRefPtrWillBeRawPtr<HTMLHeadingElement> create(const QualifiedName&, Document&);
 
 private:
     HTMLHeadingElement(const QualifiedName&, Document&);
diff --git a/Source/core/html/HTMLHtmlElement.cpp b/Source/core/html/HTMLHtmlElement.cpp
index fb55c51..406146f 100644
--- a/Source/core/html/HTMLHtmlElement.cpp
+++ b/Source/core/html/HTMLHtmlElement.cpp
@@ -42,9 +42,9 @@
     ScriptWrappable::init(this);
 }
 
-PassRefPtr<HTMLHtmlElement> HTMLHtmlElement::create(Document& document)
+PassRefPtrWillBeRawPtr<HTMLHtmlElement> HTMLHtmlElement::create(Document& document)
 {
-    return adoptRef(new HTMLHtmlElement(document));
+    return adoptRefWillBeRefCountedGarbageCollected(new HTMLHtmlElement(document));
 }
 
 bool HTMLHtmlElement::isURLAttribute(const Attribute& attribute) const
diff --git a/Source/core/html/HTMLHtmlElement.h b/Source/core/html/HTMLHtmlElement.h
index 5207cf6..02c264c 100644
--- a/Source/core/html/HTMLHtmlElement.h
+++ b/Source/core/html/HTMLHtmlElement.h
@@ -30,7 +30,7 @@
 
 class HTMLHtmlElement FINAL : public HTMLElement {
 public:
-    static PassRefPtr<HTMLHtmlElement> create(Document&);
+    static PassRefPtrWillBeRawPtr<HTMLHtmlElement> create(Document&);
 
     void insertedByParser();
 
diff --git a/Source/core/html/HTMLIFrameElement.cpp b/Source/core/html/HTMLIFrameElement.cpp
index 55bd1ac..479fc49 100644
--- a/Source/core/html/HTMLIFrameElement.cpp
+++ b/Source/core/html/HTMLIFrameElement.cpp
@@ -41,9 +41,9 @@
     ScriptWrappable::init(this);
 }
 
-PassRefPtr<HTMLIFrameElement> HTMLIFrameElement::create(Document& document)
+PassRefPtrWillBeRawPtr<HTMLIFrameElement> HTMLIFrameElement::create(Document& document)
 {
-    return adoptRef(new HTMLIFrameElement(document));
+    return adoptRefWillBeRefCountedGarbageCollected(new HTMLIFrameElement(document));
 }
 
 bool HTMLIFrameElement::isPresentationAttribute(const QualifiedName& name) const
diff --git a/Source/core/html/HTMLIFrameElement.h b/Source/core/html/HTMLIFrameElement.h
index 14589b9..8b2c948 100644
--- a/Source/core/html/HTMLIFrameElement.h
+++ b/Source/core/html/HTMLIFrameElement.h
@@ -30,7 +30,7 @@
 
 class HTMLIFrameElement FINAL : public HTMLFrameElementBase {
 public:
-    static PassRefPtr<HTMLIFrameElement> create(Document&);
+    static PassRefPtrWillBeRawPtr<HTMLIFrameElement> create(Document&);
 
 private:
     explicit HTMLIFrameElement(Document&);
diff --git a/Source/core/html/HTMLIFrameElement.idl b/Source/core/html/HTMLIFrameElement.idl
index 745f3fd..e8e32c8 100644
--- a/Source/core/html/HTMLIFrameElement.idl
+++ b/Source/core/html/HTMLIFrameElement.idl
@@ -28,7 +28,7 @@
     [Reflect] attribute DOMString name;
     [Reflect, TreatNullAs=NullString] attribute DOMString sandbox;
     [Reflect] attribute DOMString scrolling;
-    [Reflect, URL, PerWorldBindings, LogActivity=SetterOnly] attribute DOMString src;
+    [Reflect, URL, PerWorldBindings, LogActivity=SetterOnly, LogPreviousValue] attribute DOMString src;
     [Reflect] attribute DOMString srcdoc;
     [Reflect] attribute DOMString width;
 
diff --git a/Source/core/html/HTMLImageElement.cpp b/Source/core/html/HTMLImageElement.cpp
index 6d15b5b..f236266 100644
--- a/Source/core/html/HTMLImageElement.cpp
+++ b/Source/core/html/HTMLImageElement.cpp
@@ -61,14 +61,14 @@
     }
 }
 
-PassRefPtr<HTMLImageElement> HTMLImageElement::create(Document& document)
+PassRefPtrWillBeRawPtr<HTMLImageElement> HTMLImageElement::create(Document& document)
 {
-    return adoptRef(new HTMLImageElement(document));
+    return adoptRefWillBeRefCountedGarbageCollected(new HTMLImageElement(document));
 }
 
-PassRefPtr<HTMLImageElement> HTMLImageElement::create(Document& document, HTMLFormElement* form)
+PassRefPtrWillBeRawPtr<HTMLImageElement> HTMLImageElement::create(Document& document, HTMLFormElement* form)
 {
-    return adoptRef(new HTMLImageElement(document, form));
+    return adoptRefWillBeRefCountedGarbageCollected(new HTMLImageElement(document, form));
 }
 
 HTMLImageElement::~HTMLImageElement()
@@ -77,9 +77,9 @@
         m_form->disassociate(*this);
 }
 
-PassRefPtr<HTMLImageElement> HTMLImageElement::createForJSConstructor(Document& document, int width, int height)
+PassRefPtrWillBeRawPtr<HTMLImageElement> HTMLImageElement::createForJSConstructor(Document& document, int width, int height)
 {
-    RefPtr<HTMLImageElement> image = adoptRef(new HTMLImageElement(document));
+    RefPtrWillBeRawPtr<HTMLImageElement> image = adoptRefWillBeRefCountedGarbageCollected(new HTMLImageElement(document));
     if (width)
         image->setWidth(width);
     if (height)
diff --git a/Source/core/html/HTMLImageElement.h b/Source/core/html/HTMLImageElement.h
index 7ab6af7..4d808be 100644
--- a/Source/core/html/HTMLImageElement.h
+++ b/Source/core/html/HTMLImageElement.h
@@ -36,9 +36,9 @@
 
 class HTMLImageElement FINAL : public HTMLElement, public CanvasImageSource {
 public:
-    static PassRefPtr<HTMLImageElement> create(Document&);
-    static PassRefPtr<HTMLImageElement> create(Document&, HTMLFormElement*);
-    static PassRefPtr<HTMLImageElement> createForJSConstructor(Document&, int width, int height);
+    static PassRefPtrWillBeRawPtr<HTMLImageElement> create(Document&);
+    static PassRefPtrWillBeRawPtr<HTMLImageElement> create(Document&, HTMLFormElement*);
+    static PassRefPtrWillBeRawPtr<HTMLImageElement> createForJSConstructor(Document&, int width, int height);
 
     virtual ~HTMLImageElement();
 
diff --git a/Source/core/html/HTMLImageElement.idl b/Source/core/html/HTMLImageElement.idl
index 98a5f73..df267ac 100644
--- a/Source/core/html/HTMLImageElement.idl
+++ b/Source/core/html/HTMLImageElement.idl
@@ -45,8 +45,8 @@
     attribute long width;
 
     // Extensions
-    readonly attribute long x;
-    readonly attribute long y;
+    [MeasureAs=HTMLImageElementX] readonly attribute long x;
+    [MeasureAs=HTMLImageElementY] readonly attribute long y;
 
     [Reflect, RuntimeEnabled=SubresourceIntegrity] attribute DOMString integrity;
 };
diff --git a/Source/core/html/HTMLInputElement.cpp b/Source/core/html/HTMLInputElement.cpp
index 03bb788..c24197a 100644
--- a/Source/core/html/HTMLInputElement.cpp
+++ b/Source/core/html/HTMLInputElement.cpp
@@ -82,7 +82,7 @@
 
 using namespace HTMLNames;
 
-class ListAttributeTargetObserver : IdTargetObserver {
+class ListAttributeTargetObserver : public IdTargetObserver {
     WTF_MAKE_FAST_ALLOCATED;
 public:
     static PassOwnPtr<ListAttributeTargetObserver> create(const AtomicString& id, HTMLInputElement*);
@@ -129,13 +129,20 @@
     ScriptWrappable::init(this);
 }
 
-PassRefPtr<HTMLInputElement> HTMLInputElement::create(Document& document, HTMLFormElement* form, bool createdByParser)
+PassRefPtrWillBeRawPtr<HTMLInputElement> HTMLInputElement::create(Document& document, HTMLFormElement* form, bool createdByParser)
 {
-    RefPtr<HTMLInputElement> inputElement = adoptRef(new HTMLInputElement(document, form, createdByParser));
+    RefPtrWillBeRawPtr<HTMLInputElement> inputElement = adoptRefWillBeRefCountedGarbageCollected(new HTMLInputElement(document, form, createdByParser));
     inputElement->ensureUserAgentShadowRoot();
     return inputElement.release();
 }
 
+void HTMLInputElement::trace(Visitor* visitor)
+{
+    visitor->trace(m_inputType);
+    visitor->trace(m_inputTypeView);
+    HTMLTextFormControlElement::trace(visitor);
+}
+
 HTMLImageLoader* HTMLInputElement::imageLoader()
 {
     if (!m_imageLoader)
@@ -404,7 +411,7 @@
     if (m_inputType->formControlType() == newTypeName)
         return;
 
-    RefPtr<InputType> newType = InputType::create(*this, newTypeName);
+    RefPtrWillBeRawPtr<InputType> newType = InputType::create(*this, newTypeName);
     removeFromRadioButtonGroup();
 
     bool didStoreValue = m_inputType->storesValueSeparateFromAttribute();
@@ -712,24 +719,7 @@
             listAttributeTargetChanged();
         }
         UseCounter::count(document(), UseCounter::ListAttribute);
-    }
-#if ENABLE(INPUT_SPEECH)
-    else if (name == webkitspeechAttr) {
-        if (RuntimeEnabledFeatures::speechInputEnabled() && m_inputType->shouldRespectSpeechAttribute()) {
-            // This renderer and its children have quite different layouts and
-            // styles depending on whether the speech button is visible or
-            // not. So we reset the whole thing and recreate to get the right
-            // styles and layout.
-            m_inputTypeView->destroyShadowSubtree();
-            lazyReattachIfAttached();
-            m_inputTypeView->createShadowSubtree();
-            m_needsToUpdateViewValue = true;
-        }
-        UseCounter::countDeprecation(document(), UseCounter::PrefixedSpeechAttribute);
-    } else if (name == onwebkitspeechchangeAttr)
-        setAttributeEventListener(EventTypeNames::webkitspeechchange, createAttributeEventListener(this, name, value));
-#endif
-    else if (name == webkitdirectoryAttr) {
+    } else if (name == webkitdirectoryAttr) {
         HTMLTextFormControlElement::parseAttribute(name, value);
         UseCounter::count(document(), UseCounter::PrefixedDirectoryAttribute);
     }
@@ -845,7 +835,7 @@
     if (checked() == nowChecked)
         return;
 
-    RefPtr<HTMLInputElement> protector(this);
+    RefPtrWillBeRawPtr<HTMLInputElement> protector(this);
     m_reflectsCheckedAttribute = false;
     m_isChecked = nowChecked;
     setNeedsStyleRecalc(SubtreeStyleChange);
@@ -911,6 +901,7 @@
     setChecked(sourceElement.m_isChecked);
     m_reflectsCheckedAttribute = sourceElement.m_reflectsCheckedAttribute;
     m_isIndeterminate = sourceElement.m_isIndeterminate;
+    m_inputType->copyNonAttributeProperties(sourceElement);
 
     HTMLTextFormControlElement::copyNonAttributePropertiesFromElement(source);
 
@@ -1002,7 +993,7 @@
     if (!m_inputType->canSetValue(value))
         return;
 
-    RefPtr<HTMLInputElement> protector(this);
+    RefPtrWillBeRawPtr<HTMLInputElement> protector(this);
     EventQueueScope scope;
     String sanitizedValue = sanitizeValue(value);
     bool valueChanged = sanitizedValue != this->value();
@@ -1054,6 +1045,8 @@
 
 void HTMLInputElement::setValueAsNumber(double newValue, ExceptionState& exceptionState, TextFieldEventBehavior eventBehavior)
 {
+    // http://www.whatwg.org/specs/web-apps/current-work/multipage/common-input-element-attributes.html#dom-input-valueasnumber
+    // On setting, if the new value is infinite, then throw a TypeError exception.
     if (std::isinf(newValue)) {
         exceptionState.throwTypeError(ExceptionMessages::notAFiniteNumber(newValue));
         return;
@@ -1321,7 +1314,7 @@
     return document().completeURL(fastGetAttribute(srcAttr));
 }
 
-FileList* HTMLInputElement::files()
+FileList* HTMLInputElement::files() const
 {
     return m_inputType->files();
 }
@@ -1514,12 +1507,19 @@
     return false;
 }
 
+void HTMLInputElement::setListAttributeTargetObserver(PassOwnPtr<ListAttributeTargetObserver> newObserver)
+{
+    if (m_listAttributeTargetObserver)
+        m_listAttributeTargetObserver->unregister();
+    m_listAttributeTargetObserver = newObserver;
+}
+
 void HTMLInputElement::resetListAttributeTargetObserver()
 {
     if (inDocument())
-        m_listAttributeTargetObserver = ListAttributeTargetObserver::create(fastGetAttribute(listAttr), this);
+        setListAttributeTargetObserver(ListAttributeTargetObserver::create(fastGetAttribute(listAttr), this));
     else
-        m_listAttributeTargetObserver = nullptr;
+        setListAttributeTargetObserver(nullptr);
 }
 
 void HTMLInputElement::listAttributeTargetChanged()
@@ -1532,16 +1532,6 @@
     return m_inputType->isSteppable();
 }
 
-#if ENABLE(INPUT_SPEECH)
-
-bool HTMLInputElement::isSpeechEnabled() const
-{
-    // FIXME: Add support for RANGE, EMAIL, URL, COLOR and DATE/TIME input types.
-    return m_inputType->shouldRespectSpeechAttribute() && RuntimeEnabledFeatures::speechInputEnabled() && hasAttribute(webkitspeechAttr);
-}
-
-#endif
-
 bool HTMLInputElement::isTextButton() const
 {
     return m_inputType->isTextButton();
@@ -1884,4 +1874,9 @@
 }
 #endif
 
+bool HTMLInputElement::shouldDispatchFormControlChangeEvent(String& oldValue, String& newValue)
+{
+    return m_inputType->shouldDispatchFormControlChangeEvent(oldValue, newValue);
+}
+
 } // namespace
diff --git a/Source/core/html/HTMLInputElement.h b/Source/core/html/HTMLInputElement.h
index af27a92..6c4f20e 100644
--- a/Source/core/html/HTMLInputElement.h
+++ b/Source/core/html/HTMLInputElement.h
@@ -46,8 +46,9 @@
 
 class HTMLInputElement : public HTMLTextFormControlElement {
 public:
-    static PassRefPtr<HTMLInputElement> create(Document&, HTMLFormElement*, bool createdByParser);
+    static PassRefPtrWillBeRawPtr<HTMLInputElement> create(Document&, HTMLFormElement*, bool createdByParser);
     virtual ~HTMLInputElement();
+    virtual void trace(Visitor*) OVERRIDE;
 
     DEFINE_ATTRIBUTE_EVENT_LISTENER(webkitspeechchange);
 
@@ -112,10 +113,6 @@
     bool isTimeField() const;
     bool isWeekField() const;
 
-#if ENABLE(INPUT_SPEECH)
-    bool isSpeechEnabled() const;
-#endif
-
     HTMLElement* passwordGeneratorButtonElement() const;
 
     bool checked() const { return m_isChecked; }
@@ -202,7 +199,7 @@
 
     bool multiple() const;
 
-    FileList* files();
+    FileList* files() const;
     void setFiles(PassRefPtrWillBeRawPtr<FileList>);
 
     // Returns true if the given DragData has more than one dropped files.
@@ -364,6 +361,7 @@
 
     virtual void subtreeHasChanged() OVERRIDE FINAL;
 
+    void setListAttributeTargetObserver(PassOwnPtr<ListAttributeTargetObserver>);
     void resetListAttributeTargetObserver();
     void parseMaxLengthAttribute(const AtomicString&);
     void updateValueIfNeeded();
@@ -376,6 +374,8 @@
     virtual PassRefPtr<RenderStyle> customStyleForRenderer() OVERRIDE;
 #endif
 
+    virtual bool shouldDispatchFormControlChangeEvent(String&, String&) OVERRIDE;
+
     AtomicString m_name;
     String m_valueIfDirty;
     String m_suggestedValue;
@@ -395,8 +395,8 @@
     bool m_hasTouchEventHandler : 1;
     bool m_shouldRevealPassword : 1;
     bool m_needsToUpdateViewValue : 1;
-    RefPtr<InputType> m_inputType;
-    RefPtr<InputTypeView> m_inputTypeView;
+    RefPtrWillBeMember<InputType> m_inputType;
+    RefPtrWillBeMember<InputTypeView> m_inputTypeView;
     // The ImageLoader must be owned by this element because the loader code assumes
     // that it lives as long as its owning element lives. If we move the loader into
     // the ImageInput object we may delete the loader while this element lives on.
diff --git a/Source/core/html/HTMLInputElement.idl b/Source/core/html/HTMLInputElement.idl
index 4958c86..a26fe72 100644
--- a/Source/core/html/HTMLInputElement.idl
+++ b/Source/core/html/HTMLInputElement.idl
@@ -19,6 +19,8 @@
  * Boston, MA 02110-1301, USA.
  */
 
+// http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#htmlinputelement
+
 interface HTMLInputElement : HTMLElement {
     [Reflect] attribute DOMString accept;
     [Reflect] attribute DOMString align;
@@ -60,7 +62,7 @@
     // See the discussion in https://bugs.webkit.org/show_bug.cgi?id=100085
     [TreatNullAs=NullString, RaisesException=Setter, CustomElementCallbacks] attribute DOMString value;
     [RaisesException=Setter, CustomElementCallbacks] attribute Date? valueAsDate;
-    [RaisesException=Setter, CustomElementCallbacks] attribute double valueAsNumber;
+    [RaisesException=Setter, CustomElementCallbacks] attribute unrestricted double valueAsNumber;
 
     [RaisesException, CustomElementCallbacks] void stepUp(optional long n);
     [RaisesException, CustomElementCallbacks] void stepDown(optional long n);
@@ -93,9 +95,6 @@
     // Non-standard attributes
     [Reflect] attribute boolean webkitdirectory;
     [Reflect] attribute boolean incremental;
-    [Conditional=INPUT_SPEECH, Reflect, RuntimeEnabled=SpeechInput] attribute boolean webkitSpeech;
-    [Conditional=INPUT_SPEECH, Reflect, RuntimeEnabled=SpeechInput] attribute boolean webkitGrammar;
-    [Conditional=INPUT_SPEECH] attribute EventHandler onwebkitspeechchange;
 
     // See http://www.w3.org/TR/html-media-capture/
     [Conditional=MEDIA_CAPTURE, Reflect] attribute boolean capture;
diff --git a/Source/core/html/HTMLKeygenElement.h b/Source/core/html/HTMLKeygenElement.h
index f561605..a335201 100644
--- a/Source/core/html/HTMLKeygenElement.h
+++ b/Source/core/html/HTMLKeygenElement.h
@@ -32,9 +32,9 @@
 
 class HTMLKeygenElement FINAL : public HTMLFormControlElementWithState {
 public:
-    static PassRefPtr<HTMLKeygenElement> create(Document& document, HTMLFormElement* form)
+    static PassRefPtrWillBeRawPtr<HTMLKeygenElement> create(Document& document, HTMLFormElement* form)
     {
-        return adoptRef(new HTMLKeygenElement(document, form));
+        return adoptRefWillBeRefCountedGarbageCollected(new HTMLKeygenElement(document, form));
     }
 
     virtual bool willValidate() const OVERRIDE { return false; }
diff --git a/Source/core/html/HTMLLIElement.cpp b/Source/core/html/HTMLLIElement.cpp
index 7f3f899..b22e953 100644
--- a/Source/core/html/HTMLLIElement.cpp
+++ b/Source/core/html/HTMLLIElement.cpp
@@ -39,9 +39,9 @@
     ScriptWrappable::init(this);
 }
 
-PassRefPtr<HTMLLIElement> HTMLLIElement::create(Document& document)
+PassRefPtrWillBeRawPtr<HTMLLIElement> HTMLLIElement::create(Document& document)
 {
-    return adoptRef(new HTMLLIElement(document));
+    return adoptRefWillBeRefCountedGarbageCollected(new HTMLLIElement(document));
 }
 
 bool HTMLLIElement::isPresentationAttribute(const QualifiedName& name) const
diff --git a/Source/core/html/HTMLLIElement.h b/Source/core/html/HTMLLIElement.h
index a16f4b0..e92be8c 100644
--- a/Source/core/html/HTMLLIElement.h
+++ b/Source/core/html/HTMLLIElement.h
@@ -29,7 +29,7 @@
 
 class HTMLLIElement FINAL : public HTMLElement {
 public:
-    static PassRefPtr<HTMLLIElement> create(Document&);
+    static PassRefPtrWillBeRawPtr<HTMLLIElement> create(Document&);
 
 private:
     explicit HTMLLIElement(Document&);
diff --git a/Source/core/html/HTMLLabelElement.cpp b/Source/core/html/HTMLLabelElement.cpp
index 65d7160..b625e78 100644
--- a/Source/core/html/HTMLLabelElement.cpp
+++ b/Source/core/html/HTMLLabelElement.cpp
@@ -27,7 +27,9 @@
 
 #include "HTMLNames.h"
 #include "core/dom/ElementTraversal.h"
+#include "core/editing/FrameSelection.h"
 #include "core/events/Event.h"
+#include "core/frame/LocalFrame.h"
 #include "core/html/FormAssociatedElement.h"
 
 namespace WebCore {
@@ -49,9 +51,9 @@
     ScriptWrappable::init(this);
 }
 
-PassRefPtr<HTMLLabelElement> HTMLLabelElement::create(Document& document)
+PassRefPtrWillBeRawPtr<HTMLLabelElement> HTMLLabelElement::create(Document& document)
 {
-    return adoptRef(new HTMLLabelElement(document));
+    return adoptRefWillBeRefCountedGarbageCollected(new HTMLLabelElement(document));
 }
 
 bool HTMLLabelElement::rendererIsFocusable() const
@@ -136,7 +138,12 @@
     static bool processingClick = false;
 
     if (evt->type() == EventTypeNames::click && !processingClick) {
-        RefPtr<HTMLElement> element = control();
+        // If text of label element is selected, do not pass
+        // the event to control element.
+        if (document().frame()->selection().selection().isRange())
+            return;
+
+        RefPtrWillBeRawPtr<HTMLElement> element = control();
 
         // If we can't find a control or if the control received the click
         // event, then there's no need for us to do anything.
diff --git a/Source/core/html/HTMLLabelElement.h b/Source/core/html/HTMLLabelElement.h
index fe1ebd5..69b1ca3 100644
--- a/Source/core/html/HTMLLabelElement.h
+++ b/Source/core/html/HTMLLabelElement.h
@@ -31,7 +31,7 @@
 
 class HTMLLabelElement FINAL : public HTMLElement {
 public:
-    static PassRefPtr<HTMLLabelElement> create(Document&);
+    static PassRefPtrWillBeRawPtr<HTMLLabelElement> create(Document&);
 
     LabelableElement* control() const;
 
diff --git a/Source/core/html/HTMLLegendElement.cpp b/Source/core/html/HTMLLegendElement.cpp
index 858578d..3f50326 100644
--- a/Source/core/html/HTMLLegendElement.cpp
+++ b/Source/core/html/HTMLLegendElement.cpp
@@ -41,9 +41,9 @@
     ScriptWrappable::init(this);
 }
 
-PassRefPtr<HTMLLegendElement> HTMLLegendElement::create(Document& document)
+PassRefPtrWillBeRawPtr<HTMLLegendElement> HTMLLegendElement::create(Document& document)
 {
-    return adoptRef(new HTMLLegendElement(document));
+    return adoptRefWillBeRefCountedGarbageCollected(new HTMLLegendElement(document));
 }
 
 HTMLFormControlElement* HTMLLegendElement::associatedControl()
diff --git a/Source/core/html/HTMLLegendElement.h b/Source/core/html/HTMLLegendElement.h
index 6d390f2..a033309 100644
--- a/Source/core/html/HTMLLegendElement.h
+++ b/Source/core/html/HTMLLegendElement.h
@@ -32,7 +32,7 @@
 
 class HTMLLegendElement FINAL : public HTMLElement {
 public:
-    static PassRefPtr<HTMLLegendElement> create(Document&);
+    static PassRefPtrWillBeRawPtr<HTMLLegendElement> create(Document&);
 
     HTMLFormElement* form() const;
 
diff --git a/Source/core/html/HTMLLinkElement.cpp b/Source/core/html/HTMLLinkElement.cpp
index b7547f0..3ee6600 100644
--- a/Source/core/html/HTMLLinkElement.cpp
+++ b/Source/core/html/HTMLLinkElement.cpp
@@ -43,6 +43,7 @@
 #include "core/frame/FrameView.h"
 #include "core/frame/LocalFrame.h"
 #include "core/frame/csp/ContentSecurityPolicy.h"
+#include "core/html/LinkManifest.h"
 #include "core/html/imports/LinkImport.h"
 #include "core/loader/FrameLoader.h"
 #include "core/loader/FrameLoaderClient.h"
@@ -140,16 +141,16 @@
     ScriptWrappable::init(this);
 }
 
-PassRefPtr<HTMLLinkElement> HTMLLinkElement::create(Document& document, bool createdByParser)
+PassRefPtrWillBeRawPtr<HTMLLinkElement> HTMLLinkElement::create(Document& document, bool createdByParser)
 {
-    return adoptRef(new HTMLLinkElement(document, createdByParser));
+    return adoptRefWillBeRefCountedGarbageCollected(new HTMLLinkElement(document, createdByParser));
 }
 
 HTMLLinkElement::~HTMLLinkElement()
 {
+#if !ENABLE(OILPAN)
     m_link.clear();
 
-#if !ENABLE(OILPAN)
     if (inDocument())
         document().styleEngine()->removeStyleSheetCandidateNode(this);
 #endif
@@ -206,10 +207,12 @@
     }
 
     if (!m_link) {
-        if (m_relAttribute.isImport() && RuntimeEnabledFeatures::htmlImportsEnabled())
+        if (m_relAttribute.isImport() && RuntimeEnabledFeatures::htmlImportsEnabled()) {
             m_link = LinkImport::create(this);
-        else {
-            OwnPtr<LinkStyle> link = LinkStyle::create(this);
+        } else if (m_relAttribute.isManifest() && RuntimeEnabledFeatures::manifestEnabled()) {
+            m_link = LinkManifest::create(this);
+        } else {
+            OwnPtrWillBeRawPtr<LinkStyle> link = LinkStyle::create(this);
             if (fastHasAttribute(disabledAttr))
                 link->setDisabledState(true);
             m_link = link.release();
@@ -419,9 +422,16 @@
     return m_sizes.get();
 }
 
-PassOwnPtr<LinkStyle> LinkStyle::create(HTMLLinkElement* owner)
+void HTMLLinkElement::trace(Visitor* visitor)
 {
-    return adoptPtr(new LinkStyle(owner));
+    visitor->trace(m_link);
+    visitor->trace(m_sizes);
+    HTMLElement::trace(visitor);
+}
+
+PassOwnPtrWillBeRawPtr<LinkStyle> LinkStyle::create(HTMLLinkElement* owner)
+{
+    return adoptPtrWillBeNoop(new LinkStyle(owner));
 }
 
 LinkStyle::LinkStyle(HTMLLinkElement* owner)
@@ -436,8 +446,10 @@
 
 LinkStyle::~LinkStyle()
 {
+#if !ENABLE(OILPAN)
     if (m_sheet)
         m_sheet->clearOwnerNode();
+#endif
 }
 
 Document& LinkStyle::document()
@@ -453,7 +465,7 @@
 
     }
     // Completing the sheet load may cause scripts to execute.
-    RefPtr<Node> protector(m_owner);
+    RefPtrWillBeRawPtr<Node> protector(m_owner);
 
     CSSParserContext parserContext(m_owner->document(), 0, baseURL, charset);
 
@@ -692,4 +704,10 @@
         removePendingSheet(RemovePendingSheetNotifyLater);
 }
 
+void LinkStyle::trace(Visitor* visitor)
+{
+    visitor->trace(m_sheet);
+    LinkResource::trace(visitor);
+}
+
 } // namespace WebCore
diff --git a/Source/core/html/HTMLLinkElement.h b/Source/core/html/HTMLLinkElement.h
index 7ae3cbe..b5a9c52 100644
--- a/Source/core/html/HTMLLinkElement.h
+++ b/Source/core/html/HTMLLinkElement.h
@@ -56,9 +56,9 @@
 // sticking current way so far.
 //
 class LinkStyle FINAL : public LinkResource, ResourceOwner<StyleSheetResource> {
-    WTF_MAKE_FAST_ALLOCATED;
+    WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED;
 public:
-    static PassOwnPtr<LinkStyle> create(HTMLLinkElement* owner);
+    static PassOwnPtrWillBeRawPtr<LinkStyle> create(HTMLLinkElement* owner);
 
     explicit LinkStyle(HTMLLinkElement* owner);
     virtual ~LinkStyle();
@@ -67,6 +67,7 @@
     virtual void process() OVERRIDE;
     virtual void ownerRemoved() OVERRIDE;
     virtual bool hasLoaded() const OVERRIDE { return m_loadedSheet; }
+    virtual void trace(Visitor*) OVERRIDE;
 
     void startLoadingDynamicSheet();
     void notifyLoadedSheetAndAllCriticalSubresources(bool errorOccurred);
@@ -109,7 +110,7 @@
     void removePendingSheet(RemovePendingSheetNotificationType = RemovePendingSheetNotifyImmediately);
     Document& document();
 
-    RefPtrWillBePersistent<CSSStyleSheet> m_sheet;
+    RefPtrWillBeMember<CSSStyleSheet> m_sheet;
     DisabledState m_disabledState;
     PendingSheetType m_pendingSheetType;
     bool m_loading;
@@ -120,7 +121,7 @@
 
 class HTMLLinkElement FINAL : public HTMLElement, public LinkLoaderClient {
 public:
-    static PassRefPtr<HTMLLinkElement> create(Document&, bool createdByParser);
+    static PassRefPtrWillBeRawPtr<HTMLLinkElement> create(Document&, bool createdByParser);
     virtual ~HTMLLinkElement();
 
     KURL href() const;
@@ -166,6 +167,8 @@
     // visible for testing purpose.
     static void parseSizesAttribute(const AtomicString& value, Vector<IntSize>& iconSizes);
 
+    virtual void trace(Visitor*) OVERRIDE;
+
 private:
     virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
 
@@ -198,12 +201,12 @@
 private:
     HTMLLinkElement(Document&, bool createdByParser);
 
-    OwnPtr<LinkResource> m_link;
+    OwnPtrWillBeMember<LinkResource> m_link;
     LinkLoader m_linkLoader;
 
     String m_type;
     String m_media;
-    RefPtr<DOMSettableTokenList> m_sizes;
+    RefPtrWillBeMember<DOMSettableTokenList> m_sizes;
     Vector<IntSize> m_iconSizes;
     LinkRelAttribute m_relAttribute;
 
diff --git a/Source/core/html/HTMLMapElement.cpp b/Source/core/html/HTMLMapElement.cpp
index 88938ef..f3cf6ff 100644
--- a/Source/core/html/HTMLMapElement.cpp
+++ b/Source/core/html/HTMLMapElement.cpp
@@ -42,9 +42,9 @@
     ScriptWrappable::init(this);
 }
 
-PassRefPtr<HTMLMapElement> HTMLMapElement::create(Document& document)
+PassRefPtrWillBeRawPtr<HTMLMapElement> HTMLMapElement::create(Document& document)
 {
-    return adoptRef(new HTMLMapElement(document));
+    return adoptRefWillBeRefCountedGarbageCollected(new HTMLMapElement(document));
 }
 
 HTMLMapElement::~HTMLMapElement()
diff --git a/Source/core/html/HTMLMapElement.h b/Source/core/html/HTMLMapElement.h
index 5535717..14172dc 100644
--- a/Source/core/html/HTMLMapElement.h
+++ b/Source/core/html/HTMLMapElement.h
@@ -32,7 +32,7 @@
 
 class HTMLMapElement FINAL : public HTMLElement {
 public:
-    static PassRefPtr<HTMLMapElement> create(Document&);
+    static PassRefPtrWillBeRawPtr<HTMLMapElement> create(Document&);
     virtual ~HTMLMapElement();
 
     const AtomicString& getName() const { return m_name; }
diff --git a/Source/core/html/HTMLMarqueeElement.cpp b/Source/core/html/HTMLMarqueeElement.cpp
index 200d570..2057c2f 100644
--- a/Source/core/html/HTMLMarqueeElement.cpp
+++ b/Source/core/html/HTMLMarqueeElement.cpp
@@ -41,9 +41,9 @@
     ScriptWrappable::init(this);
 }
 
-PassRefPtr<HTMLMarqueeElement> HTMLMarqueeElement::create(Document& document)
+PassRefPtrWillBeRawPtr<HTMLMarqueeElement> HTMLMarqueeElement::create(Document& document)
 {
-    RefPtr<HTMLMarqueeElement> marqueeElement(adoptRef(new HTMLMarqueeElement(document)));
+    RefPtrWillBeRawPtr<HTMLMarqueeElement> marqueeElement(adoptRefWillBeRefCountedGarbageCollected(new HTMLMarqueeElement(document)));
     marqueeElement->suspendIfNeeded();
     return marqueeElement.release();
 }
diff --git a/Source/core/html/HTMLMarqueeElement.h b/Source/core/html/HTMLMarqueeElement.h
index 6b11a18..a7d5b04 100644
--- a/Source/core/html/HTMLMarqueeElement.h
+++ b/Source/core/html/HTMLMarqueeElement.h
@@ -33,7 +33,7 @@
 
 class HTMLMarqueeElement FINAL : public HTMLElement, private ActiveDOMObject {
 public:
-    static PassRefPtr<HTMLMarqueeElement> create(Document&);
+    static PassRefPtrWillBeRawPtr<HTMLMarqueeElement> create(Document&);
 
     int minimumDelay() const;
 
diff --git a/Source/core/html/HTMLMediaElement.cpp b/Source/core/html/HTMLMediaElement.cpp
index 917eaef..e581521 100644
--- a/Source/core/html/HTMLMediaElement.cpp
+++ b/Source/core/html/HTMLMediaElement.cpp
@@ -684,7 +684,7 @@
     }
 
     // 5 - Set the playbackRate attribute to the value of the defaultPlaybackRate attribute.
-    setPlaybackRate(defaultPlaybackRate(), IGNORE_EXCEPTION);
+    setPlaybackRate(defaultPlaybackRate());
 
     // 6 - Set the error attribute to null and the autoplaying flag to true.
     m_error = nullptr;
@@ -1886,11 +1886,6 @@
 
 void HTMLMediaElement::setCurrentTime(double time, ExceptionState& exceptionState)
 {
-    // FIXME: generated bindings should check isfinite: http://crbug.com/354298
-    if (!std::isfinite(time)) {
-        exceptionState.throwTypeError(ExceptionMessages::notAFiniteNumber(time));
-        return;
-    }
     if (m_mediaController) {
         exceptionState.throwDOMException(InvalidStateError, "The element is slaved to a MediaController.");
         return;
@@ -1929,17 +1924,13 @@
     return m_defaultPlaybackRate;
 }
 
-void HTMLMediaElement::setDefaultPlaybackRate(double rate, ExceptionState& exceptionState)
+void HTMLMediaElement::setDefaultPlaybackRate(double rate)
 {
-    // FIXME: generated bindings should check isfinite: http://crbug.com/354298
-    if (!std::isfinite(rate)) {
-        exceptionState.throwTypeError(ExceptionMessages::notAFiniteNumber(rate));
+    if (m_defaultPlaybackRate == rate)
         return;
-    }
-    if (m_defaultPlaybackRate != rate) {
-        m_defaultPlaybackRate = rate;
-        scheduleEvent(EventTypeNames::ratechange);
-    }
+
+    m_defaultPlaybackRate = rate;
+    scheduleEvent(EventTypeNames::ratechange);
 }
 
 double HTMLMediaElement::playbackRate() const
@@ -1947,16 +1938,10 @@
     return m_playbackRate;
 }
 
-void HTMLMediaElement::setPlaybackRate(double rate, ExceptionState& exceptionState)
+void HTMLMediaElement::setPlaybackRate(double rate)
 {
     WTF_LOG(Media, "HTMLMediaElement::setPlaybackRate(%f)", rate);
 
-    // FIXME: generated bindings should check isfinite: http://crbug.com/354298
-    if (!std::isfinite(rate)) {
-        exceptionState.throwTypeError(ExceptionMessages::notAFiniteNumber(rate));
-        return;
-    }
-
     if (m_playbackRate != rate) {
         m_playbackRate = rate;
         invalidateCachedTime();
@@ -2121,22 +2106,17 @@
 {
     WTF_LOG(Media, "HTMLMediaElement::setVolume(%f)", vol);
 
-    // FIXME: generated bindings should check isfinite: http://crbug.com/354298
-    if (!std::isfinite(vol)) {
-        exceptionState.throwTypeError(ExceptionMessages::notAFiniteNumber(vol));
+    if (m_volume == vol)
         return;
-    }
 
     if (vol < 0.0f || vol > 1.0f) {
         exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::indexOutsideRange("volume", vol, 0.0, ExceptionMessages::InclusiveBound, 1.0, ExceptionMessages::InclusiveBound));
         return;
     }
 
-    if (m_volume != vol) {
-        m_volume = vol;
-        updateVolume();
-        scheduleEvent(EventTypeNames::volumechange);
-    }
+    m_volume = vol;
+    updateVolume();
+    scheduleEvent(EventTypeNames::volumechange);
 }
 
 bool HTMLMediaElement::muted() const
@@ -2562,8 +2542,8 @@
 {
     // Stash the current <source> node and next nodes so we can restore them after checking
     // to see there is another potential.
-    RefPtr<HTMLSourceElement> currentSourceNode = m_currentSourceNode;
-    RefPtr<Node> nextNode = m_nextChildNodeToConsider;
+    RefPtrWillBeRawPtr<HTMLSourceElement> currentSourceNode = m_currentSourceNode;
+    RefPtrWillBeRawPtr<Node> nextNode = m_nextChildNodeToConsider;
 
     KURL nextURL = selectNextSourceChild(0, 0, DoNothing);
 
@@ -3610,7 +3590,7 @@
 
     // If either of the layers is null we need to enable or disable compositing. This is done by triggering a style recalc.
     if (!m_webLayer || !webLayer)
-        scheduleLayerUpdate();
+        setNeedsCompositingUpdate();
 
     if (m_webLayer)
         GraphicsLayer::unregisterContentsLayer(m_webLayer);
@@ -3632,9 +3612,11 @@
 
 void HTMLMediaElement::trace(Visitor* visitor)
 {
+    visitor->trace(m_currentSourceNode);
+    visitor->trace(m_nextChildNodeToConsider);
     visitor->trace(m_textTracks);
     visitor->trace(m_textTracksWhenResourceSelectionBegan);
-    Supplementable<HTMLMediaElement>::trace(visitor);
+    WillBeHeapSupplementable<HTMLMediaElement>::trace(visitor);
     HTMLElement::trace(visitor);
 }
 
diff --git a/Source/core/html/HTMLMediaElement.h b/Source/core/html/HTMLMediaElement.h
index 9dd0c34..4dd5bf2 100644
--- a/Source/core/html/HTMLMediaElement.h
+++ b/Source/core/html/HTMLMediaElement.h
@@ -70,8 +70,9 @@
 // But it can't be until the Chromium WebMediaPlayerClientImpl class is fixed so it
 // no longer depends on typecasting a MediaPlayerClient to an HTMLMediaElement.
 
-class HTMLMediaElement : public HTMLElement, public Supplementable<HTMLMediaElement>, public MediaPlayerClient, public ActiveDOMObject
+class HTMLMediaElement : public HTMLElement, public WillBeHeapSupplementable<HTMLMediaElement>, public MediaPlayerClient, public ActiveDOMObject
 {
+    WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(HTMLMediaElement);
 public:
     static blink::WebMimeRegistry::SupportsType supportsType(const ContentType&, const String& keySystem = String());
 
@@ -129,9 +130,9 @@
     double duration() const;
     bool paused() const;
     double defaultPlaybackRate() const;
-    void setDefaultPlaybackRate(double, ExceptionState&);
+    void setDefaultPlaybackRate(double);
     double playbackRate() const;
-    void setPlaybackRate(double, ExceptionState&);
+    void setPlaybackRate(double);
     void updatePlaybackRate();
     PassRefPtr<TimeRanges> played();
     PassRefPtr<TimeRanges> seekable() const;
@@ -450,8 +451,8 @@
     // Loading state.
     enum LoadState { WaitingForSource, LoadingFromSrcAttr, LoadingFromSourceElement };
     LoadState m_loadState;
-    RefPtr<HTMLSourceElement> m_currentSourceNode;
-    RefPtr<Node> m_nextChildNodeToConsider;
+    RefPtrWillBeMember<HTMLSourceElement> m_currentSourceNode;
+    RefPtrWillBeMember<Node> m_nextChildNodeToConsider;
 
     OwnPtr<MediaPlayer> m_player;
     blink::WebLayer* m_webLayer;
diff --git a/Source/core/html/HTMLMediaElement.idl b/Source/core/html/HTMLMediaElement.idl
index ccc6939..d505be7 100644
--- a/Source/core/html/HTMLMediaElement.idl
+++ b/Source/core/html/HTMLMediaElement.idl
@@ -26,6 +26,7 @@
 [
     ActiveDOMObject,
     RuntimeEnabled=Media,
+    TypeChecking=Unrestricted,
 ] interface HTMLMediaElement : HTMLElement {
 
     // error state
@@ -57,12 +58,11 @@
     readonly attribute boolean seeking;
 
     // playback state
-    // FIXME: generated bindings should check isfinite: http://crbug.com/354298
     [RaisesException=Setter] attribute double currentTime;
     readonly attribute unrestricted double duration;
     readonly attribute boolean paused;
-    [RaisesException=Setter] attribute double defaultPlaybackRate;
-    [RaisesException=Setter] attribute double playbackRate;
+    attribute double defaultPlaybackRate;
+    attribute double playbackRate;
     readonly attribute TimeRanges played;
     readonly attribute TimeRanges seekable;
     readonly attribute boolean ended;
diff --git a/Source/core/html/HTMLMenuElement.cpp b/Source/core/html/HTMLMenuElement.cpp
index 2783c04..e043ed5 100644
--- a/Source/core/html/HTMLMenuElement.cpp
+++ b/Source/core/html/HTMLMenuElement.cpp
@@ -35,9 +35,9 @@
     ScriptWrappable::init(this);
 }
 
-PassRefPtr<HTMLMenuElement> HTMLMenuElement::create(Document& document)
+PassRefPtrWillBeRawPtr<HTMLMenuElement> HTMLMenuElement::create(Document& document)
 {
-    return adoptRef(new HTMLMenuElement(document));
+    return adoptRefWillBeRefCountedGarbageCollected(new HTMLMenuElement(document));
 }
 
 }
diff --git a/Source/core/html/HTMLMenuElement.h b/Source/core/html/HTMLMenuElement.h
index b1fdab6..07350e2 100644
--- a/Source/core/html/HTMLMenuElement.h
+++ b/Source/core/html/HTMLMenuElement.h
@@ -29,7 +29,7 @@
 
 class HTMLMenuElement FINAL : public HTMLElement {
 public:
-    static PassRefPtr<HTMLMenuElement> create(Document&);
+    static PassRefPtrWillBeRawPtr<HTMLMenuElement> create(Document&);
 
 private:
     explicit HTMLMenuElement(Document&);
diff --git a/Source/core/html/HTMLMetaElement-in.cpp b/Source/core/html/HTMLMetaElement-in.cpp
index d70f656..fd9e353 100644
--- a/Source/core/html/HTMLMetaElement-in.cpp
+++ b/Source/core/html/HTMLMetaElement-in.cpp
@@ -51,9 +51,9 @@
     ScriptWrappable::init(this);
 }
 
-PassRefPtr<HTMLMetaElement> HTMLMetaElement::create(Document& document)
+PassRefPtrWillBeRawPtr<HTMLMetaElement> HTMLMetaElement::create(Document& document)
 {
-    return adoptRef(new HTMLMetaElement(document));
+    return adoptRefWillBeRefCountedGarbageCollected(new HTMLMetaElement(document));
 }
 
 static bool isInvalidSeparator(UChar c)
diff --git a/Source/core/html/HTMLMetaElement.h b/Source/core/html/HTMLMetaElement.h
index 11490c7..e87b20d 100644
--- a/Source/core/html/HTMLMetaElement.h
+++ b/Source/core/html/HTMLMetaElement.h
@@ -37,7 +37,7 @@
 
 class HTMLMetaElement FINAL : public HTMLElement {
 public:
-    static PassRefPtr<HTMLMetaElement> create(Document&);
+    static PassRefPtrWillBeRawPtr<HTMLMetaElement> create(Document&);
 
     const AtomicString& content() const;
     const AtomicString& httpEquiv() const;
diff --git a/Source/core/html/HTMLMeterElement.cpp b/Source/core/html/HTMLMeterElement.cpp
index aabfb42..e990133 100644
--- a/Source/core/html/HTMLMeterElement.cpp
+++ b/Source/core/html/HTMLMeterElement.cpp
@@ -47,11 +47,11 @@
 {
 }
 
-PassRefPtr<HTMLMeterElement> HTMLMeterElement::create(Document& document)
+PassRefPtrWillBeRawPtr<HTMLMeterElement> HTMLMeterElement::create(Document& document)
 {
-    RefPtr<HTMLMeterElement> meter = adoptRef(new HTMLMeterElement(document));
+    RefPtrWillBeRawPtr<HTMLMeterElement> meter = adoptRefWillBeRefCountedGarbageCollected(new HTMLMeterElement(document));
     meter->ensureUserAgentShadowRoot();
-    return meter;
+    return meter.release();
 }
 
 RenderObject* HTMLMeterElement::createRenderer(RenderStyle* style)
@@ -70,17 +70,24 @@
         LabelableElement::parseAttribute(name, value);
 }
 
+double HTMLMeterElement::value() const
+{
+    double value = getFloatingPointAttribute(valueAttr, 0);
+    return std::min(std::max(value, min()), max());
+}
+
+void HTMLMeterElement::setValue(double value)
+{
+    setFloatingPointAttribute(valueAttr, value);
+}
+
 double HTMLMeterElement::min() const
 {
     return getFloatingPointAttribute(minAttr, 0);
 }
 
-void HTMLMeterElement::setMin(double min, ExceptionState& exceptionState)
+void HTMLMeterElement::setMin(double min)
 {
-    if (!std::isfinite(min)) {
-        exceptionState.throwTypeError(ExceptionMessages::notAFiniteNumber(min));
-        return;
-    }
     setFloatingPointAttribute(minAttr, min);
 }
 
@@ -89,42 +96,19 @@
     return std::max(getFloatingPointAttribute(maxAttr, std::max(1.0, min())), min());
 }
 
-void HTMLMeterElement::setMax(double max, ExceptionState& exceptionState)
+void HTMLMeterElement::setMax(double max)
 {
-    if (!std::isfinite(max)) {
-        exceptionState.throwTypeError(ExceptionMessages::notAFiniteNumber(max));
-        return;
-    }
     setFloatingPointAttribute(maxAttr, max);
 }
 
-double HTMLMeterElement::value() const
-{
-    double value = getFloatingPointAttribute(valueAttr, 0);
-    return std::min(std::max(value, min()), max());
-}
-
-void HTMLMeterElement::setValue(double value, ExceptionState& exceptionState)
-{
-    if (!std::isfinite(value)) {
-        exceptionState.throwTypeError(ExceptionMessages::notAFiniteNumber(value));
-        return;
-    }
-    setFloatingPointAttribute(valueAttr, value);
-}
-
 double HTMLMeterElement::low() const
 {
     double low = getFloatingPointAttribute(lowAttr, min());
     return std::min(std::max(low, min()), max());
 }
 
-void HTMLMeterElement::setLow(double low, ExceptionState& exceptionState)
+void HTMLMeterElement::setLow(double low)
 {
-    if (!std::isfinite(low)) {
-        exceptionState.throwTypeError(ExceptionMessages::notAFiniteNumber(low));
-        return;
-    }
     setFloatingPointAttribute(lowAttr, low);
 }
 
@@ -134,12 +118,8 @@
     return std::min(std::max(high, low()), max());
 }
 
-void HTMLMeterElement::setHigh(double high, ExceptionState& exceptionState)
+void HTMLMeterElement::setHigh(double high)
 {
-    if (!std::isfinite(high)) {
-        exceptionState.throwTypeError(ExceptionMessages::notAFiniteNumber(high));
-        return;
-    }
     setFloatingPointAttribute(highAttr, high);
 }
 
@@ -149,12 +129,8 @@
     return std::min(std::max(optimum, min()), max());
 }
 
-void HTMLMeterElement::setOptimum(double optimum, ExceptionState& exceptionState)
+void HTMLMeterElement::setOptimum(double optimum)
 {
-    if (!std::isfinite(optimum)) {
-        exceptionState.throwTypeError(ExceptionMessages::notAFiniteNumber(optimum));
-        return;
-    }
     setFloatingPointAttribute(optimumAttr, optimum);
 }
 
@@ -235,4 +211,10 @@
     inner->appendChild(bar);
 }
 
+void HTMLMeterElement::trace(Visitor* visitor)
+{
+    visitor->trace(m_value);
+    LabelableElement::trace(visitor);
+}
+
 } // namespace
diff --git a/Source/core/html/HTMLMeterElement.h b/Source/core/html/HTMLMeterElement.h
index b92860a..44d9e6f 100644
--- a/Source/core/html/HTMLMeterElement.h
+++ b/Source/core/html/HTMLMeterElement.h
@@ -31,7 +31,7 @@
 
 class HTMLMeterElement FINAL : public LabelableElement {
 public:
-    static PassRefPtr<HTMLMeterElement> create(Document&);
+    static PassRefPtrWillBeRawPtr<HTMLMeterElement> create(Document&);
 
     enum GaugeRegion {
         GaugeRegionOptimum,
@@ -39,29 +39,31 @@
         GaugeRegionEvenLessGood
     };
 
+    double value() const;
+    void setValue(double);
+
     double min() const;
-    void setMin(double, ExceptionState&);
+    void setMin(double);
 
     double max() const;
-    void setMax(double, ExceptionState&);
-
-    double value() const;
-    void setValue(double, ExceptionState&);
+    void setMax(double);
 
     double low() const;
-    void setLow(double, ExceptionState&);
+    void setLow(double);
 
     double high() const;
-    void setHigh(double, ExceptionState&);
+    void setHigh(double);
 
     double optimum() const;
-    void setOptimum(double, ExceptionState&);
+    void setOptimum(double);
 
     double valueRatio() const;
     GaugeRegion gaugeRegion() const;
 
     virtual bool canContainRangeEndPoint() const OVERRIDE { return false; }
 
+    virtual void trace(Visitor*) OVERRIDE;
+
 private:
     explicit HTMLMeterElement(Document&);
     virtual ~HTMLMeterElement();
@@ -77,7 +79,7 @@
     void didElementStateChange();
     virtual void didAddUserAgentShadowRoot(ShadowRoot&) OVERRIDE;
 
-    RefPtr<MeterValueElement> m_value;
+    RefPtrWillBeMember<MeterValueElement> m_value;
 };
 
 } // namespace
diff --git a/Source/core/html/HTMLMeterElement.idl b/Source/core/html/HTMLMeterElement.idl
index fde8591..144f83e 100644
--- a/Source/core/html/HTMLMeterElement.idl
+++ b/Source/core/html/HTMLMeterElement.idl
@@ -17,12 +17,16 @@
  * Boston, MA 02110-1301, USA.
  */
 
-interface HTMLMeterElement : HTMLElement {
-             [RaisesException=Setter] attribute double value;
-             [RaisesException=Setter] attribute double min;
-             [RaisesException=Setter] attribute double max;
-             [RaisesException=Setter] attribute double low;
-             [RaisesException=Setter] attribute double high;
-             [RaisesException=Setter] attribute double optimum;
+// http://www.whatwg.org/specs/web-apps/current-work/multipage/the-button-element.html#htmlmeterelement
+
+[
+    TypeChecking=Unrestricted,
+] interface HTMLMeterElement : HTMLElement {
+             attribute double value;
+             attribute double min;
+             attribute double max;
+             attribute double low;
+             attribute double high;
+             attribute double optimum;
     readonly attribute NodeList labels;
 };
diff --git a/Source/core/html/HTMLModElement.cpp b/Source/core/html/HTMLModElement.cpp
index 2d99964..fa75f27 100644
--- a/Source/core/html/HTMLModElement.cpp
+++ b/Source/core/html/HTMLModElement.cpp
@@ -35,9 +35,9 @@
     ScriptWrappable::init(this);
 }
 
-PassRefPtr<HTMLModElement> HTMLModElement::create(const QualifiedName& tagName, Document& document)
+PassRefPtrWillBeRawPtr<HTMLModElement> HTMLModElement::create(const QualifiedName& tagName, Document& document)
 {
-    return adoptRef(new HTMLModElement(tagName, document));
+    return adoptRefWillBeRefCountedGarbageCollected(new HTMLModElement(tagName, document));
 }
 
 bool HTMLModElement::isURLAttribute(const Attribute& attribute) const
diff --git a/Source/core/html/HTMLModElement.h b/Source/core/html/HTMLModElement.h
index 41a46dd..8cacbc4 100644
--- a/Source/core/html/HTMLModElement.h
+++ b/Source/core/html/HTMLModElement.h
@@ -30,7 +30,7 @@
 
 class HTMLModElement FINAL : public HTMLElement {
 public:
-    static PassRefPtr<HTMLModElement> create(const QualifiedName&, Document&);
+    static PassRefPtrWillBeRawPtr<HTMLModElement> create(const QualifiedName&, Document&);
 
 private:
     HTMLModElement(const QualifiedName&, Document&);
diff --git a/Source/core/html/HTMLNoEmbedElement.cpp b/Source/core/html/HTMLNoEmbedElement.cpp
index 417c416..f7b0940 100644
--- a/Source/core/html/HTMLNoEmbedElement.cpp
+++ b/Source/core/html/HTMLNoEmbedElement.cpp
@@ -44,9 +44,9 @@
 {
 }
 
-PassRefPtr<HTMLNoEmbedElement> HTMLNoEmbedElement::create(Document& document)
+PassRefPtrWillBeRawPtr<HTMLNoEmbedElement> HTMLNoEmbedElement::create(Document& document)
 {
-    return adoptRef(new HTMLNoEmbedElement(document));
+    return adoptRefWillBeRefCountedGarbageCollected(new HTMLNoEmbedElement(document));
 }
 
 bool HTMLNoEmbedElement::rendererIsNeeded(const RenderStyle& style)
diff --git a/Source/core/html/HTMLNoEmbedElement.h b/Source/core/html/HTMLNoEmbedElement.h
index 9c5ae7f..d2c04a9 100644
--- a/Source/core/html/HTMLNoEmbedElement.h
+++ b/Source/core/html/HTMLNoEmbedElement.h
@@ -39,7 +39,7 @@
 // so HTMLElement's rendererIsNeeded doesn't need to know about it.
 class HTMLNoEmbedElement FINAL : public HTMLElement {
 public:
-    static PassRefPtr<HTMLNoEmbedElement> create(Document&);
+    static PassRefPtrWillBeRawPtr<HTMLNoEmbedElement> create(Document&);
 
 private:
     explicit HTMLNoEmbedElement(Document&);
diff --git a/Source/core/html/HTMLNoScriptElement.cpp b/Source/core/html/HTMLNoScriptElement.cpp
index f8982db..f851914 100644
--- a/Source/core/html/HTMLNoScriptElement.cpp
+++ b/Source/core/html/HTMLNoScriptElement.cpp
@@ -44,9 +44,9 @@
 {
 }
 
-PassRefPtr<HTMLNoScriptElement> HTMLNoScriptElement::create(Document& document)
+PassRefPtrWillBeRawPtr<HTMLNoScriptElement> HTMLNoScriptElement::create(Document& document)
 {
-    return adoptRef(new HTMLNoScriptElement(document));
+    return adoptRefWillBeRefCountedGarbageCollected(new HTMLNoScriptElement(document));
 }
 
 bool HTMLNoScriptElement::rendererIsNeeded(const RenderStyle& style)
diff --git a/Source/core/html/HTMLNoScriptElement.h b/Source/core/html/HTMLNoScriptElement.h
index cbf8e75..f391a77 100644
--- a/Source/core/html/HTMLNoScriptElement.h
+++ b/Source/core/html/HTMLNoScriptElement.h
@@ -39,7 +39,7 @@
 // so HTMLElement's rendererIsNeeded doesn't need to know about it.
 class HTMLNoScriptElement FINAL : public HTMLElement {
 public:
-    static PassRefPtr<HTMLNoScriptElement> create(Document&);
+    static PassRefPtrWillBeRawPtr<HTMLNoScriptElement> create(Document&);
 
 private:
     explicit HTMLNoScriptElement(Document&);
diff --git a/Source/core/html/HTMLOListElement.cpp b/Source/core/html/HTMLOListElement.cpp
index f13880c..ba6934c 100644
--- a/Source/core/html/HTMLOListElement.cpp
+++ b/Source/core/html/HTMLOListElement.cpp
@@ -43,9 +43,9 @@
     ScriptWrappable::init(this);
 }
 
-PassRefPtr<HTMLOListElement> HTMLOListElement::create(Document& document)
+PassRefPtrWillBeRawPtr<HTMLOListElement> HTMLOListElement::create(Document& document)
 {
-    return adoptRef(new HTMLOListElement(document));
+    return adoptRefWillBeRefCountedGarbageCollected(new HTMLOListElement(document));
 }
 
 bool HTMLOListElement::isPresentationAttribute(const QualifiedName& name) const
diff --git a/Source/core/html/HTMLOListElement.h b/Source/core/html/HTMLOListElement.h
index dfd7953..eb592da 100644
--- a/Source/core/html/HTMLOListElement.h
+++ b/Source/core/html/HTMLOListElement.h
@@ -29,7 +29,7 @@
 
 class HTMLOListElement FINAL : public HTMLElement {
 public:
-    static PassRefPtr<HTMLOListElement> create(Document&);
+    static PassRefPtrWillBeRawPtr<HTMLOListElement> create(Document&);
 
     int start() const { return m_hasExplicitStart ? m_start : (m_isReversed ? itemCount() : 1); }
     void setStart(int);
diff --git a/Source/core/html/HTMLObjectElement.cpp b/Source/core/html/HTMLObjectElement.cpp
index c92d62c..a719410 100644
--- a/Source/core/html/HTMLObjectElement.cpp
+++ b/Source/core/html/HTMLObjectElement.cpp
@@ -63,13 +63,19 @@
 #endif
 }
 
-PassRefPtr<HTMLObjectElement> HTMLObjectElement::create(Document& document, HTMLFormElement* form, bool createdByParser)
+PassRefPtrWillBeRawPtr<HTMLObjectElement> HTMLObjectElement::create(Document& document, HTMLFormElement* form, bool createdByParser)
 {
-    RefPtr<HTMLObjectElement> element = adoptRef(new HTMLObjectElement(document, form, createdByParser));
+    RefPtrWillBeRawPtr<HTMLObjectElement> element = adoptRefWillBeRefCountedGarbageCollected(new HTMLObjectElement(document, form, createdByParser));
     element->ensureUserAgentShadowRoot();
     return element.release();
 }
 
+void HTMLObjectElement::trace(Visitor* visitor)
+{
+    FormAssociatedElement::trace(visitor);
+    HTMLPlugInElement::trace(visitor);
+}
+
 RenderWidget* HTMLObjectElement::existingRenderWidget() const
 {
     return renderPart(); // This will return 0 if the renderer is not a RenderPart.
diff --git a/Source/core/html/HTMLObjectElement.h b/Source/core/html/HTMLObjectElement.h
index 6a917ad..24b25fb 100644
--- a/Source/core/html/HTMLObjectElement.h
+++ b/Source/core/html/HTMLObjectElement.h
@@ -31,9 +31,12 @@
 class HTMLFormElement;
 
 class HTMLObjectElement FINAL : public HTMLPlugInElement, public FormAssociatedElement {
+    WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(HTMLObjectElement);
+
 public:
-    static PassRefPtr<HTMLObjectElement> create(Document&, HTMLFormElement*, bool createdByParser);
+    static PassRefPtrWillBeRawPtr<HTMLObjectElement> create(Document&, HTMLFormElement*, bool createdByParser);
     virtual ~HTMLObjectElement();
+    virtual void trace(Visitor*) OVERRIDE;
 
     const String& classId() const { return m_classId; }
 
@@ -103,8 +106,10 @@
 
     void reloadPluginOnAttributeChange(const QualifiedName&);
 
+#if !ENABLE(OILPAN)
     virtual void refFormAssociatedElement() OVERRIDE { ref(); }
     virtual void derefFormAssociatedElement() OVERRIDE { deref(); }
+#endif
 
     virtual bool shouldRegisterAsNamedItem() const OVERRIDE { return true; }
     virtual bool shouldRegisterAsExtraNamedItem() const OVERRIDE { return true; }
diff --git a/Source/core/html/HTMLOptGroupElement.cpp b/Source/core/html/HTMLOptGroupElement.cpp
index 8725226..3ee53d6 100644
--- a/Source/core/html/HTMLOptGroupElement.cpp
+++ b/Source/core/html/HTMLOptGroupElement.cpp
@@ -42,9 +42,9 @@
     ScriptWrappable::init(this);
 }
 
-PassRefPtr<HTMLOptGroupElement> HTMLOptGroupElement::create(Document& document)
+PassRefPtrWillBeRawPtr<HTMLOptGroupElement> HTMLOptGroupElement::create(Document& document)
 {
-    return adoptRef(new HTMLOptGroupElement(document));
+    return adoptRefWillBeRefCountedGarbageCollected(new HTMLOptGroupElement(document));
 }
 
 bool HTMLOptGroupElement::isDisabledFormControl() const
diff --git a/Source/core/html/HTMLOptGroupElement.h b/Source/core/html/HTMLOptGroupElement.h
index 0c6fe30..1353bb5 100644
--- a/Source/core/html/HTMLOptGroupElement.h
+++ b/Source/core/html/HTMLOptGroupElement.h
@@ -32,7 +32,7 @@
 
 class HTMLOptGroupElement FINAL : public HTMLElement {
 public:
-    static PassRefPtr<HTMLOptGroupElement> create(Document&);
+    static PassRefPtrWillBeRawPtr<HTMLOptGroupElement> create(Document&);
 
     virtual bool isDisabledFormControl() const OVERRIDE;
     HTMLSelectElement* ownerSelectElement() const;
diff --git a/Source/core/html/HTMLOptionElement.cpp b/Source/core/html/HTMLOptionElement.cpp
index 278fa75..5311478 100644
--- a/Source/core/html/HTMLOptionElement.cpp
+++ b/Source/core/html/HTMLOptionElement.cpp
@@ -54,15 +54,15 @@
     ScriptWrappable::init(this);
 }
 
-PassRefPtr<HTMLOptionElement> HTMLOptionElement::create(Document& document)
+PassRefPtrWillBeRawPtr<HTMLOptionElement> HTMLOptionElement::create(Document& document)
 {
-    return adoptRef(new HTMLOptionElement(document));
+    return adoptRefWillBeRefCountedGarbageCollected(new HTMLOptionElement(document));
 }
 
-PassRefPtr<HTMLOptionElement> HTMLOptionElement::createForJSConstructor(Document& document, const String& data, const AtomicString& value,
+PassRefPtrWillBeRawPtr<HTMLOptionElement> HTMLOptionElement::createForJSConstructor(Document& document, const String& data, const AtomicString& value,
     bool defaultSelected, bool selected, ExceptionState& exceptionState)
 {
-    RefPtr<HTMLOptionElement> element = adoptRef(new HTMLOptionElement(document));
+    RefPtrWillBeRawPtr<HTMLOptionElement> element = adoptRefWillBeRefCountedGarbageCollected(new HTMLOptionElement(document));
 
     RefPtr<Text> text = Text::create(document, data.isNull() ? "" : data);
 
@@ -129,7 +129,7 @@
     // Changing the text causes a recalc of a select's items, which will reset the selected
     // index to the first item if the select is single selection with a menu list. We attempt to
     // preserve the selected item.
-    RefPtr<HTMLSelectElement> select = ownerSelectElement();
+    RefPtrWillBeRawPtr<HTMLSelectElement> select = ownerSelectElement();
     bool selectIsMenuList = select && select->usesMenuList();
     int oldSelectedIndex = selectIsMenuList ? select->selectedIndex() : -1;
 
diff --git a/Source/core/html/HTMLOptionElement.h b/Source/core/html/HTMLOptionElement.h
index 5466e1a..65e1a23 100644
--- a/Source/core/html/HTMLOptionElement.h
+++ b/Source/core/html/HTMLOptionElement.h
@@ -35,8 +35,8 @@
 
 class HTMLOptionElement FINAL : public HTMLElement {
 public:
-    static PassRefPtr<HTMLOptionElement> create(Document&);
-    static PassRefPtr<HTMLOptionElement> createForJSConstructor(Document&, const String& data, const AtomicString& value,
+    static PassRefPtrWillBeRawPtr<HTMLOptionElement> create(Document&);
+    static PassRefPtrWillBeRawPtr<HTMLOptionElement> createForJSConstructor(Document&, const String& data, const AtomicString& value,
         bool defaultSelected, bool selected, ExceptionState&);
 
     String text() const;
diff --git a/Source/core/html/HTMLOptionsCollection.idl b/Source/core/html/HTMLOptionsCollection.idl
index 492c604..a802b20 100644
--- a/Source/core/html/HTMLOptionsCollection.idl
+++ b/Source/core/html/HTMLOptionsCollection.idl
@@ -33,5 +33,5 @@
 
     [Custom, RaisesException] void add([Default=Undefined] optional HTMLOptionElement option, optional unsigned long index);
     void remove(unsigned long index);
-    void remove(HTMLOptionElement option);  // non-standard
+    [MeasureAs=HTMLOptionsCollectionRemoveElement] void remove(HTMLOptionElement option); // non-standard
 };
diff --git a/Source/core/html/HTMLOutputElement.cpp b/Source/core/html/HTMLOutputElement.cpp
index 4223ba4..0300a0f 100644
--- a/Source/core/html/HTMLOutputElement.cpp
+++ b/Source/core/html/HTMLOutputElement.cpp
@@ -45,9 +45,9 @@
     ScriptWrappable::init(this);
 }
 
-PassRefPtr<HTMLOutputElement> HTMLOutputElement::create(Document& document, HTMLFormElement* form)
+PassRefPtrWillBeRawPtr<HTMLOutputElement> HTMLOutputElement::create(Document& document, HTMLFormElement* form)
 {
-    return adoptRef(new HTMLOutputElement(document, form));
+    return adoptRefWillBeRefCountedGarbageCollected(new HTMLOutputElement(document, form));
 }
 
 const AtomicString& HTMLOutputElement::formControlType() const
@@ -128,4 +128,11 @@
         setTextContent(value);
 }
 
+
+void HTMLOutputElement::trace(Visitor* visitor)
+{
+    visitor->trace(m_tokens);
+    HTMLFormControlElement::trace(visitor);
+}
+
 } // namespace
diff --git a/Source/core/html/HTMLOutputElement.h b/Source/core/html/HTMLOutputElement.h
index ba77d11..d554341 100644
--- a/Source/core/html/HTMLOutputElement.h
+++ b/Source/core/html/HTMLOutputElement.h
@@ -38,7 +38,7 @@
 
 class HTMLOutputElement FINAL : public HTMLFormControlElement {
 public:
-    static PassRefPtr<HTMLOutputElement> create(Document&, HTMLFormElement*);
+    static PassRefPtrWillBeRawPtr<HTMLOutputElement> create(Document&, HTMLFormElement*);
 
     virtual bool willValidate() const OVERRIDE { return false; }
 
@@ -51,6 +51,8 @@
 
     virtual bool canContainRangeEndPoint() const OVERRIDE { return false; }
 
+    virtual void trace(Visitor*) OVERRIDE;
+
 private:
     HTMLOutputElement(Document&, HTMLFormElement*);
 
@@ -64,7 +66,7 @@
 
     bool m_isDefaultValueMode;
     String m_defaultValue;
-    RefPtr<DOMSettableTokenList> m_tokens;
+    RefPtrWillBeMember<DOMSettableTokenList> m_tokens;
 };
 
 } // namespace
diff --git a/Source/core/html/HTMLParagraphElement.cpp b/Source/core/html/HTMLParagraphElement.cpp
index 6c6e643..b2d465d 100644
--- a/Source/core/html/HTMLParagraphElement.cpp
+++ b/Source/core/html/HTMLParagraphElement.cpp
@@ -37,9 +37,9 @@
     ScriptWrappable::init(this);
 }
 
-PassRefPtr<HTMLParagraphElement> HTMLParagraphElement::create(Document& document)
+PassRefPtrWillBeRawPtr<HTMLParagraphElement> HTMLParagraphElement::create(Document& document)
 {
-    return adoptRef(new HTMLParagraphElement(document));
+    return adoptRefWillBeRefCountedGarbageCollected(new HTMLParagraphElement(document));
 }
 
 void HTMLParagraphElement::collectStyleForPresentationAttribute(const QualifiedName& name, const AtomicString& value, MutableStylePropertySet* style)
diff --git a/Source/core/html/HTMLParagraphElement.h b/Source/core/html/HTMLParagraphElement.h
index ac83f03..a9fa0f1 100644
--- a/Source/core/html/HTMLParagraphElement.h
+++ b/Source/core/html/HTMLParagraphElement.h
@@ -29,7 +29,7 @@
 
 class HTMLParagraphElement FINAL : public HTMLElement {
 public:
-    static PassRefPtr<HTMLParagraphElement> create(Document&);
+    static PassRefPtrWillBeRawPtr<HTMLParagraphElement> create(Document&);
 
 private:
     explicit HTMLParagraphElement(Document&);
diff --git a/Source/core/html/HTMLParamElement.cpp b/Source/core/html/HTMLParamElement.cpp
index a16e5cd..e8d6d6f 100644
--- a/Source/core/html/HTMLParamElement.cpp
+++ b/Source/core/html/HTMLParamElement.cpp
@@ -37,9 +37,9 @@
     ScriptWrappable::init(this);
 }
 
-PassRefPtr<HTMLParamElement> HTMLParamElement::create(Document& document)
+PassRefPtrWillBeRawPtr<HTMLParamElement> HTMLParamElement::create(Document& document)
 {
-    return adoptRef(new HTMLParamElement(document));
+    return adoptRefWillBeRefCountedGarbageCollected(new HTMLParamElement(document));
 }
 
 const AtomicString& HTMLParamElement::name() const
diff --git a/Source/core/html/HTMLParamElement.h b/Source/core/html/HTMLParamElement.h
index b34e4ed..1140b2b 100644
--- a/Source/core/html/HTMLParamElement.h
+++ b/Source/core/html/HTMLParamElement.h
@@ -29,7 +29,7 @@
 
 class HTMLParamElement FINAL : public HTMLElement {
 public:
-    static PassRefPtr<HTMLParamElement> create(Document&);
+    static PassRefPtrWillBeRawPtr<HTMLParamElement> create(Document&);
 
     const AtomicString& name() const;
     const AtomicString& value() const;
diff --git a/Source/core/html/HTMLPictureElement.cpp b/Source/core/html/HTMLPictureElement.cpp
new file mode 100644
index 0000000..ebf7f21
--- /dev/null
+++ b/Source/core/html/HTMLPictureElement.cpp
@@ -0,0 +1,25 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "config.h"
+#include "core/html/HTMLPictureElement.h"
+
+#include "HTMLNames.h"
+
+namespace WebCore {
+
+using namespace HTMLNames;
+
+HTMLPictureElement::HTMLPictureElement(Document& document)
+    : HTMLElement(pictureTag, document)
+{
+    ScriptWrappable::init(this);
+}
+
+PassRefPtr<HTMLPictureElement> HTMLPictureElement::create(Document& document)
+{
+    return adoptRef(new HTMLPictureElement(document));
+}
+
+} // namespace
diff --git a/Source/core/html/HTMLPictureElement.h b/Source/core/html/HTMLPictureElement.h
new file mode 100644
index 0000000..0ec61ad
--- /dev/null
+++ b/Source/core/html/HTMLPictureElement.h
@@ -0,0 +1,22 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef HTMLPictureElement_h
+#define HTMLPictureElement_h
+
+#include "core/html/HTMLElement.h"
+
+namespace WebCore {
+
+class HTMLPictureElement FINAL : public HTMLElement {
+public:
+    static PassRefPtr<HTMLPictureElement> create(Document&);
+
+protected:
+    explicit HTMLPictureElement(Document&);
+};
+
+} // namespace
+
+#endif
diff --git a/Source/core/html/HTMLPictureElement.idl b/Source/core/html/HTMLPictureElement.idl
new file mode 100644
index 0000000..649316c
--- /dev/null
+++ b/Source/core/html/HTMLPictureElement.idl
@@ -0,0 +1,10 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// http://picture.responsiveimages.org
+[
+    RuntimeEnabled=Picture
+] interface HTMLPictureElement : HTMLElement {
+};
+
diff --git a/Source/core/html/HTMLPreElement.cpp b/Source/core/html/HTMLPreElement.cpp
index 830f015..7f55472 100644
--- a/Source/core/html/HTMLPreElement.cpp
+++ b/Source/core/html/HTMLPreElement.cpp
@@ -27,6 +27,7 @@
 #include "CSSValueKeywords.h"
 #include "HTMLNames.h"
 #include "core/css/StylePropertySet.h"
+#include "core/frame/UseCounter.h"
 
 namespace WebCore {
 
@@ -38,9 +39,9 @@
     ScriptWrappable::init(this);
 }
 
-PassRefPtr<HTMLPreElement> HTMLPreElement::create(const QualifiedName& tagName, Document& document)
+PassRefPtrWillBeRawPtr<HTMLPreElement> HTMLPreElement::create(const QualifiedName& tagName, Document& document)
 {
-    return adoptRef(new HTMLPreElement(tagName, document));
+    return adoptRefWillBeRefCountedGarbageCollected(new HTMLPreElement(tagName, document));
 }
 
 bool HTMLPreElement::isPresentationAttribute(const QualifiedName& name) const
@@ -52,10 +53,12 @@
 
 void HTMLPreElement::collectStyleForPresentationAttribute(const QualifiedName& name, const AtomicString& value, MutableStylePropertySet* style)
 {
-    if (name == wrapAttr)
+    if (name == wrapAttr) {
+        UseCounter::count(document(), UseCounter::HTMLPreElementWrap);
         style->setProperty(CSSPropertyWhiteSpace, CSSValuePreWrap);
-    else
+    } else {
         HTMLElement::collectStyleForPresentationAttribute(name, value, style);
+    }
 }
 
 }
diff --git a/Source/core/html/HTMLPreElement.h b/Source/core/html/HTMLPreElement.h
index 408475f4..89a2565 100644
--- a/Source/core/html/HTMLPreElement.h
+++ b/Source/core/html/HTMLPreElement.h
@@ -29,7 +29,7 @@
 
 class HTMLPreElement FINAL : public HTMLElement {
 public:
-    static PassRefPtr<HTMLPreElement> create(const QualifiedName&, Document&);
+    static PassRefPtrWillBeRawPtr<HTMLPreElement> create(const QualifiedName&, Document&);
 
 private:
     HTMLPreElement(const QualifiedName&, Document&);
diff --git a/Source/core/html/HTMLPreElement.idl b/Source/core/html/HTMLPreElement.idl
index 4c7def6..6224bc9 100644
--- a/Source/core/html/HTMLPreElement.idl
+++ b/Source/core/html/HTMLPreElement.idl
@@ -22,5 +22,5 @@
     [Reflect] attribute long width;
 
     // Extensions
-    [Reflect] attribute boolean wrap;
+    [Reflect, MeasureAs=HTMLPreElementWrap] attribute boolean wrap;
 };
diff --git a/Source/core/html/HTMLProgressElement.cpp b/Source/core/html/HTMLProgressElement.cpp
index e99cc86..2567d1c 100644
--- a/Source/core/html/HTMLProgressElement.cpp
+++ b/Source/core/html/HTMLProgressElement.cpp
@@ -50,9 +50,9 @@
 {
 }
 
-PassRefPtr<HTMLProgressElement> HTMLProgressElement::create(Document& document)
+PassRefPtrWillBeRawPtr<HTMLProgressElement> HTMLProgressElement::create(Document& document)
 {
-    RefPtr<HTMLProgressElement> progress = adoptRef(new HTMLProgressElement(document));
+    RefPtrWillBeRawPtr<HTMLProgressElement> progress = adoptRefWillBeRefCountedGarbageCollected(new HTMLProgressElement(document));
     progress->ensureUserAgentShadowRoot();
     return progress.release();
 }
@@ -95,30 +95,30 @@
 double HTMLProgressElement::value() const
 {
     double value = getFloatingPointAttribute(valueAttr);
+    // Otherwise, if the parsed value was greater than or equal to the maximum
+    // value, then the current value of the progress bar is the maximum value
+    // of the progress bar. Otherwise, if parsing the value attribute's value
+    // resulted in an error, or a number less than or equal to zero, then the
+    // current value of the progress bar is zero.
     return !std::isfinite(value) || value < 0 ? 0 : std::min(value, max());
 }
 
-void HTMLProgressElement::setValue(double value, ExceptionState& exceptionState)
+void HTMLProgressElement::setValue(double value)
 {
-    if (!std::isfinite(value)) {
-        exceptionState.throwTypeError(ExceptionMessages::notAFiniteNumber(value));
-        return;
-    }
     setFloatingPointAttribute(valueAttr, std::max(value, 0.));
 }
 
 double HTMLProgressElement::max() const
 {
     double max = getFloatingPointAttribute(maxAttr);
+    // Otherwise, if the element has no max attribute, or if it has one but
+    // parsing it resulted in an error, or if the parsed value was less than or
+    // equal to zero, then the maximum value of the progress bar is 1.0.
     return !std::isfinite(max) || max <= 0 ? 1 : max;
 }
 
-void HTMLProgressElement::setMax(double max, ExceptionState& exceptionState)
+void HTMLProgressElement::setMax(double max)
 {
-    if (!std::isfinite(max)) {
-        exceptionState.throwTypeError(ExceptionMessages::notAFiniteNumber(max));
-        return;
-    }
     // FIXME: The specification says we should ignore the input value if it is inferior or equal to 0.
     setFloatingPointAttribute(maxAttr, max > 0 ? max : 1);
 }
diff --git a/Source/core/html/HTMLProgressElement.h b/Source/core/html/HTMLProgressElement.h
index b70f26e..ca03502 100644
--- a/Source/core/html/HTMLProgressElement.h
+++ b/Source/core/html/HTMLProgressElement.h
@@ -34,13 +34,13 @@
     static const double IndeterminatePosition;
     static const double InvalidPosition;
 
-    static PassRefPtr<HTMLProgressElement> create(Document&);
+    static PassRefPtrWillBeRawPtr<HTMLProgressElement> create(Document&);
 
     double value() const;
-    void setValue(double, ExceptionState&);
+    void setValue(double);
 
     double max() const;
-    void setMax(double, ExceptionState&);
+    void setMax(double);
 
     double position() const;
 
diff --git a/Source/core/html/HTMLProgressElement.idl b/Source/core/html/HTMLProgressElement.idl
index b2f5a9c..a3da90a 100644
--- a/Source/core/html/HTMLProgressElement.idl
+++ b/Source/core/html/HTMLProgressElement.idl
@@ -17,10 +17,13 @@
  * Boston, MA 02110-1301, USA.
  */
 
-interface HTMLProgressElement : HTMLElement {
-             [RaisesException=Setter] attribute  double                value;
-             [RaisesException=Setter] attribute  double                max;
-    readonly attribute  double                position;
-    readonly attribute  NodeList              labels;
-};
+// http://www.whatwg.org/specs/web-apps/current-work/multipage/the-button-element.html#htmlprogresselement
 
+[
+    TypeChecking=Unrestricted,
+] interface HTMLProgressElement : HTMLElement {
+             attribute double value;
+             attribute double max;
+    readonly attribute double position;
+    readonly attribute NodeList labels;
+};
diff --git a/Source/core/html/HTMLQuoteElement.cpp b/Source/core/html/HTMLQuoteElement.cpp
index f690991..0a6b5c5 100644
--- a/Source/core/html/HTMLQuoteElement.cpp
+++ b/Source/core/html/HTMLQuoteElement.cpp
@@ -38,9 +38,9 @@
     ScriptWrappable::init(this);
 }
 
-PassRefPtr<HTMLQuoteElement> HTMLQuoteElement::create(const QualifiedName& tagName, Document& document)
+PassRefPtrWillBeRawPtr<HTMLQuoteElement> HTMLQuoteElement::create(const QualifiedName& tagName, Document& document)
 {
-    return adoptRef(new HTMLQuoteElement(tagName, document));
+    return adoptRefWillBeRefCountedGarbageCollected(new HTMLQuoteElement(tagName, document));
 }
 
 bool HTMLQuoteElement::isURLAttribute(const Attribute& attribute) const
diff --git a/Source/core/html/HTMLQuoteElement.h b/Source/core/html/HTMLQuoteElement.h
index 09ec799..a8c5994 100644
--- a/Source/core/html/HTMLQuoteElement.h
+++ b/Source/core/html/HTMLQuoteElement.h
@@ -31,7 +31,7 @@
 
 class HTMLQuoteElement FINAL : public HTMLElement {
 public:
-    static PassRefPtr<HTMLQuoteElement> create(const QualifiedName&, Document&);
+    static PassRefPtrWillBeRawPtr<HTMLQuoteElement> create(const QualifiedName&, Document&);
 
 private:
     HTMLQuoteElement(const QualifiedName&, Document&);
diff --git a/Source/core/html/HTMLRTElement.cpp b/Source/core/html/HTMLRTElement.cpp
index 4dcfb7d..345c268 100644
--- a/Source/core/html/HTMLRTElement.cpp
+++ b/Source/core/html/HTMLRTElement.cpp
@@ -17,9 +17,9 @@
 {
 }
 
-PassRefPtr<HTMLRTElement> HTMLRTElement::create(Document& document)
+PassRefPtrWillBeRawPtr<HTMLRTElement> HTMLRTElement::create(Document& document)
 {
-    return adoptRef(new HTMLRTElement(document));
+    return adoptRefWillBeRefCountedGarbageCollected(new HTMLRTElement(document));
 }
 
 RenderObject* HTMLRTElement::createRenderer(RenderStyle* style)
diff --git a/Source/core/html/HTMLRTElement.h b/Source/core/html/HTMLRTElement.h
index 55efc9a..be776d8 100644
--- a/Source/core/html/HTMLRTElement.h
+++ b/Source/core/html/HTMLRTElement.h
@@ -13,7 +13,7 @@
 // so HTMLElement's createRenderer doesn't need to know about it.
 class HTMLRTElement FINAL : public HTMLElement {
 public:
-    static PassRefPtr<HTMLRTElement> create(Document&);
+    static PassRefPtrWillBeRawPtr<HTMLRTElement> create(Document&);
 
 private:
     explicit HTMLRTElement(Document&);
diff --git a/Source/core/html/HTMLRubyElement.cpp b/Source/core/html/HTMLRubyElement.cpp
index 96eb941..b01748b 100644
--- a/Source/core/html/HTMLRubyElement.cpp
+++ b/Source/core/html/HTMLRubyElement.cpp
@@ -17,9 +17,9 @@
 {
 }
 
-PassRefPtr<HTMLRubyElement> HTMLRubyElement::create(Document& document)
+PassRefPtrWillBeRawPtr<HTMLRubyElement> HTMLRubyElement::create(Document& document)
 {
-    return adoptRef(new HTMLRubyElement(document));
+    return adoptRefWillBeRefCountedGarbageCollected(new HTMLRubyElement(document));
 }
 
 RenderObject* HTMLRubyElement::createRenderer(RenderStyle* style)
diff --git a/Source/core/html/HTMLRubyElement.h b/Source/core/html/HTMLRubyElement.h
index d7af56e..7467677 100644
--- a/Source/core/html/HTMLRubyElement.h
+++ b/Source/core/html/HTMLRubyElement.h
@@ -13,7 +13,7 @@
 // so HTMLElement's createRenderer doesn't need to know about it.
 class HTMLRubyElement FINAL : public HTMLElement {
 public:
-    static PassRefPtr<HTMLRubyElement> create(Document&);
+    static PassRefPtrWillBeRawPtr<HTMLRubyElement> create(Document&);
 
 private:
     explicit HTMLRubyElement(Document&);
diff --git a/Source/core/html/HTMLScriptElement.cpp b/Source/core/html/HTMLScriptElement.cpp
index c30f180..62cfe96 100644
--- a/Source/core/html/HTMLScriptElement.cpp
+++ b/Source/core/html/HTMLScriptElement.cpp
@@ -43,9 +43,9 @@
     ScriptWrappable::init(this);
 }
 
-PassRefPtr<HTMLScriptElement> HTMLScriptElement::create(Document& document, bool wasInsertedByParser, bool alreadyStarted)
+PassRefPtrWillBeRawPtr<HTMLScriptElement> HTMLScriptElement::create(Document& document, bool wasInsertedByParser, bool alreadyStarted)
 {
-    return adoptRef(new HTMLScriptElement(document, wasInsertedByParser, alreadyStarted));
+    return adoptRefWillBeRefCountedGarbageCollected(new HTMLScriptElement(document, wasInsertedByParser, alreadyStarted));
 }
 
 bool HTMLScriptElement::isURLAttribute(const Attribute& attribute) const
diff --git a/Source/core/html/HTMLScriptElement.h b/Source/core/html/HTMLScriptElement.h
index 43d2419..c95eb3d 100644
--- a/Source/core/html/HTMLScriptElement.h
+++ b/Source/core/html/HTMLScriptElement.h
@@ -33,7 +33,7 @@
 
 class HTMLScriptElement FINAL : public HTMLElement, public ScriptLoaderClient {
 public:
-    static PassRefPtr<HTMLScriptElement> create(Document&, bool wasInsertedByParser, bool alreadyStarted = false);
+    static PassRefPtrWillBeRawPtr<HTMLScriptElement> create(Document&, bool wasInsertedByParser, bool alreadyStarted = false);
 
     String text() { return textFromChildren(); }
     void setText(const String&);
diff --git a/Source/core/html/HTMLSelectElement.cpp b/Source/core/html/HTMLSelectElement.cpp
index 883df3c..f51d4f0 100644
--- a/Source/core/html/HTMLSelectElement.cpp
+++ b/Source/core/html/HTMLSelectElement.cpp
@@ -79,14 +79,14 @@
     setHasCustomStyleCallbacks();
 }
 
-PassRefPtr<HTMLSelectElement> HTMLSelectElement::create(Document& document)
+PassRefPtrWillBeRawPtr<HTMLSelectElement> HTMLSelectElement::create(Document& document)
 {
-    return adoptRef(new HTMLSelectElement(document, 0));
+    return adoptRefWillBeRefCountedGarbageCollected(new HTMLSelectElement(document, 0));
 }
 
-PassRefPtr<HTMLSelectElement> HTMLSelectElement::create(Document& document, HTMLFormElement* form)
+PassRefPtrWillBeRawPtr<HTMLSelectElement> HTMLSelectElement::create(Document& document, HTMLFormElement* form)
 {
-    return adoptRef(new HTMLSelectElement(document, form));
+    return adoptRefWillBeRefCountedGarbageCollected(new HTMLSelectElement(document, form));
 }
 
 const AtomicString& HTMLSelectElement::formControlType() const
diff --git a/Source/core/html/HTMLSelectElement.h b/Source/core/html/HTMLSelectElement.h
index 4286b20..926d224 100644
--- a/Source/core/html/HTMLSelectElement.h
+++ b/Source/core/html/HTMLSelectElement.h
@@ -39,8 +39,8 @@
 
 class HTMLSelectElement FINAL : public HTMLFormControlElementWithState, public TypeAheadDataSource {
 public:
-    static PassRefPtr<HTMLSelectElement> create(Document&);
-    static PassRefPtr<HTMLSelectElement> create(Document&, HTMLFormElement*);
+    static PassRefPtrWillBeRawPtr<HTMLSelectElement> create(Document&);
+    static PassRefPtrWillBeRawPtr<HTMLSelectElement> create(Document&, HTMLFormElement*);
 
     int selectedIndex() const;
     void setSelectedIndex(int);
diff --git a/Source/core/html/HTMLShadowElement.cpp b/Source/core/html/HTMLShadowElement.cpp
index 00b7f8d..c369a9c 100644
--- a/Source/core/html/HTMLShadowElement.cpp
+++ b/Source/core/html/HTMLShadowElement.cpp
@@ -44,9 +44,9 @@
     ScriptWrappable::init(this);
 }
 
-PassRefPtr<HTMLShadowElement> HTMLShadowElement::create(Document& document)
+PassRefPtrWillBeRawPtr<HTMLShadowElement> HTMLShadowElement::create(Document& document)
 {
-    return adoptRef(new HTMLShadowElement(document));
+    return adoptRefWillBeRefCountedGarbageCollected(new HTMLShadowElement(document));
 }
 
 HTMLShadowElement::~HTMLShadowElement()
diff --git a/Source/core/html/HTMLShadowElement.h b/Source/core/html/HTMLShadowElement.h
index e9aa02f..695c198 100644
--- a/Source/core/html/HTMLShadowElement.h
+++ b/Source/core/html/HTMLShadowElement.h
@@ -38,7 +38,7 @@
 
 class HTMLShadowElement FINAL : public InsertionPoint {
 public:
-    static PassRefPtr<HTMLShadowElement> create(Document&);
+    static PassRefPtrWillBeRawPtr<HTMLShadowElement> create(Document&);
 
     virtual ~HTMLShadowElement();
 
diff --git a/Source/core/html/HTMLSourceElement.cpp b/Source/core/html/HTMLSourceElement.cpp
index 4e26a11..6c613b4 100644
--- a/Source/core/html/HTMLSourceElement.cpp
+++ b/Source/core/html/HTMLSourceElement.cpp
@@ -50,9 +50,9 @@
     ScriptWrappable::init(this);
 }
 
-PassRefPtr<HTMLSourceElement> HTMLSourceElement::create(Document& document)
+PassRefPtrWillBeRawPtr<HTMLSourceElement> HTMLSourceElement::create(Document& document)
 {
-    return adoptRef(new HTMLSourceElement(document));
+    return adoptRefWillBeRefCountedGarbageCollected(new HTMLSourceElement(document));
 }
 
 HTMLSourceElement::~HTMLSourceElement()
diff --git a/Source/core/html/HTMLSourceElement.h b/Source/core/html/HTMLSourceElement.h
index d026e0f..6df81ff 100644
--- a/Source/core/html/HTMLSourceElement.h
+++ b/Source/core/html/HTMLSourceElement.h
@@ -36,7 +36,7 @@
 
 class HTMLSourceElement FINAL : public HTMLElement {
 public:
-    static PassRefPtr<HTMLSourceElement> create(Document&);
+    static PassRefPtrWillBeRawPtr<HTMLSourceElement> create(Document&);
     virtual ~HTMLSourceElement();
 
     const AtomicString& type() const;
diff --git a/Source/core/html/HTMLSourceElement.idl b/Source/core/html/HTMLSourceElement.idl
index efb7231..5f0702d 100644
--- a/Source/core/html/HTMLSourceElement.idl
+++ b/Source/core/html/HTMLSourceElement.idl
@@ -29,5 +29,9 @@
     [Reflect, URL, PerWorldBindings, LogActivity=SetterOnly] attribute DOMString src;
     attribute DOMString type;
 
+    [Reflect, RuntimeEnabled=Picture] attribute DOMString srcset;
+    [Reflect, RuntimeEnabled=Picture] attribute DOMString sizes;
+    [Reflect, RuntimeEnabled=Picture] attribute DOMString media;
+
     [Reflect, RuntimeEnabled=SubresourceIntegrity] attribute DOMString integrity;
 };
diff --git a/Source/core/html/HTMLSpanElement.cpp b/Source/core/html/HTMLSpanElement.cpp
index 193c659..f72da4f 100644
--- a/Source/core/html/HTMLSpanElement.cpp
+++ b/Source/core/html/HTMLSpanElement.cpp
@@ -38,9 +38,9 @@
     ScriptWrappable::init(this);
 }
 
-PassRefPtr<HTMLSpanElement> HTMLSpanElement::create(Document& document)
+PassRefPtrWillBeRawPtr<HTMLSpanElement> HTMLSpanElement::create(Document& document)
 {
-    return adoptRef(new HTMLSpanElement(document));
+    return adoptRefWillBeRefCountedGarbageCollected(new HTMLSpanElement(document));
 }
 
 }
diff --git a/Source/core/html/HTMLSpanElement.h b/Source/core/html/HTMLSpanElement.h
index ca77b86..afe795d 100644
--- a/Source/core/html/HTMLSpanElement.h
+++ b/Source/core/html/HTMLSpanElement.h
@@ -32,7 +32,7 @@
 
 class HTMLSpanElement : public HTMLElement {
 public:
-    static PassRefPtr<HTMLSpanElement> create(Document&);
+    static PassRefPtrWillBeRawPtr<HTMLSpanElement> create(Document&);
 
 protected:
     explicit HTMLSpanElement(Document&);
diff --git a/Source/core/html/HTMLStyleElement.cpp b/Source/core/html/HTMLStyleElement.cpp
index 728b7a8..2a7de9c 100644
--- a/Source/core/html/HTMLStyleElement.cpp
+++ b/Source/core/html/HTMLStyleElement.cpp
@@ -58,20 +58,16 @@
 {
     // During tear-down, willRemove isn't called, so m_scopedStyleRegistrationState may still be RegisteredAsScoped or RegisteredInShadowRoot here.
     // Therefore we can't ASSERT(m_scopedStyleRegistrationState == NotRegistered).
-#if ENABLE(OILPAN)
-    // Remove this once StyleSheet has a strong pointer to its owner.
-    if (m_sheet)
-        m_sheet->clearOwnerNode();
-#else
+#if !ENABLE(OILPAN)
     StyleElement::clearDocumentData(document(), this);
 #endif
 
     styleLoadEventSender().cancelEvent(this);
 }
 
-PassRefPtr<HTMLStyleElement> HTMLStyleElement::create(Document& document, bool createdByParser)
+PassRefPtrWillBeRawPtr<HTMLStyleElement> HTMLStyleElement::create(Document& document, bool createdByParser)
 {
-    return adoptRef(new HTMLStyleElement(document, createdByParser));
+    return adoptRefWillBeRefCountedGarbageCollected(new HTMLStyleElement(document, createdByParser));
 }
 
 void HTMLStyleElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
@@ -293,4 +289,10 @@
         styleSheet->setDisabled(setDisabled);
 }
 
+void HTMLStyleElement::trace(Visitor* visitor)
+{
+    StyleElement::trace(visitor);
+    HTMLElement::trace(visitor);
+}
+
 }
diff --git a/Source/core/html/HTMLStyleElement.h b/Source/core/html/HTMLStyleElement.h
index c058e8f..d7ddd88 100644
--- a/Source/core/html/HTMLStyleElement.h
+++ b/Source/core/html/HTMLStyleElement.h
@@ -35,8 +35,9 @@
 typedef EventSender<HTMLStyleElement> StyleEventSender;
 
 class HTMLStyleElement FINAL : public HTMLElement, private StyleElement {
+    WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(HTMLStyleElement);
 public:
-    static PassRefPtr<HTMLStyleElement> create(Document&, bool createdByParser);
+    static PassRefPtrWillBeRawPtr<HTMLStyleElement> create(Document&, bool createdByParser);
     virtual ~HTMLStyleElement();
 
     void setType(const AtomicString&);
@@ -66,6 +67,8 @@
     void dispatchPendingEvent(StyleEventSender*);
     static void dispatchPendingLoadEvents();
 
+    virtual void trace(Visitor*) OVERRIDE;
+
 private:
     HTMLStyleElement(Document&, bool createdByParser);
 
diff --git a/Source/core/html/HTMLSummaryElement.cpp b/Source/core/html/HTMLSummaryElement.cpp
index d213a27..a5cba7c 100644
--- a/Source/core/html/HTMLSummaryElement.cpp
+++ b/Source/core/html/HTMLSummaryElement.cpp
@@ -35,9 +35,9 @@
 
 using namespace HTMLNames;
 
-PassRefPtr<HTMLSummaryElement> HTMLSummaryElement::create(Document& document)
+PassRefPtrWillBeRawPtr<HTMLSummaryElement> HTMLSummaryElement::create(Document& document)
 {
-    RefPtr<HTMLSummaryElement> summary = adoptRef(new HTMLSummaryElement(document));
+    RefPtrWillBeRawPtr<HTMLSummaryElement> summary = adoptRefWillBeRefCountedGarbageCollected(new HTMLSummaryElement(document));
     summary->ensureUserAgentShadowRoot();
     return summary.release();
 }
diff --git a/Source/core/html/HTMLSummaryElement.h b/Source/core/html/HTMLSummaryElement.h
index 89c130c..1a05da7 100644
--- a/Source/core/html/HTMLSummaryElement.h
+++ b/Source/core/html/HTMLSummaryElement.h
@@ -29,7 +29,7 @@
 
 class HTMLSummaryElement FINAL : public HTMLElement {
 public:
-    static PassRefPtr<HTMLSummaryElement> create(Document&);
+    static PassRefPtrWillBeRawPtr<HTMLSummaryElement> create(Document&);
     bool isMainSummary() const;
     virtual bool willRespondToMouseClickEvents() OVERRIDE;
 
diff --git a/Source/core/html/HTMLTableCaptionElement.cpp b/Source/core/html/HTMLTableCaptionElement.cpp
index bea0640..fdd7a82 100644
--- a/Source/core/html/HTMLTableCaptionElement.cpp
+++ b/Source/core/html/HTMLTableCaptionElement.cpp
@@ -38,9 +38,9 @@
     ScriptWrappable::init(this);
 }
 
-PassRefPtr<HTMLTableCaptionElement> HTMLTableCaptionElement::create(Document& document)
+PassRefPtrWillBeRawPtr<HTMLTableCaptionElement> HTMLTableCaptionElement::create(Document& document)
 {
-    return adoptRef(new HTMLTableCaptionElement(document));
+    return adoptRefWillBeRefCountedGarbageCollected(new HTMLTableCaptionElement(document));
 }
 
 void HTMLTableCaptionElement::collectStyleForPresentationAttribute(const QualifiedName& name, const AtomicString& value, MutableStylePropertySet* style)
diff --git a/Source/core/html/HTMLTableCaptionElement.h b/Source/core/html/HTMLTableCaptionElement.h
index 214950d..c5d4d22 100644
--- a/Source/core/html/HTMLTableCaptionElement.h
+++ b/Source/core/html/HTMLTableCaptionElement.h
@@ -32,7 +32,7 @@
 
 class HTMLTableCaptionElement FINAL : public HTMLElement {
 public:
-    static PassRefPtr<HTMLTableCaptionElement> create(Document&);
+    static PassRefPtrWillBeRawPtr<HTMLTableCaptionElement> create(Document&);
 
 private:
     HTMLTableCaptionElement(Document&);
diff --git a/Source/core/html/HTMLTableCellElement.cpp b/Source/core/html/HTMLTableCellElement.cpp
index a68ba17..294ef03 100644
--- a/Source/core/html/HTMLTableCellElement.cpp
+++ b/Source/core/html/HTMLTableCellElement.cpp
@@ -48,9 +48,9 @@
     ScriptWrappable::init(this);
 }
 
-PassRefPtr<HTMLTableCellElement> HTMLTableCellElement::create(const QualifiedName& tagName, Document& document)
+PassRefPtrWillBeRawPtr<HTMLTableCellElement> HTMLTableCellElement::create(const QualifiedName& tagName, Document& document)
 {
-    return adoptRef(new HTMLTableCellElement(tagName, document));
+    return adoptRefWillBeRefCountedGarbageCollected(new HTMLTableCellElement(tagName, document));
 }
 
 int HTMLTableCellElement::colSpan() const
diff --git a/Source/core/html/HTMLTableCellElement.h b/Source/core/html/HTMLTableCellElement.h
index d90552b..c745415 100644
--- a/Source/core/html/HTMLTableCellElement.h
+++ b/Source/core/html/HTMLTableCellElement.h
@@ -32,7 +32,7 @@
 
 class HTMLTableCellElement FINAL : public HTMLTablePartElement {
 public:
-    static PassRefPtr<HTMLTableCellElement> create(const QualifiedName&, Document&);
+    static PassRefPtrWillBeRawPtr<HTMLTableCellElement> create(const QualifiedName&, Document&);
 
     int cellIndex() const;
 
diff --git a/Source/core/html/HTMLTableColElement.cpp b/Source/core/html/HTMLTableColElement.cpp
index 0447fa7..f493a98 100644
--- a/Source/core/html/HTMLTableColElement.cpp
+++ b/Source/core/html/HTMLTableColElement.cpp
@@ -41,9 +41,9 @@
     ScriptWrappable::init(this);
 }
 
-PassRefPtr<HTMLTableColElement> HTMLTableColElement::create(const QualifiedName& tagName, Document& document)
+PassRefPtrWillBeRawPtr<HTMLTableColElement> HTMLTableColElement::create(const QualifiedName& tagName, Document& document)
 {
-    return adoptRef(new HTMLTableColElement(tagName, document));
+    return adoptRefWillBeRefCountedGarbageCollected(new HTMLTableColElement(tagName, document));
 }
 
 bool HTMLTableColElement::isPresentationAttribute(const QualifiedName& name) const
diff --git a/Source/core/html/HTMLTableColElement.h b/Source/core/html/HTMLTableColElement.h
index 9c24f5b..9d0a8a4 100644
--- a/Source/core/html/HTMLTableColElement.h
+++ b/Source/core/html/HTMLTableColElement.h
@@ -32,7 +32,7 @@
 
 class HTMLTableColElement FINAL : public HTMLTablePartElement {
 public:
-    static PassRefPtr<HTMLTableColElement> create(const QualifiedName& tagName, Document&);
+    static PassRefPtrWillBeRawPtr<HTMLTableColElement> create(const QualifiedName& tagName, Document&);
 
     int span() const { return m_span; }
     void setSpan(int);
diff --git a/Source/core/html/HTMLTableElement.cpp b/Source/core/html/HTMLTableElement.cpp
index 977949b..5d67a97 100644
--- a/Source/core/html/HTMLTableElement.cpp
+++ b/Source/core/html/HTMLTableElement.cpp
@@ -61,9 +61,9 @@
     ScriptWrappable::init(this);
 }
 
-PassRefPtr<HTMLTableElement> HTMLTableElement::create(Document& document)
+PassRefPtrWillBeRawPtr<HTMLTableElement> HTMLTableElement::create(Document& document)
 {
-    return adoptRef(new HTMLTableElement(document));
+    return adoptRefWillBeRefCountedGarbageCollected(new HTMLTableElement(document));
 }
 
 HTMLTableCaptionElement* HTMLTableElement::caption() const
@@ -71,7 +71,7 @@
     return Traversal<HTMLTableCaptionElement>::firstChild(*this);
 }
 
-void HTMLTableElement::setCaption(PassRefPtr<HTMLTableCaptionElement> newCaption, ExceptionState& exceptionState)
+void HTMLTableElement::setCaption(PassRefPtrWillBeRawPtr<HTMLTableCaptionElement> newCaption, ExceptionState& exceptionState)
 {
     deleteCaption();
     insertBefore(newCaption, firstChild(), exceptionState);
@@ -86,7 +86,7 @@
     return 0;
 }
 
-void HTMLTableElement::setTHead(PassRefPtr<HTMLTableSectionElement> newHead, ExceptionState& exceptionState)
+void HTMLTableElement::setTHead(PassRefPtrWillBeRawPtr<HTMLTableSectionElement> newHead, ExceptionState& exceptionState)
 {
     deleteTHead();
 
@@ -108,7 +108,7 @@
     return 0;
 }
 
-void HTMLTableElement::setTFoot(PassRefPtr<HTMLTableSectionElement> newFoot, ExceptionState& exceptionState)
+void HTMLTableElement::setTFoot(PassRefPtrWillBeRawPtr<HTMLTableSectionElement> newFoot, ExceptionState& exceptionState)
 {
     deleteTFoot();
 
@@ -121,11 +121,11 @@
     insertBefore(newFoot, child, exceptionState);
 }
 
-PassRefPtr<HTMLElement> HTMLTableElement::createTHead()
+PassRefPtrWillBeRawPtr<HTMLElement> HTMLTableElement::createTHead()
 {
     if (HTMLTableSectionElement* existingHead = tHead())
         return existingHead;
-    RefPtr<HTMLTableSectionElement> head = HTMLTableSectionElement::create(theadTag, document());
+    RefPtrWillBeRawPtr<HTMLTableSectionElement> head = HTMLTableSectionElement::create(theadTag, document());
     setTHead(head, IGNORE_EXCEPTION);
     return head.release();
 }
@@ -135,11 +135,11 @@
     removeChild(tHead(), IGNORE_EXCEPTION);
 }
 
-PassRefPtr<HTMLElement> HTMLTableElement::createTFoot()
+PassRefPtrWillBeRawPtr<HTMLElement> HTMLTableElement::createTFoot()
 {
     if (HTMLTableSectionElement* existingFoot = tFoot())
         return existingFoot;
-    RefPtr<HTMLTableSectionElement> foot = HTMLTableSectionElement::create(tfootTag, document());
+    RefPtrWillBeRawPtr<HTMLTableSectionElement> foot = HTMLTableSectionElement::create(tfootTag, document());
     setTFoot(foot, IGNORE_EXCEPTION);
     return foot.release();
 }
@@ -149,20 +149,20 @@
     removeChild(tFoot(), IGNORE_EXCEPTION);
 }
 
-PassRefPtr<HTMLElement> HTMLTableElement::createTBody()
+PassRefPtrWillBeRawPtr<HTMLElement> HTMLTableElement::createTBody()
 {
-    RefPtr<HTMLTableSectionElement> body = HTMLTableSectionElement::create(tbodyTag, document());
+    RefPtrWillBeRawPtr<HTMLTableSectionElement> body = HTMLTableSectionElement::create(tbodyTag, document());
     Node* referenceElement = lastBody() ? lastBody()->nextSibling() : 0;
 
     insertBefore(body, referenceElement);
     return body.release();
 }
 
-PassRefPtr<HTMLElement> HTMLTableElement::createCaption()
+PassRefPtrWillBeRawPtr<HTMLElement> HTMLTableElement::createCaption()
 {
     if (HTMLTableCaptionElement* existingCaption = caption())
         return existingCaption;
-    RefPtr<HTMLTableCaptionElement> caption = HTMLTableCaptionElement::create(document());
+    RefPtrWillBeRawPtr<HTMLTableCaptionElement> caption = HTMLTableCaptionElement::create(document());
     setCaption(caption, IGNORE_EXCEPTION);
     return caption.release();
 }
@@ -181,17 +181,23 @@
     return 0;
 }
 
-PassRefPtr<HTMLElement> HTMLTableElement::insertRow(int index, ExceptionState& exceptionState)
+PassRefPtrWillBeRawPtr<HTMLElement> HTMLTableElement::insertRow(ExceptionState& exceptionState)
+{
+    // The default 'index' argument value is -1.
+    return insertRow(-1, exceptionState);
+}
+
+PassRefPtrWillBeRawPtr<HTMLElement> HTMLTableElement::insertRow(int index, ExceptionState& exceptionState)
 {
     if (index < -1) {
         exceptionState.throwDOMException(IndexSizeError, "The index provided (" + String::number(index) + ") is less than -1.");
         return nullptr;
     }
 
-    RefPtr<Node> protectFromMutationEvents(this);
+    RefPtrWillBeRawPtr<Node> protectFromMutationEvents(this);
 
-    RefPtr<HTMLTableRowElement> lastRow = nullptr;
-    RefPtr<HTMLTableRowElement> row = nullptr;
+    RefPtrWillBeRawPtr<HTMLTableRowElement> lastRow = nullptr;
+    RefPtrWillBeRawPtr<HTMLTableRowElement> row = nullptr;
     if (index == -1)
         lastRow = HTMLTableRowsCollection::lastRow(*this);
     else {
@@ -214,15 +220,15 @@
     else {
         parent = lastBody();
         if (!parent) {
-            RefPtr<HTMLTableSectionElement> newBody = HTMLTableSectionElement::create(tbodyTag, document());
-            RefPtr<HTMLTableRowElement> newRow = HTMLTableRowElement::create(document());
+            RefPtrWillBeRawPtr<HTMLTableSectionElement> newBody = HTMLTableSectionElement::create(tbodyTag, document());
+            RefPtrWillBeRawPtr<HTMLTableRowElement> newRow = HTMLTableRowElement::create(document());
             newBody->appendChild(newRow, exceptionState);
             appendChild(newBody.release(), exceptionState);
             return newRow.release();
         }
     }
 
-    RefPtr<HTMLTableRowElement> newRow = HTMLTableRowElement::create(document());
+    RefPtrWillBeRawPtr<HTMLTableRowElement> newRow = HTMLTableRowElement::create(document());
     parent->insertBefore(newRow, row.get(), exceptionState);
     return newRow.release();
 }
@@ -460,7 +466,7 @@
     return NoBorders;
 }
 
-PassRefPtr<StylePropertySet> HTMLTableElement::createSharedCellStyle()
+PassRefPtrWillBeRawPtr<StylePropertySet> HTMLTableElement::createSharedCellStyle()
 {
     RefPtrWillBeRawPtr<MutableStylePropertySet> style = MutableStylePropertySet::create();
 
@@ -507,7 +513,7 @@
     return m_sharedCellStyle.get();
 }
 
-static PassRefPtr<StylePropertySet> createGroupBorderStyle(int rows)
+static PassRefPtrWillBeRawPtr<StylePropertySet> createGroupBorderStyle(int rows)
 {
     RefPtrWillBeRawPtr<MutableStylePropertySet> style = MutableStylePropertySet::create();
     if (rows) {
@@ -572,4 +578,10 @@
     return getAttribute(summaryAttr);
 }
 
+void HTMLTableElement::trace(Visitor* visitor)
+{
+    visitor->trace(m_sharedCellStyle);
+    HTMLElement::trace(visitor);
+}
+
 }
diff --git a/Source/core/html/HTMLTableElement.h b/Source/core/html/HTMLTableElement.h
index ad3b774..fa806d8 100644
--- a/Source/core/html/HTMLTableElement.h
+++ b/Source/core/html/HTMLTableElement.h
@@ -38,25 +38,26 @@
 
 class HTMLTableElement FINAL : public HTMLElement {
 public:
-    static PassRefPtr<HTMLTableElement> create(Document&);
+    static PassRefPtrWillBeRawPtr<HTMLTableElement> create(Document&);
 
     HTMLTableCaptionElement* caption() const;
-    void setCaption(PassRefPtr<HTMLTableCaptionElement>, ExceptionState&);
+    void setCaption(PassRefPtrWillBeRawPtr<HTMLTableCaptionElement>, ExceptionState&);
 
     HTMLTableSectionElement* tHead() const;
-    void setTHead(PassRefPtr<HTMLTableSectionElement>, ExceptionState&);
+    void setTHead(PassRefPtrWillBeRawPtr<HTMLTableSectionElement>, ExceptionState&);
 
     HTMLTableSectionElement* tFoot() const;
-    void setTFoot(PassRefPtr<HTMLTableSectionElement>, ExceptionState&);
+    void setTFoot(PassRefPtrWillBeRawPtr<HTMLTableSectionElement>, ExceptionState&);
 
-    PassRefPtr<HTMLElement> createTHead();
+    PassRefPtrWillBeRawPtr<HTMLElement> createTHead();
     void deleteTHead();
-    PassRefPtr<HTMLElement> createTFoot();
+    PassRefPtrWillBeRawPtr<HTMLElement> createTFoot();
     void deleteTFoot();
-    PassRefPtr<HTMLElement> createTBody();
-    PassRefPtr<HTMLElement> createCaption();
+    PassRefPtrWillBeRawPtr<HTMLElement> createTBody();
+    PassRefPtrWillBeRawPtr<HTMLElement> createCaption();
     void deleteCaption();
-    PassRefPtr<HTMLElement> insertRow(int index, ExceptionState&);
+    PassRefPtrWillBeRawPtr<HTMLElement> insertRow(ExceptionState&);
+    PassRefPtrWillBeRawPtr<HTMLElement> insertRow(int index, ExceptionState&);
     void deleteRow(int index, ExceptionState&);
 
     PassRefPtr<HTMLCollection> rows();
@@ -68,6 +69,8 @@
     const StylePropertySet* additionalCellStyle();
     const StylePropertySet* additionalGroupStyle(bool rows);
 
+    virtual void trace(Visitor*) OVERRIDE;
+
 private:
     explicit HTMLTableElement(Document&);
 
@@ -86,7 +89,7 @@
 
     CellBorders cellBorders() const;
 
-    PassRefPtr<StylePropertySet> createSharedCellStyle();
+    PassRefPtrWillBeRawPtr<StylePropertySet> createSharedCellStyle();
 
     HTMLTableSectionElement* lastBody() const;
 
@@ -99,7 +102,7 @@
                                 // are present, to none otherwise).
 
     unsigned short m_padding;
-    RefPtr<StylePropertySet> m_sharedCellStyle;
+    RefPtrWillBeMember<StylePropertySet> m_sharedCellStyle;
 };
 
 } //namespace
diff --git a/Source/core/html/HTMLTableElement.idl b/Source/core/html/HTMLTableElement.idl
index 4cd6d6f..3072583 100644
--- a/Source/core/html/HTMLTableElement.idl
+++ b/Source/core/html/HTMLTableElement.idl
@@ -45,6 +45,6 @@
     HTMLElement createCaption();
     void deleteCaption();
 
-    [RaisesException] HTMLElement insertRow([Default=Undefined] optional long index);
+    [RaisesException] HTMLElement insertRow(optional long index);
     [RaisesException] void deleteRow([Default=Undefined] optional long index);
 };
diff --git a/Source/core/html/HTMLTableRowElement.cpp b/Source/core/html/HTMLTableRowElement.cpp
index d6fd9ce..9688805 100644
--- a/Source/core/html/HTMLTableRowElement.cpp
+++ b/Source/core/html/HTMLTableRowElement.cpp
@@ -54,9 +54,9 @@
     return backgroundAttr;
 }
 
-PassRefPtr<HTMLTableRowElement> HTMLTableRowElement::create(Document& document)
+PassRefPtrWillBeRawPtr<HTMLTableRowElement> HTMLTableRowElement::create(Document& document)
 {
-    return adoptRef(new HTMLTableRowElement(document));
+    return adoptRefWillBeRefCountedGarbageCollected(new HTMLTableRowElement(document));
 }
 
 int HTMLTableRowElement::rowIndex() const
@@ -119,7 +119,13 @@
     return rIndex;
 }
 
-PassRefPtr<HTMLElement> HTMLTableRowElement::insertCell(int index, ExceptionState& exceptionState)
+PassRefPtrWillBeRawPtr<HTMLElement> HTMLTableRowElement::insertCell(ExceptionState& exceptionState)
+{
+    // The default 'index' argument value is -1.
+    return insertCell(-1, exceptionState);
+}
+
+PassRefPtrWillBeRawPtr<HTMLElement> HTMLTableRowElement::insertCell(int index, ExceptionState& exceptionState)
 {
     RefPtr<HTMLCollection> children = cells();
     int numCells = children ? children->length() : 0;
@@ -128,17 +134,11 @@
         return nullptr;
     }
 
-    RefPtr<HTMLTableCellElement> cell = HTMLTableCellElement::create(tdTag, document());
-    if (index < 0 || index >= numCells)
+    RefPtrWillBeRawPtr<HTMLTableCellElement> cell = HTMLTableCellElement::create(tdTag, document());
+    if (numCells == index || index == -1)
         appendChild(cell, exceptionState);
-    else {
-        Node* n;
-        if (index < 1)
-            n = firstChild();
-        else
-            n = children->item(index);
-        insertBefore(cell, n, exceptionState);
-    }
+    else
+        insertBefore(cell, children->item(index), exceptionState);
     return cell.release();
 }
 
@@ -149,7 +149,7 @@
     if (index == -1)
         index = numCells-1;
     if (index >= 0 && index < numCells) {
-        RefPtr<Element> cell = children->item(index);
+        RefPtrWillBeRawPtr<Element> cell = children->item(index);
         HTMLElement::removeChild(cell.get(), exceptionState);
     } else {
         exceptionState.throwDOMException(IndexSizeError, "The value provided (" + String::number(index) + ") is outside the range [0, " + String::number(numCells) + ").");
diff --git a/Source/core/html/HTMLTableRowElement.h b/Source/core/html/HTMLTableRowElement.h
index a5a7e14..7f96797 100644
--- a/Source/core/html/HTMLTableRowElement.h
+++ b/Source/core/html/HTMLTableRowElement.h
@@ -34,13 +34,14 @@
 
 class HTMLTableRowElement FINAL : public HTMLTablePartElement {
 public:
-    static PassRefPtr<HTMLTableRowElement> create(Document&);
+    static PassRefPtrWillBeRawPtr<HTMLTableRowElement> create(Document&);
 
     int rowIndex() const;
 
     int sectionRowIndex() const;
 
-    PassRefPtr<HTMLElement> insertCell(int index, ExceptionState&);
+    PassRefPtrWillBeRawPtr<HTMLElement> insertCell(ExceptionState&);
+    PassRefPtrWillBeRawPtr<HTMLElement> insertCell(int index, ExceptionState&);
     void deleteCell(int index, ExceptionState&);
 
     PassRefPtr<HTMLCollection> cells();
diff --git a/Source/core/html/HTMLTableRowElement.idl b/Source/core/html/HTMLTableRowElement.idl
index aa7b9ca..e38f999 100644
--- a/Source/core/html/HTMLTableRowElement.idl
+++ b/Source/core/html/HTMLTableRowElement.idl
@@ -27,6 +27,6 @@
     [Reflect=char] attribute DOMString ch;
     [Reflect=charoff] attribute DOMString chOff;
     [Reflect] attribute DOMString vAlign;
-    [RaisesException] HTMLElement insertCell([Default=Undefined] optional long index);
+    [RaisesException] HTMLElement insertCell(optional long index);
     [RaisesException] void deleteCell([Default=Undefined] optional long index);
 };
diff --git a/Source/core/html/HTMLTableSectionElement.cpp b/Source/core/html/HTMLTableSectionElement.cpp
index 1820cab..eadd1a0 100644
--- a/Source/core/html/HTMLTableSectionElement.cpp
+++ b/Source/core/html/HTMLTableSectionElement.cpp
@@ -43,9 +43,9 @@
     ScriptWrappable::init(this);
 }
 
-PassRefPtr<HTMLTableSectionElement> HTMLTableSectionElement::create(const QualifiedName& tagName, Document& document)
+PassRefPtrWillBeRawPtr<HTMLTableSectionElement> HTMLTableSectionElement::create(const QualifiedName& tagName, Document& document)
 {
-    return adoptRef(new HTMLTableSectionElement(tagName, document));
+    return adoptRefWillBeRefCountedGarbageCollected(new HTMLTableSectionElement(tagName, document));
 }
 
 const StylePropertySet* HTMLTableSectionElement::additionalPresentationAttributeStyle()
@@ -55,28 +55,28 @@
     return 0;
 }
 
+PassRefPtrWillBeRawPtr<HTMLElement> HTMLTableSectionElement::insertRow(ExceptionState& exceptionState)
+{
+    // The default 'index' argument value is -1.
+    return insertRow(-1, exceptionState);
+}
+
 // these functions are rather slow, since we need to get the row at
 // the index... but they aren't used during usual HTML parsing anyway
-PassRefPtr<HTMLElement> HTMLTableSectionElement::insertRow(int index, ExceptionState& exceptionState)
+PassRefPtrWillBeRawPtr<HTMLElement> HTMLTableSectionElement::insertRow(int index, ExceptionState& exceptionState)
 {
-    RefPtr<HTMLTableRowElement> row;
     RefPtr<HTMLCollection> children = rows();
-    int numRows = children ? (int)children->length() : 0;
+    int numRows = children ? static_cast<int>(children->length()) : 0;
     if (index < -1 || index > numRows) {
         exceptionState.throwDOMException(IndexSizeError, "The provided index (" + String::number(index) + " is outside the range [-1, " + String::number(numRows) + "].");
-    } else {
-        row = HTMLTableRowElement::create(document());
-        if (numRows == index || index == -1)
-            appendChild(row, exceptionState);
-        else {
-            Node* n;
-            if (index < 1)
-                n = firstChild();
-            else
-                n = children->item(index);
-            insertBefore(row, n, exceptionState);
-        }
+        return nullptr;
     }
+
+    RefPtrWillBeRawPtr<HTMLTableRowElement> row = HTMLTableRowElement::create(document());
+    if (numRows == index || index == -1)
+        appendChild(row, exceptionState);
+    else
+        insertBefore(row, children->item(index), exceptionState);
     return row.release();
 }
 
diff --git a/Source/core/html/HTMLTableSectionElement.h b/Source/core/html/HTMLTableSectionElement.h
index 53cc913..b7e0767 100644
--- a/Source/core/html/HTMLTableSectionElement.h
+++ b/Source/core/html/HTMLTableSectionElement.h
@@ -34,9 +34,10 @@
 
 class HTMLTableSectionElement FINAL : public HTMLTablePartElement {
 public:
-    static PassRefPtr<HTMLTableSectionElement> create(const QualifiedName&, Document&);
+    static PassRefPtrWillBeRawPtr<HTMLTableSectionElement> create(const QualifiedName&, Document&);
 
-    PassRefPtr<HTMLElement> insertRow(int index, ExceptionState&);
+    PassRefPtrWillBeRawPtr<HTMLElement> insertRow(ExceptionState&);
+    PassRefPtrWillBeRawPtr<HTMLElement> insertRow(int index, ExceptionState&);
     void deleteRow(int index, ExceptionState&);
 
     int numRows() const;
diff --git a/Source/core/html/HTMLTableSectionElement.idl b/Source/core/html/HTMLTableSectionElement.idl
index 836b712..a8f0b89 100644
--- a/Source/core/html/HTMLTableSectionElement.idl
+++ b/Source/core/html/HTMLTableSectionElement.idl
@@ -24,6 +24,6 @@
     [Reflect=charoff] attribute DOMString chOff;
     [Reflect] attribute DOMString vAlign;
     readonly attribute HTMLCollection rows;
-    [RaisesException] HTMLElement insertRow([Default=Undefined] optional long index);
+    [RaisesException] HTMLElement insertRow(optional long index);
     [RaisesException] void deleteRow([Default=Undefined] optional long index);
 };
diff --git a/Source/core/html/HTMLTagNames.in b/Source/core/html/HTMLTagNames.in
index fdc99c2..8b4c306 100644
--- a/Source/core/html/HTMLTagNames.in
+++ b/Source/core/html/HTMLTagNames.in
@@ -97,6 +97,7 @@
 shadow interfaceName=HTMLShadowElement
 p interfaceName=HTMLParagraphElement
 param
+picture interfaceName=HTMLPictureElement, runtimeEnabled=picture
 plaintext interfaceName=HTMLElement
 pre
 progress interfaceName=HTMLProgressElement
diff --git a/Source/core/html/HTMLTemplateElement.cpp b/Source/core/html/HTMLTemplateElement.cpp
index 2990838..9f4a4ab 100644
--- a/Source/core/html/HTMLTemplateElement.cpp
+++ b/Source/core/html/HTMLTemplateElement.cpp
@@ -51,9 +51,9 @@
         m_content->clearHost();
 }
 
-PassRefPtr<HTMLTemplateElement> HTMLTemplateElement::create(Document& document)
+PassRefPtrWillBeRawPtr<HTMLTemplateElement> HTMLTemplateElement::create(Document& document)
 {
-    return adoptRef(new HTMLTemplateElement(document));
+    return adoptRefWillBeRefCountedGarbageCollected(new HTMLTemplateElement(document));
 }
 
 DocumentFragment* HTMLTemplateElement::content() const
diff --git a/Source/core/html/HTMLTemplateElement.h b/Source/core/html/HTMLTemplateElement.h
index f44ac45..5e5ac7d 100644
--- a/Source/core/html/HTMLTemplateElement.h
+++ b/Source/core/html/HTMLTemplateElement.h
@@ -40,7 +40,7 @@
 
 class HTMLTemplateElement FINAL : public HTMLElement {
 public:
-    static PassRefPtr<HTMLTemplateElement> create(Document&);
+    static PassRefPtrWillBeRawPtr<HTMLTemplateElement> create(Document&);
     virtual ~HTMLTemplateElement();
 
     DocumentFragment* content() const;
diff --git a/Source/core/html/HTMLTextAreaElement.cpp b/Source/core/html/HTMLTextAreaElement.cpp
index 35ab21d..348c07f 100644
--- a/Source/core/html/HTMLTextAreaElement.cpp
+++ b/Source/core/html/HTMLTextAreaElement.cpp
@@ -88,9 +88,9 @@
     ScriptWrappable::init(this);
 }
 
-PassRefPtr<HTMLTextAreaElement> HTMLTextAreaElement::create(Document& document, HTMLFormElement* form)
+PassRefPtrWillBeRawPtr<HTMLTextAreaElement> HTMLTextAreaElement::create(Document& document, HTMLFormElement* form)
 {
-    RefPtr<HTMLTextAreaElement> textArea = adoptRef(new HTMLTextAreaElement(document, form));
+    RefPtrWillBeRawPtr<HTMLTextAreaElement> textArea = adoptRefWillBeRefCountedGarbageCollected(new HTMLTextAreaElement(document, form));
     textArea->ensureUserAgentShadowRoot();
     return textArea.release();
 }
@@ -335,7 +335,7 @@
 
 void HTMLTextAreaElement::setValue(const String& value, TextFieldEventBehavior eventBehavior)
 {
-    RefPtr<HTMLTextAreaElement> protector(this);
+    RefPtrWillBeRawPtr<HTMLTextAreaElement> protector(this);
     setValueCommon(value, eventBehavior);
     m_isDirty = true;
     setNeedsValidityCheck();
@@ -541,14 +541,14 @@
 void HTMLTextAreaElement::updatePlaceholderText()
 {
     HTMLElement* placeholder = placeholderElement();
-    String placeholderText = strippedPlaceholder();
+    const AtomicString& placeholderText = fastGetAttribute(placeholderAttr);
     if (placeholderText.isEmpty()) {
         if (placeholder)
             userAgentShadowRoot()->removeChild(placeholder);
         return;
     }
     if (!placeholder) {
-        RefPtr<HTMLDivElement> newElement = HTMLDivElement::create(document());
+        RefPtrWillBeRawPtr<HTMLDivElement> newElement = HTMLDivElement::create(document());
         placeholder = newElement.get();
         placeholder->setShadowPseudoId(AtomicString("-webkit-input-placeholder", AtomicString::ConstructFromLiteral));
         placeholder->setAttribute(idAttr, ShadowElementNames::placeholder());
diff --git a/Source/core/html/HTMLTextAreaElement.h b/Source/core/html/HTMLTextAreaElement.h
index 63ef906..c23d4d5 100644
--- a/Source/core/html/HTMLTextAreaElement.h
+++ b/Source/core/html/HTMLTextAreaElement.h
@@ -34,7 +34,7 @@
 
 class HTMLTextAreaElement FINAL : public HTMLTextFormControlElement {
 public:
-    static PassRefPtr<HTMLTextAreaElement> create(Document&, HTMLFormElement*);
+    static PassRefPtrWillBeRawPtr<HTMLTextAreaElement> create(Document&, HTMLFormElement*);
 
     int cols() const { return m_cols; }
     int rows() const { return m_rows; }
diff --git a/Source/core/html/HTMLTextFormControlElement.cpp b/Source/core/html/HTMLTextFormControlElement.cpp
index c3f751a..bf3597a 100644
--- a/Source/core/html/HTMLTextFormControlElement.cpp
+++ b/Source/core/html/HTMLTextFormControlElement.cpp
@@ -182,11 +182,17 @@
     setSelectionRange(0, numeric_limits<int>::max(), SelectionHasNoDirection);
 }
 
+bool HTMLTextFormControlElement::shouldDispatchFormControlChangeEvent(String& oldValue, String& newValue)
+{
+    return !equalIgnoringNullity(oldValue, newValue);
+}
+
 void HTMLTextFormControlElement::dispatchFormControlChangeEvent()
 {
-    if (!equalIgnoringNullity(m_textAsOfLastFormControlChangeEvent, value())) {
+    String newValue = value();
+    if (shouldDispatchFormControlChangeEvent(m_textAsOfLastFormControlChangeEvent, newValue)) {
         dispatchChangeEvent();
-        setTextAsOfLastFormControlChangeEvent(value());
+        setTextAsOfLastFormControlChangeEvent(newValue);
     }
     setChangedSinceLastFormControlChangeEvent(false);
 }
diff --git a/Source/core/html/HTMLTextFormControlElement.h b/Source/core/html/HTMLTextFormControlElement.h
index 576c867..b24413c 100644
--- a/Source/core/html/HTMLTextFormControlElement.h
+++ b/Source/core/html/HTMLTextFormControlElement.h
@@ -110,6 +110,8 @@
 
     String valueWithHardLineBreaks() const;
 
+    virtual bool shouldDispatchFormControlChangeEvent(String&, String&);
+
 private:
     int computeSelectionStart() const;
     int computeSelectionEnd() const;
diff --git a/Source/core/html/HTMLTitleElement.cpp b/Source/core/html/HTMLTitleElement.cpp
index ed8a83c..1bfd7d2 100644
--- a/Source/core/html/HTMLTitleElement.cpp
+++ b/Source/core/html/HTMLTitleElement.cpp
@@ -44,9 +44,9 @@
     ScriptWrappable::init(this);
 }
 
-PassRefPtr<HTMLTitleElement> HTMLTitleElement::create(Document& document)
+PassRefPtrWillBeRawPtr<HTMLTitleElement> HTMLTitleElement::create(Document& document)
 {
-    return adoptRef(new HTMLTitleElement(document));
+    return adoptRefWillBeRefCountedGarbageCollected(new HTMLTitleElement(document));
 }
 
 Node::InsertionNotificationRequest HTMLTitleElement::insertedInto(ContainerNode* insertionPoint)
diff --git a/Source/core/html/HTMLTitleElement.h b/Source/core/html/HTMLTitleElement.h
index fda5df9..1350910 100644
--- a/Source/core/html/HTMLTitleElement.h
+++ b/Source/core/html/HTMLTitleElement.h
@@ -28,7 +28,7 @@
 
 class HTMLTitleElement FINAL : public HTMLElement {
 public:
-    static PassRefPtr<HTMLTitleElement> create(Document&);
+    static PassRefPtrWillBeRawPtr<HTMLTitleElement> create(Document&);
 
     String text() const;
     void setText(const String&);
diff --git a/Source/core/html/HTMLTrackElement.cpp b/Source/core/html/HTMLTrackElement.cpp
index 2c3bb94..4a71034 100644
--- a/Source/core/html/HTMLTrackElement.cpp
+++ b/Source/core/html/HTMLTrackElement.cpp
@@ -66,9 +66,9 @@
 #endif
 }
 
-PassRefPtr<HTMLTrackElement> HTMLTrackElement::create(Document& document)
+PassRefPtrWillBeRawPtr<HTMLTrackElement> HTMLTrackElement::create(Document& document)
 {
-    return adoptRef(new HTMLTrackElement(document));
+    return adoptRefWillBeRefCountedGarbageCollected(new HTMLTrackElement(document));
 }
 
 Node::InsertionNotificationRequest HTMLTrackElement::insertedInto(ContainerNode* insertionPoint)
diff --git a/Source/core/html/HTMLTrackElement.h b/Source/core/html/HTMLTrackElement.h
index f390f58..a0a7872 100644
--- a/Source/core/html/HTMLTrackElement.h
+++ b/Source/core/html/HTMLTrackElement.h
@@ -37,7 +37,7 @@
 
 class HTMLTrackElement FINAL : public HTMLElement {
 public:
-    static PassRefPtr<HTMLTrackElement> create(Document&);
+    static PassRefPtrWillBeRawPtr<HTMLTrackElement> create(Document&);
 
     const AtomicString& kind();
     void setKind(const AtomicString&);
diff --git a/Source/core/html/HTMLUListElement.cpp b/Source/core/html/HTMLUListElement.cpp
index 9eb6e55..0f284e7 100644
--- a/Source/core/html/HTMLUListElement.cpp
+++ b/Source/core/html/HTMLUListElement.cpp
@@ -36,9 +36,9 @@
     ScriptWrappable::init(this);
 }
 
-PassRefPtr<HTMLUListElement> HTMLUListElement::create(Document& document)
+PassRefPtrWillBeRawPtr<HTMLUListElement> HTMLUListElement::create(Document& document)
 {
-    return adoptRef(new HTMLUListElement(document));
+    return adoptRefWillBeRefCountedGarbageCollected(new HTMLUListElement(document));
 }
 
 bool HTMLUListElement::isPresentationAttribute(const QualifiedName& name) const
diff --git a/Source/core/html/HTMLUListElement.h b/Source/core/html/HTMLUListElement.h
index 899467c..f8e2a84 100644
--- a/Source/core/html/HTMLUListElement.h
+++ b/Source/core/html/HTMLUListElement.h
@@ -29,7 +29,7 @@
 
 class HTMLUListElement FINAL : public HTMLElement {
 public:
-    static PassRefPtr<HTMLUListElement> create(Document&);
+    static PassRefPtrWillBeRawPtr<HTMLUListElement> create(Document&);
 
 private:
     explicit HTMLUListElement(Document&);
diff --git a/Source/core/html/HTMLUnknownElement.h b/Source/core/html/HTMLUnknownElement.h
index f3c5397..b92461e 100644
--- a/Source/core/html/HTMLUnknownElement.h
+++ b/Source/core/html/HTMLUnknownElement.h
@@ -36,9 +36,9 @@
 
 class HTMLUnknownElement FINAL : public HTMLElement {
 public:
-    static PassRefPtr<HTMLUnknownElement> create(const QualifiedName& tagName, Document& document)
+    static PassRefPtrWillBeRawPtr<HTMLUnknownElement> create(const QualifiedName& tagName, Document& document)
     {
-        return adoptRef(new HTMLUnknownElement(tagName, document));
+        return adoptRefWillBeRefCountedGarbageCollected(new HTMLUnknownElement(tagName, document));
     }
 
     virtual bool isHTMLUnknownElement() const OVERRIDE { return true; }
diff --git a/Source/core/html/HTMLVideoElement.cpp b/Source/core/html/HTMLVideoElement.cpp
index b9df940..a4e2c60 100644
--- a/Source/core/html/HTMLVideoElement.cpp
+++ b/Source/core/html/HTMLVideoElement.cpp
@@ -52,9 +52,9 @@
         m_defaultPosterURL = AtomicString(document.settings()->defaultVideoPosterURL());
 }
 
-PassRefPtr<HTMLVideoElement> HTMLVideoElement::create(Document& document)
+PassRefPtrWillBeRawPtr<HTMLVideoElement> HTMLVideoElement::create(Document& document)
 {
-    RefPtr<HTMLVideoElement> videoElement(adoptRef(new HTMLVideoElement(document)));
+    RefPtrWillBeRawPtr<HTMLVideoElement> videoElement(adoptRefWillBeRefCountedGarbageCollected(new HTMLVideoElement(document)));
     videoElement->suspendIfNeeded();
     return videoElement.release();
 }
diff --git a/Source/core/html/HTMLVideoElement.h b/Source/core/html/HTMLVideoElement.h
index e14b435..12f2a6f 100644
--- a/Source/core/html/HTMLVideoElement.h
+++ b/Source/core/html/HTMLVideoElement.h
@@ -40,7 +40,7 @@
 
 class HTMLVideoElement FINAL : public HTMLMediaElement, public CanvasImageSource {
 public:
-    static PassRefPtr<HTMLVideoElement> create(Document&);
+    static PassRefPtrWillBeRawPtr<HTMLVideoElement> create(Document&);
 
     unsigned videoWidth() const;
     unsigned videoHeight() const;
diff --git a/Source/core/html/HTMLViewSourceDocument.cpp b/Source/core/html/HTMLViewSourceDocument.cpp
index 395af05..daba1d6 100644
--- a/Source/core/html/HTMLViewSourceDocument.cpp
+++ b/Source/core/html/HTMLViewSourceDocument.cpp
@@ -65,20 +65,20 @@
 
 void HTMLViewSourceDocument::createContainingTable()
 {
-    RefPtr<HTMLHtmlElement> html = HTMLHtmlElement::create(*this);
+    RefPtrWillBeRawPtr<HTMLHtmlElement> html = HTMLHtmlElement::create(*this);
     parserAppendChild(html);
-    RefPtr<HTMLHeadElement> head = HTMLHeadElement::create(*this);
+    RefPtrWillBeRawPtr<HTMLHeadElement> head = HTMLHeadElement::create(*this);
     html->parserAppendChild(head);
-    RefPtr<HTMLBodyElement> body = HTMLBodyElement::create(*this);
+    RefPtrWillBeRawPtr<HTMLBodyElement> body = HTMLBodyElement::create(*this);
     html->parserAppendChild(body);
 
     // Create a line gutter div that can be used to make sure the gutter extends down the height of the whole
     // document.
-    RefPtr<HTMLDivElement> div = HTMLDivElement::create(*this);
+    RefPtrWillBeRawPtr<HTMLDivElement> div = HTMLDivElement::create(*this);
     div->setAttribute(classAttr, "webkit-line-gutter-backdrop");
     body->parserAppendChild(div);
 
-    RefPtr<HTMLTableElement> table = HTMLTableElement::create(*this);
+    RefPtrWillBeRawPtr<HTMLTableElement> table = HTMLTableElement::create(*this);
     body->parserAppendChild(table);
     m_tbody = HTMLTableSectionElement::create(tbodyTag, *this);
     table->parserAppendChild(m_tbody);
@@ -182,7 +182,7 @@
         return m_current;
     }
 
-    RefPtr<HTMLSpanElement> span = HTMLSpanElement::create(*this);
+    RefPtrWillBeRawPtr<HTMLSpanElement> span = HTMLSpanElement::create(*this);
     span->setAttribute(classAttr, className);
     m_current->parserAppendChild(span);
     return span.release();
@@ -191,11 +191,11 @@
 void HTMLViewSourceDocument::addLine(const AtomicString& className)
 {
     // Create a table row.
-    RefPtr<HTMLTableRowElement> trow = HTMLTableRowElement::create(*this);
+    RefPtrWillBeRawPtr<HTMLTableRowElement> trow = HTMLTableRowElement::create(*this);
     m_tbody->parserAppendChild(trow);
 
     // Create a cell that will hold the line number (it is generated in the stylesheet using counters).
-    RefPtr<HTMLTableCellElement> td = HTMLTableCellElement::create(tdTag, *this);
+    RefPtrWillBeRawPtr<HTMLTableCellElement> td = HTMLTableCellElement::create(tdTag, *this);
     td->setAttribute(classAttr, "webkit-line-number");
     td->setIntegralAttribute(valueAttr, ++m_lineNumber);
     trow->parserAppendChild(td);
@@ -217,7 +217,7 @@
 void HTMLViewSourceDocument::finishLine()
 {
     if (!m_current->hasChildren()) {
-        RefPtr<HTMLBRElement> br = HTMLBRElement::create(*this);
+        RefPtrWillBeRawPtr<HTMLBRElement> br = HTMLBRElement::create(*this);
         m_current->parserAppendChild(br);
     }
     m_current = m_tbody;
@@ -270,7 +270,7 @@
 
 PassRefPtr<Element> HTMLViewSourceDocument::addBase(const AtomicString& href)
 {
-    RefPtr<HTMLBaseElement> base = HTMLBaseElement::create(*this);
+    RefPtrWillBeRawPtr<HTMLBaseElement> base = HTMLBaseElement::create(*this);
     base->setAttribute(hrefAttr, href);
     m_current->parserAppendChild(base);
     return base.release();
@@ -282,7 +282,7 @@
         addLine("webkit-html-tag");
 
     // Now create a link for the attribute value instead of a span.
-    RefPtr<HTMLAnchorElement> anchor = HTMLAnchorElement::create(*this);
+    RefPtrWillBeRawPtr<HTMLAnchorElement> anchor = HTMLAnchorElement::create(*this);
     const char* classValue;
     if (isAnchor)
         classValue = "webkit-html-attribute-value webkit-html-external-link";
@@ -295,4 +295,12 @@
     return anchor.release();
 }
 
+void HTMLViewSourceDocument::trace(Visitor* visitor)
+{
+    visitor->trace(m_current);
+    visitor->trace(m_tbody);
+    visitor->trace(m_td);
+    HTMLDocument::trace(visitor);
+}
+
 }
diff --git a/Source/core/html/HTMLViewSourceDocument.h b/Source/core/html/HTMLViewSourceDocument.h
index 8c2608a..8774f88 100644
--- a/Source/core/html/HTMLViewSourceDocument.h
+++ b/Source/core/html/HTMLViewSourceDocument.h
@@ -35,13 +35,15 @@
 
 class HTMLViewSourceDocument FINAL : public HTMLDocument {
 public:
-    static PassRefPtr<HTMLViewSourceDocument> create(const DocumentInit& initializer, const String& mimeType)
+    static PassRefPtrWillBeRawPtr<HTMLViewSourceDocument> create(const DocumentInit& initializer, const String& mimeType)
     {
-        return adoptRef(new HTMLViewSourceDocument(initializer, mimeType));
+        return adoptRefWillBeRefCountedGarbageCollected(new HTMLViewSourceDocument(initializer, mimeType));
     }
 
     void addSource(const String&, HTMLToken&);
 
+    virtual void trace(Visitor*) OVERRIDE;
+
 private:
     HTMLViewSourceDocument(const DocumentInit&, const String& mimeType);
 
@@ -63,9 +65,9 @@
     PassRefPtr<Element> addBase(const AtomicString& href);
 
     String m_type;
-    RefPtr<Element> m_current;
-    RefPtr<HTMLTableSectionElement> m_tbody;
-    RefPtr<HTMLTableCellElement> m_td;
+    RefPtrWillBeMember<Element> m_current;
+    RefPtrWillBeMember<HTMLTableSectionElement> m_tbody;
+    RefPtrWillBeMember<HTMLTableCellElement> m_td;
     int m_lineNumber;
 };
 
diff --git a/Source/core/html/HTMLWBRElement.cpp b/Source/core/html/HTMLWBRElement.cpp
index 80a7e2a..c090f7f 100644
--- a/Source/core/html/HTMLWBRElement.cpp
+++ b/Source/core/html/HTMLWBRElement.cpp
@@ -43,9 +43,9 @@
 {
 }
 
-PassRefPtr<HTMLWBRElement> HTMLWBRElement::create(Document& document)
+PassRefPtrWillBeRawPtr<HTMLWBRElement> HTMLWBRElement::create(Document& document)
 {
-    return adoptRef(new HTMLWBRElement(document));
+    return adoptRefWillBeRefCountedGarbageCollected(new HTMLWBRElement(document));
 }
 
 RenderObject* HTMLWBRElement::createRenderer(RenderStyle* style)
diff --git a/Source/core/html/HTMLWBRElement.h b/Source/core/html/HTMLWBRElement.h
index 4695281..7d95355 100644
--- a/Source/core/html/HTMLWBRElement.h
+++ b/Source/core/html/HTMLWBRElement.h
@@ -39,7 +39,7 @@
 // so HTMLElement's createRenderer doesn't need to know about it.
 class HTMLWBRElement FINAL : public HTMLElement {
 public:
-    static PassRefPtr<HTMLWBRElement> create(Document&);
+    static PassRefPtrWillBeRawPtr<HTMLWBRElement> create(Document&);
 
 private:
     explicit HTMLWBRElement(Document&);
diff --git a/Source/core/html/ImageData.idl b/Source/core/html/ImageData.idl
index cbe4df3..0215e0a 100644
--- a/Source/core/html/ImageData.idl
+++ b/Source/core/html/ImageData.idl
@@ -30,7 +30,7 @@
     Constructor(Uint8ClampedArray data, unsigned long width, [Default=Undefined] optional unsigned long height),
     Constructor(unsigned long width, unsigned long height),
     Custom=Wrap,
-    GlobalContext=Window&WorkerGlobalScope,
+    Exposed=Window&Worker,
     RaisesException=Constructor,
     WillBeGarbageCollected,
 ] interface ImageData {
diff --git a/Source/core/html/ImageDocument.cpp b/Source/core/html/ImageDocument.cpp
index 6f07b40..367f2f9 100644
--- a/Source/core/html/ImageDocument.cpp
+++ b/Source/core/html/ImageDocument.cpp
@@ -180,20 +180,20 @@
 
 void ImageDocument::createDocumentStructure()
 {
-    RefPtr<HTMLHtmlElement> rootElement = HTMLHtmlElement::create(*this);
+    RefPtrWillBeRawPtr<HTMLHtmlElement> rootElement = HTMLHtmlElement::create(*this);
     appendChild(rootElement);
     rootElement->insertedByParser();
 
     if (frame())
         frame()->loader().dispatchDocumentElementAvailable();
 
-    RefPtr<HTMLHeadElement> head = HTMLHeadElement::create(*this);
-    RefPtr<HTMLMetaElement> meta = HTMLMetaElement::create(*this);
+    RefPtrWillBeRawPtr<HTMLHeadElement> head = HTMLHeadElement::create(*this);
+    RefPtrWillBeRawPtr<HTMLMetaElement> meta = HTMLMetaElement::create(*this);
     meta->setAttribute(nameAttr, "viewport");
     meta->setAttribute(contentAttr, "width=device-width, minimum-scale=0.1");
     head->appendChild(meta);
 
-    RefPtr<HTMLBodyElement> body = HTMLBodyElement::create(*this);
+    RefPtrWillBeRawPtr<HTMLBodyElement> body = HTMLBodyElement::create(*this);
     body->setAttribute(styleAttr, "margin: 0px;");
 
     m_imageElement = HTMLImageElement::create(*this);
@@ -371,6 +371,12 @@
     HTMLDocument::dispose();
 }
 
+void ImageDocument::trace(Visitor* visitor)
+{
+    visitor->trace(m_imageElement);
+    HTMLDocument::trace(visitor);
+}
+
 // --------
 
 void ImageEventListener::handleEvent(ExecutionContext*, Event* event)
diff --git a/Source/core/html/ImageDocument.h b/Source/core/html/ImageDocument.h
index 896a462..c37eb47 100644
--- a/Source/core/html/ImageDocument.h
+++ b/Source/core/html/ImageDocument.h
@@ -35,9 +35,9 @@
 
 class ImageDocument FINAL : public HTMLDocument {
 public:
-    static PassRefPtr<ImageDocument> create(const DocumentInit& initializer = DocumentInit())
+    static PassRefPtrWillBeRawPtr<ImageDocument> create(const DocumentInit& initializer = DocumentInit())
     {
-        return adoptRef(new ImageDocument(initializer));
+        return adoptRefWillBeRefCountedGarbageCollected(new ImageDocument(initializer));
     }
 
     ImageResource* cachedImage();
@@ -47,8 +47,10 @@
     void imageUpdated();
     void imageClicked(int x, int y);
 
+    virtual void trace(Visitor*) OVERRIDE;
+
 private:
-    ImageDocument(const DocumentInit&);
+    explicit ImageDocument(const DocumentInit&);
 
     virtual PassRefPtr<DocumentParser> createParser() OVERRIDE;
     virtual void dispose() OVERRIDE;
@@ -60,7 +62,7 @@
     bool shouldShrinkToFit() const;
     float scale() const;
 
-    RefPtr<HTMLImageElement> m_imageElement;
+    RefPtrWillBeMember<HTMLImageElement> m_imageElement;
 
     // Whether enough of the image has been loaded to determine its size
     bool m_imageSizeIsKnown;
diff --git a/Source/core/html/LabelableElement.cpp b/Source/core/html/LabelableElement.cpp
index db86358..18cfa09 100644
--- a/Source/core/html/LabelableElement.cpp
+++ b/Source/core/html/LabelableElement.cpp
@@ -47,4 +47,9 @@
     return ensureRareData().ensureNodeLists().addCache<LabelsNodeList>(*this, LabelsNodeListType);
 }
 
+void LabelableElement::trace(Visitor* visitor)
+{
+    HTMLElement::trace(visitor);
+}
+
 } // namespace Webcore
diff --git a/Source/core/html/LabelableElement.h b/Source/core/html/LabelableElement.h
index 18f4408..ed9f62a 100644
--- a/Source/core/html/LabelableElement.h
+++ b/Source/core/html/LabelableElement.h
@@ -43,6 +43,8 @@
     PassRefPtr<NodeList> labels();
     virtual bool supportLabels() const { return false; }
 
+    virtual void trace(Visitor*) OVERRIDE;
+
 protected:
     LabelableElement(const QualifiedName& tagName, Document&);
 
diff --git a/Source/core/html/LinkManifest.cpp b/Source/core/html/LinkManifest.cpp
new file mode 100644
index 0000000..0915393
--- /dev/null
+++ b/Source/core/html/LinkManifest.cpp
@@ -0,0 +1,47 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "config.h"
+#include "core/html/LinkManifest.h"
+
+#include "core/dom/Document.h"
+#include "core/frame/LocalFrame.h"
+#include "core/html/HTMLLinkElement.h"
+#include "core/loader/FrameLoaderClient.h"
+
+namespace WebCore {
+
+PassOwnPtrWillBeRawPtr<LinkManifest> LinkManifest::create(HTMLLinkElement* owner)
+{
+    return adoptPtrWillBeNoop(new LinkManifest(owner));
+}
+
+LinkManifest::LinkManifest(HTMLLinkElement* owner)
+    : LinkResource(owner)
+{
+}
+
+LinkManifest::~LinkManifest()
+{
+}
+
+void LinkManifest::process()
+{
+    if (!m_owner || !m_owner->document().frame())
+        return;
+
+    m_owner->document().frame()->loader().client()->dispatchDidChangeManifest();
+}
+
+bool LinkManifest::hasLoaded() const
+{
+    return false;
+}
+
+void LinkManifest::ownerRemoved()
+{
+    process();
+}
+
+} // namespace WebCore
diff --git a/Source/core/html/LinkManifest.h b/Source/core/html/LinkManifest.h
new file mode 100644
index 0000000..c89b449
--- /dev/null
+++ b/Source/core/html/LinkManifest.h
@@ -0,0 +1,37 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef LinkManifest_h
+#define LinkManifest_h
+
+#include "core/html/LinkResource.h"
+#include "wtf/FastAllocBase.h"
+#include "wtf/PassOwnPtr.h"
+#include "wtf/RefPtr.h"
+
+namespace WebCore {
+
+class HTMLLinkElement;
+
+class LinkManifest FINAL : public LinkResource {
+    WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED;
+public:
+
+    static PassOwnPtrWillBeRawPtr<LinkManifest> create(HTMLLinkElement* owner);
+
+    virtual ~LinkManifest();
+
+    // LinkResource
+    virtual void process() OVERRIDE;
+    virtual Type type() const OVERRIDE { return Manifest; }
+    virtual bool hasLoaded() const OVERRIDE;
+    virtual void ownerRemoved() OVERRIDE;
+
+private:
+    explicit LinkManifest(HTMLLinkElement* owner);
+};
+
+}
+
+#endif // LinkManifest_h
diff --git a/Source/core/html/LinkRelAttribute.cpp b/Source/core/html/LinkRelAttribute.cpp
index ef4bcd7..5806733 100644
--- a/Source/core/html/LinkRelAttribute.cpp
+++ b/Source/core/html/LinkRelAttribute.cpp
@@ -46,6 +46,7 @@
     , m_isLinkPrerender(false)
     , m_isLinkNext(false)
     , m_isImport(false)
+    , m_isManifest(false)
 {
     if (rel.isEmpty())
         return;
@@ -84,6 +85,8 @@
         } else if (equalIgnoringCase(*it, "apple-touch-icon-precomposed")) {
             if (RuntimeEnabledFeatures::touchIconLoadingEnabled())
                 m_iconType = TouchPrecomposedIcon;
+        } else if (equalIgnoringCase(*it, "manifest")) {
+            m_isManifest = true;
         }
     }
 }
diff --git a/Source/core/html/LinkRelAttribute.h b/Source/core/html/LinkRelAttribute.h
index ec04cb3..cec301b 100644
--- a/Source/core/html/LinkRelAttribute.h
+++ b/Source/core/html/LinkRelAttribute.h
@@ -50,6 +50,7 @@
     bool isLinkPrerender() const { return m_isLinkPrerender; }
     bool isLinkNext() const { return m_isLinkNext; }
     bool isImport() const { return m_isImport; }
+    bool isManifest() const { return m_isManifest; }
 
 private:
     IconType m_iconType;
@@ -61,6 +62,7 @@
     bool m_isLinkPrerender : 1;
     bool m_isLinkNext : 1;
     bool m_isImport : 1;
+    bool m_isManifest : 1;
 };
 
 }
diff --git a/Source/core/html/LinkResource.cpp b/Source/core/html/LinkResource.cpp
index 9732646..f359848 100644
--- a/Source/core/html/LinkResource.cpp
+++ b/Source/core/html/LinkResource.cpp
@@ -61,6 +61,11 @@
     return import->frame();
 }
 
+void LinkResource::trace(Visitor* visitor)
+{
+    visitor->trace(m_owner);
+}
+
 LinkRequestBuilder::LinkRequestBuilder(HTMLLinkElement* owner)
     : m_owner(owner)
     , m_url(owner->getNonEmptyURLAttribute(hrefAttr))
diff --git a/Source/core/html/LinkResource.h b/Source/core/html/LinkResource.h
index 81e715a..ddd5e58 100644
--- a/Source/core/html/LinkResource.h
+++ b/Source/core/html/LinkResource.h
@@ -32,6 +32,7 @@
 #define LinkResource_h
 
 #include "core/fetch/FetchRequest.h"
+#include "platform/heap/Handle.h"
 #include "platform/weborigin/KURL.h"
 #include "wtf/text/WTFString.h"
 
@@ -39,12 +40,13 @@
 
 class HTMLLinkElement;
 
-class LinkResource {
-    WTF_MAKE_NONCOPYABLE(LinkResource); WTF_MAKE_FAST_ALLOCATED;
+class LinkResource : public NoBaseWillBeGarbageCollectedFinalized<LinkResource>  {
+    WTF_MAKE_NONCOPYABLE(LinkResource); WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED;
 public:
     enum Type {
         Style,
-        Import
+        Import,
+        Manifest
     };
 
     explicit LinkResource(HTMLLinkElement*);
@@ -58,8 +60,10 @@
     virtual void ownerRemoved() { }
     virtual bool hasLoaded() const = 0;
 
+    virtual void trace(Visitor*);
+
 protected:
-    HTMLLinkElement* m_owner;
+    RawPtrWillBeMember<HTMLLinkElement> m_owner;
 };
 
 class LinkRequestBuilder {
diff --git a/Source/core/html/MediaController.cpp b/Source/core/html/MediaController.cpp
index bd8e259..8eae382 100644
--- a/Source/core/html/MediaController.cpp
+++ b/Source/core/html/MediaController.cpp
@@ -156,12 +156,6 @@
 
 void MediaController::setCurrentTime(double time, ExceptionState& exceptionState)
 {
-    // FIXME: generated bindings should check isfinite: http://crbug.com/354298
-    if (!std::isfinite(time)) {
-        exceptionState.throwTypeError(ExceptionMessages::notAFiniteNumber(time));
-        return;
-    }
-
     // When the user agent is to seek the media controller to a particular new playback position,
     // it must follow these steps:
     // If the new playback position is less than zero, then set it to zero.
@@ -221,14 +215,8 @@
     reportControllerState();
 }
 
-void MediaController::setDefaultPlaybackRate(double rate, ExceptionState& exceptionState)
+void MediaController::setDefaultPlaybackRate(double rate)
 {
-    // FIXME: generated bindings should check isfinite: http://crbug.com/354298
-    if (!std::isfinite(rate)) {
-        exceptionState.throwTypeError(ExceptionMessages::notAFiniteNumber(rate));
-        return;
-    }
-
     if (m_defaultPlaybackRate == rate)
         return;
 
@@ -245,14 +233,8 @@
     return m_clock->playRate();
 }
 
-void MediaController::setPlaybackRate(double rate, ExceptionState& exceptionState)
+void MediaController::setPlaybackRate(double rate)
 {
-    // FIXME: generated bindings should check isfinite: http://crbug.com/354298
-    if (!std::isfinite(rate)) {
-        exceptionState.throwTypeError(ExceptionMessages::notAFiniteNumber(rate));
-        return;
-    }
-
     if (m_clock->playRate() == rate)
         return;
 
@@ -269,12 +251,6 @@
 
 void MediaController::setVolume(double level, ExceptionState& exceptionState)
 {
-    // FIXME: generated bindings should check isfinite: http://crbug.com/354298
-    if (!std::isfinite(level)) {
-        exceptionState.throwTypeError(ExceptionMessages::notAFiniteNumber(level));
-        return;
-    }
-
     if (m_volume == level)
         return;
 
diff --git a/Source/core/html/MediaController.h b/Source/core/html/MediaController.h
index 472e6c3..5536b68 100644
--- a/Source/core/html/MediaController.h
+++ b/Source/core/html/MediaController.h
@@ -63,10 +63,10 @@
     void unpause();
 
     double defaultPlaybackRate() const { return m_defaultPlaybackRate; }
-    void setDefaultPlaybackRate(double, ExceptionState&);
+    void setDefaultPlaybackRate(double);
 
     double playbackRate() const;
-    void setPlaybackRate(double, ExceptionState&);
+    void setPlaybackRate(double);
 
     double volume() const { return m_volume; }
     void setVolume(double, ExceptionState&);
diff --git a/Source/core/html/MediaController.idl b/Source/core/html/MediaController.idl
index 5249938..8e70a8b 100644
--- a/Source/core/html/MediaController.idl
+++ b/Source/core/html/MediaController.idl
@@ -23,16 +23,18 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+// http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#mediacontroller
+
 [
     Constructor,
     ConstructorCallWith=ExecutionContext,
     RuntimeEnabled=MediaController,
+    TypeChecking=Unrestricted,
 ] interface MediaController : EventTarget {
     readonly attribute TimeRanges buffered;
     readonly attribute TimeRanges seekable;
 
     readonly attribute unrestricted double duration;
-    // FIXME: generated bindings should check isfinite: http://crbug.com/354298
     [RaisesException=Setter] attribute double currentTime;
 
     readonly attribute boolean paused;
@@ -42,8 +44,8 @@
     void pause();
     void unpause();
 
-    [RaisesException=Setter] attribute double defaultPlaybackRate;
-    [RaisesException=Setter] attribute double playbackRate;
+    attribute double defaultPlaybackRate;
+    attribute double playbackRate;
 
     [RaisesException=Setter] attribute double volume;
     attribute boolean muted;
diff --git a/Source/core/html/MediaDocument.h b/Source/core/html/MediaDocument.h
index b5d264e..a94ccf1 100644
--- a/Source/core/html/MediaDocument.h
+++ b/Source/core/html/MediaDocument.h
@@ -32,9 +32,9 @@
 
 class MediaDocument FINAL : public HTMLDocument {
 public:
-    static PassRefPtr<MediaDocument> create(const DocumentInit& initializer = DocumentInit())
+    static PassRefPtrWillBeRawPtr<MediaDocument> create(const DocumentInit& initializer = DocumentInit())
     {
-        return adoptRef(new MediaDocument(initializer));
+        return adoptRefWillBeRefCountedGarbageCollected(new MediaDocument(initializer));
     }
 
 private:
diff --git a/Source/core/html/PluginDocument.cpp b/Source/core/html/PluginDocument.cpp
index bad2dd2..002613c 100644
--- a/Source/core/html/PluginDocument.cpp
+++ b/Source/core/html/PluginDocument.cpp
@@ -84,12 +84,12 @@
     if (!frame->settings() || !frame->loader().allowPlugins(NotAboutToInstantiatePlugin))
         return;
 
-    RefPtr<HTMLHtmlElement> rootElement = HTMLHtmlElement::create(*document());
+    RefPtrWillBeRawPtr<HTMLHtmlElement> rootElement = HTMLHtmlElement::create(*document());
     rootElement->insertedByParser();
     document()->appendChild(rootElement);
     frame->loader().dispatchDocumentElementAvailable();
 
-    RefPtr<HTMLBodyElement> body = HTMLBodyElement::create(*document());
+    RefPtrWillBeRawPtr<HTMLBodyElement> body = HTMLBodyElement::create(*document());
     body->setAttribute(marginwidthAttr, "0");
     body->setAttribute(marginheightAttr, "0");
     body->setAttribute(styleAttr, "background-color: rgb(38,38,38)");
@@ -182,4 +182,10 @@
     HTMLDocument::detach(context);
 }
 
+void PluginDocument::trace(Visitor* visitor)
+{
+    visitor->trace(m_pluginNode);
+    HTMLDocument::trace(visitor);
+}
+
 }
diff --git a/Source/core/html/PluginDocument.h b/Source/core/html/PluginDocument.h
index 8c400b4..32760d3 100644
--- a/Source/core/html/PluginDocument.h
+++ b/Source/core/html/PluginDocument.h
@@ -34,9 +34,9 @@
 
 class PluginDocument FINAL : public HTMLDocument {
 public:
-    static PassRefPtr<PluginDocument> create(const DocumentInit& initializer = DocumentInit())
+    static PassRefPtrWillBeRawPtr<PluginDocument> create(const DocumentInit& initializer = DocumentInit())
     {
-        return adoptRef(new PluginDocument(initializer));
+        return adoptRefWillBeRefCountedGarbageCollected(new PluginDocument(initializer));
     }
 
     void setPluginNode(Node* pluginNode) { m_pluginNode = pluginNode; }
@@ -48,15 +48,17 @@
 
     bool shouldLoadPluginManually() { return m_shouldLoadPluginManually; }
 
+    virtual void trace(Visitor*) OVERRIDE;
+
 private:
-    PluginDocument(const DocumentInit&);
+    explicit PluginDocument(const DocumentInit&);
 
     virtual PassRefPtr<DocumentParser> createParser() OVERRIDE;
 
     void setShouldLoadPluginManually(bool loadManually) { m_shouldLoadPluginManually = loadManually; }
 
     bool m_shouldLoadPluginManually;
-    RefPtr<Node> m_pluginNode;
+    RefPtrWillBeMember<Node> m_pluginNode;
 };
 
 DEFINE_DOCUMENT_TYPE_CASTS(PluginDocument);
diff --git a/Source/core/html/TextDocument.h b/Source/core/html/TextDocument.h
index d554135..f7041b8 100644
--- a/Source/core/html/TextDocument.h
+++ b/Source/core/html/TextDocument.h
@@ -31,9 +31,9 @@
 
 class TextDocument FINAL : public HTMLDocument {
 public:
-    static PassRefPtr<TextDocument> create(const DocumentInit& initializer = DocumentInit())
+    static PassRefPtrWillBeRawPtr<TextDocument> create(const DocumentInit& initializer = DocumentInit())
     {
-        return adoptRef(new TextDocument(initializer));
+        return adoptRefWillBeRefCountedGarbageCollected(new TextDocument(initializer));
     }
 
 private:
diff --git a/Source/core/html/ValidityState.h b/Source/core/html/ValidityState.h
index 44d05b8..829cc4e 100644
--- a/Source/core/html/ValidityState.h
+++ b/Source/core/html/ValidityState.h
@@ -30,16 +30,20 @@
 
 namespace WebCore {
 
-class ValidityState : public ScriptWrappable {
-    WTF_MAKE_NONCOPYABLE(ValidityState); WTF_MAKE_FAST_ALLOCATED;
+class ValidityState : public NoBaseWillBeGarbageCollectedFinalized<ValidityState>, public ScriptWrappable {
+    WTF_MAKE_NONCOPYABLE(ValidityState);
+    WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED;
 public:
-    static PassOwnPtr<ValidityState> create(FormAssociatedElement* control)
+    static PassOwnPtrWillBeRawPtr<ValidityState> create(FormAssociatedElement* control)
     {
-        return adoptPtr(new ValidityState(control));
+        return adoptPtrWillBeNoop(new ValidityState(control));
     }
+    void trace(Visitor* visitor) { visitor->trace(m_control); }
 
+#if !ENABLE(OILPAN)
     void ref() { m_control->ref(); }
     void deref() { m_control->deref(); }
+#endif
 
     String validationMessage() const;
 
@@ -57,12 +61,12 @@
     bool valid() const;
 
 private:
-    ValidityState(FormAssociatedElement* control) : m_control(control)
+    explicit ValidityState(FormAssociatedElement* control) : m_control(control)
     {
         ScriptWrappable::init(this);
     }
 
-    FormAssociatedElement* m_control;
+    RawPtrWillBeMember<FormAssociatedElement> m_control;
 };
 
 } // namespace WebCore
diff --git a/Source/core/html/ValidityState.idl b/Source/core/html/ValidityState.idl
index 582baf9..d4f7253 100644
--- a/Source/core/html/ValidityState.idl
+++ b/Source/core/html/ValidityState.idl
@@ -21,6 +21,7 @@
  */
 
 [
+    WillBeGarbageCollected
 ] interface ValidityState {
     readonly attribute boolean         valueMissing;
     readonly attribute boolean         typeMismatch;
diff --git a/Source/core/html/canvas/CanvasRenderingContext2D.cpp b/Source/core/html/canvas/CanvasRenderingContext2D.cpp
index 3ab27ac..8456aba 100644
--- a/Source/core/html/canvas/CanvasRenderingContext2D.cpp
+++ b/Source/core/html/canvas/CanvasRenderingContext2D.cpp
@@ -934,18 +934,6 @@
     m_path.clear();
 }
 
-PassRefPtr<Path2D> CanvasRenderingContext2D::currentPath()
-{
-    return Path2D::create(m_path);
-}
-
-void CanvasRenderingContext2D::setCurrentPath(Path2D* path)
-{
-    if (!path)
-        return;
-    m_path = path->path();
-}
-
 static bool validateRectForCanvas(float& x, float& y, float& width, float& height)
 {
     if (!std::isfinite(x) | !std::isfinite(y) | !std::isfinite(width) | !std::isfinite(height))
diff --git a/Source/core/html/canvas/CanvasRenderingContext2D.h b/Source/core/html/canvas/CanvasRenderingContext2D.h
index c6760ea..27003eb 100644
--- a/Source/core/html/canvas/CanvasRenderingContext2D.h
+++ b/Source/core/html/canvas/CanvasRenderingContext2D.h
@@ -149,8 +149,6 @@
 
     void beginPath();
 
-    PassRefPtr<Path2D> currentPath();
-    void setCurrentPath(Path2D*);
     void fill(const String& winding = "nonzero");
     void fill(Path2D*, const String& winding = "nonzero");
     void stroke();
@@ -247,7 +245,7 @@
         // CSSFontSelectorClient implementation
         virtual void fontsNeedUpdate(CSSFontSelector*) OVERRIDE;
 
-        virtual void trace(Visitor*) OVERRIDE { }
+        virtual void trace(Visitor* visitor) OVERRIDE { CSSFontSelectorClient::trace(visitor); }
 
         unsigned m_unrealizedSaveCount;
 
diff --git a/Source/core/html/canvas/CanvasRenderingContext2D.idl b/Source/core/html/canvas/CanvasRenderingContext2D.idl
index 60baf9b..4aa31ca 100644
--- a/Source/core/html/canvas/CanvasRenderingContext2D.idl
+++ b/Source/core/html/canvas/CanvasRenderingContext2D.idl
@@ -26,7 +26,7 @@
 enum CanvasWindingRule { "nonzero", "evenodd" };
 
 [
-    TypeChecking=Unrestricted,
+    TypeChecking=Interface|Nullable|Unrestricted,
     WillBeGarbageCollected,
 ] interface CanvasRenderingContext2D {
 
@@ -35,7 +35,7 @@
     void save();
     void restore();
 
-    [TypeChecking=Interface|Nullable, RuntimeEnabled=ExperimentalCanvasFeatures] attribute SVGMatrix currentTransform;
+    [RuntimeEnabled=ExperimentalCanvasFeatures] attribute SVGMatrix currentTransform;
     void scale(unrestricted float sx, unrestricted float sy);
     void rotate(unrestricted float angle);
     void translate(unrestricted float tx, unrestricted float ty);
@@ -68,31 +68,29 @@
 
     void beginPath();
 
-    attribute Path2D currentPath;
-
     // FIXME: Simplify these using optional CanvasWindingRule once crbug.com/339000 gets fixed.
     void fill();
-    [RuntimeEnabled=Path2D, TypeChecking=Interface|Nullable] void fill(Path2D path);
-    [TypeChecking=Interface|Nullable] void fill(CanvasWindingRule winding);
-    [RuntimeEnabled=Path2D, TypeChecking=Interface|Nullable] void fill(Path2D path, CanvasWindingRule winding);
+    [RuntimeEnabled=Path2D] void fill(Path2D path);
+    void fill(CanvasWindingRule winding);
+    [RuntimeEnabled=Path2D] void fill(Path2D path, CanvasWindingRule winding);
     void stroke();
-    [RuntimeEnabled=Path2D, TypeChecking=Interface|Nullable] void stroke(Path2D path);
+    [RuntimeEnabled=Path2D] void stroke(Path2D path);
     // FIXME: Simplify these using optional CanvasWindingRule once crbug.com/339000 gets fixed.
     void clip();
-    [RuntimeEnabled=Path2D, TypeChecking=Interface|Nullable] void clip(Path2D path);
-    [TypeChecking=Interface|Nullable] void clip(CanvasWindingRule winding);
-    [RuntimeEnabled=Path2D, TypeChecking=Interface|Nullable] void clip(Path2D path, CanvasWindingRule winding);
+    [RuntimeEnabled=Path2D] void clip(Path2D path);
+    void clip(CanvasWindingRule winding);
+    [RuntimeEnabled=Path2D] void clip(Path2D path, CanvasWindingRule winding);
 
     // FIXME: Simplify these using optional CanvasWindingRule once crbug.com/339000 gets fixed.
     boolean isPointInPath(unrestricted float x, unrestricted float y);
-    [RuntimeEnabled=Path2D, TypeChecking=Interface|Nullable] boolean isPointInPath(Path2D path, unrestricted float x, unrestricted float y);
-    [TypeChecking=Interface|Nullable] boolean isPointInPath(unrestricted float x, unrestricted float y, CanvasWindingRule winding);
-    [RuntimeEnabled=Path2D, TypeChecking=Interface|Nullable] boolean isPointInPath(Path2D path, unrestricted float x, unrestricted float y, CanvasWindingRule winding);
+    [RuntimeEnabled=Path2D] boolean isPointInPath(Path2D path, unrestricted float x, unrestricted float y);
+    boolean isPointInPath(unrestricted float x, unrestricted float y, CanvasWindingRule winding);
+    [RuntimeEnabled=Path2D] boolean isPointInPath(Path2D path, unrestricted float x, unrestricted float y, CanvasWindingRule winding);
     boolean isPointInStroke(unrestricted float x, unrestricted float y);
-    [RuntimeEnabled=Path2D, TypeChecking=Interface|Nullable] boolean isPointInStroke(Path2D path, unrestricted float x, unrestricted float y);
+    [RuntimeEnabled=Path2D] boolean isPointInStroke(Path2D path, unrestricted float x, unrestricted float y);
 
     [RuntimeEnabled=ExperimentalCanvasFeatures] void scrollPathIntoView();
-    [RuntimeEnabled=ExperimentalCanvasFeatures, TypeChecking=Interface|Nullable] void scrollPathIntoView(Path2D path);
+    [RuntimeEnabled=ExperimentalCanvasFeatures] void scrollPathIntoView(Path2D path);
 
     // text
     attribute DOMString font;
@@ -109,26 +107,26 @@
 
     void strokeRect(unrestricted float x, unrestricted float y, unrestricted float width, unrestricted float height);
 
-    [RaisesException, TypeChecking=Interface|Nullable] void drawImage(HTMLImageElement image, unrestricted float x, unrestricted float y);
-    [RaisesException, TypeChecking=Interface|Nullable] void drawImage(HTMLImageElement image, unrestricted float x, unrestricted float y, unrestricted float width, unrestricted float height);
-    [RaisesException, TypeChecking=Interface|Nullable] void drawImage(HTMLImageElement image, unrestricted float sx, unrestricted float sy, unrestricted float sw, unrestricted float sh, unrestricted float dx, unrestricted float dy, unrestricted float dw, unrestricted float dh);
-    [RaisesException, TypeChecking=Interface|Nullable] void drawImage(HTMLCanvasElement canvas, unrestricted float x, unrestricted float y);
-    [RaisesException, TypeChecking=Interface|Nullable] void drawImage(HTMLCanvasElement canvas, unrestricted float x, unrestricted float y, unrestricted float width, unrestricted float height);
-    [RaisesException, TypeChecking=Interface|Nullable] void drawImage(HTMLCanvasElement canvas, unrestricted float sx, unrestricted float sy, unrestricted float sw, unrestricted float sh, unrestricted float dx, unrestricted float dy, unrestricted float dw, unrestricted float dh);
-    [RaisesException, TypeChecking=Interface|Nullable] void drawImage(HTMLVideoElement video, unrestricted float x, unrestricted float y);
-    [RaisesException, TypeChecking=Interface|Nullable] void drawImage(HTMLVideoElement video, unrestricted float x, unrestricted float y, unrestricted float width, unrestricted float height);
-    [RaisesException, TypeChecking=Interface|Nullable] void drawImage(HTMLVideoElement video, unrestricted float sx, unrestricted float sy, unrestricted float sw, unrestricted float sh, unrestricted float dx, unrestricted float dy, unrestricted float dw, unrestricted float dh);
-    [RuntimeEnabled=ExperimentalCanvasFeatures, RaisesException, TypeChecking=Interface|Nullable] void drawImage(ImageBitmap imageBitmap, unrestricted float x, unrestricted float y);
-    [RuntimeEnabled=ExperimentalCanvasFeatures, RaisesException, TypeChecking=Interface|Nullable] void drawImage(ImageBitmap imageBitmap, unrestricted float x, unrestricted float y, unrestricted float width, unrestricted float height);
-    [RuntimeEnabled=ExperimentalCanvasFeatures, RaisesException, TypeChecking=Interface|Nullable] void drawImage(ImageBitmap imageBitmap, unrestricted float sx, unrestricted float sy, unrestricted float sw, unrestricted float sh, unrestricted float dx, unrestricted float dy, unrestricted float dw, unrestricted float dh);
+    [RaisesException] void drawImage(HTMLImageElement image, unrestricted float x, unrestricted float y);
+    [RaisesException] void drawImage(HTMLImageElement image, unrestricted float x, unrestricted float y, unrestricted float width, unrestricted float height);
+    [RaisesException] void drawImage(HTMLImageElement image, unrestricted float sx, unrestricted float sy, unrestricted float sw, unrestricted float sh, unrestricted float dx, unrestricted float dy, unrestricted float dw, unrestricted float dh);
+    [RaisesException] void drawImage(HTMLCanvasElement canvas, unrestricted float x, unrestricted float y);
+    [RaisesException] void drawImage(HTMLCanvasElement canvas, unrestricted float x, unrestricted float y, unrestricted float width, unrestricted float height);
+    [RaisesException] void drawImage(HTMLCanvasElement canvas, unrestricted float sx, unrestricted float sy, unrestricted float sw, unrestricted float sh, unrestricted float dx, unrestricted float dy, unrestricted float dw, unrestricted float dh);
+    [RaisesException] void drawImage(HTMLVideoElement video, unrestricted float x, unrestricted float y);
+    [RaisesException] void drawImage(HTMLVideoElement video, unrestricted float x, unrestricted float y, unrestricted float width, unrestricted float height);
+    [RaisesException] void drawImage(HTMLVideoElement video, unrestricted float sx, unrestricted float sy, unrestricted float sw, unrestricted float sh, unrestricted float dx, unrestricted float dy, unrestricted float dw, unrestricted float dh);
+    [RuntimeEnabled=ExperimentalCanvasFeatures, RaisesException] void drawImage(ImageBitmap imageBitmap, unrestricted float x, unrestricted float y);
+    [RuntimeEnabled=ExperimentalCanvasFeatures, RaisesException] void drawImage(ImageBitmap imageBitmap, unrestricted float x, unrestricted float y, unrestricted float width, unrestricted float height);
+    [RuntimeEnabled=ExperimentalCanvasFeatures, RaisesException] void drawImage(ImageBitmap imageBitmap, unrestricted float sx, unrestricted float sy, unrestricted float sw, unrestricted float sh, unrestricted float dx, unrestricted float dy, unrestricted float dw, unrestricted float dh);
 
-    [TypeChecking=Interface|Nullable] void putImageData(ImageData imagedata, float dx, float dy);
-    [TypeChecking=Interface|Nullable] void putImageData(ImageData imagedata, float dx, float dy, float dirtyX, float dirtyY, float dirtyWidth, float dirtyHeight);
+    void putImageData(ImageData imagedata, float dx, float dy);
+    void putImageData(ImageData imagedata, float dx, float dy, float dirtyX, float dirtyY, float dirtyWidth, float dirtyHeight);
 
-    [RaisesException, TypeChecking=Interface|Nullable] CanvasPattern createPattern(HTMLCanvasElement canvas, [TreatNullAs=NullString] DOMString repetitionType);
-    [RaisesException, TypeChecking=Interface|Nullable] CanvasPattern createPattern(HTMLImageElement image, [TreatNullAs=NullString] DOMString repetitionType);
-    [RaisesException, TypeChecking=Interface|Nullable] CanvasPattern createPattern(HTMLVideoElement image, [TreatNullAs=NullString] DOMString repetitionType);
-    [TypeChecking=Interface|Nullable] ImageData createImageData(ImageData imagedata);
+    [RaisesException] CanvasPattern createPattern(HTMLCanvasElement canvas, [TreatNullAs=NullString] DOMString repetitionType);
+    [RaisesException] CanvasPattern createPattern(HTMLImageElement image, [TreatNullAs=NullString] DOMString repetitionType);
+    [RaisesException] CanvasPattern createPattern(HTMLVideoElement image, [TreatNullAs=NullString] DOMString repetitionType);
+    ImageData createImageData(ImageData imagedata);
     [RaisesException] ImageData createImageData(float sw, float sh);
 
     [Custom] attribute object strokeStyle;
@@ -138,9 +136,9 @@
     [RaisesException] ImageData getImageData(float sx, float sy, float sw, float sh);
 
     // Focus rings
-    [RuntimeEnabled=ExperimentalCanvasFeatures, TypeChecking=Interface|Nullable] void drawFocusIfNeeded(Element element);
-    [RuntimeEnabled=ExperimentalCanvasFeatures, TypeChecking=Interface|Nullable] void drawFocusIfNeeded(Path2D path, Element element);
-    [RuntimeEnabled=ExperimentalCanvasFeatures, TypeChecking=Interface|Nullable] boolean drawCustomFocusRing(Element element);
+    [RuntimeEnabled=ExperimentalCanvasFeatures] void drawFocusIfNeeded(Element element);
+    [RuntimeEnabled=ExperimentalCanvasFeatures] void drawFocusIfNeeded(Path2D path, Element element);
+    [RuntimeEnabled=ExperimentalCanvasFeatures] boolean drawCustomFocusRing(Element element);
 
     [ImplementedAs=imageSmoothingEnabled, MeasureAs=PrefixedImageSmoothingEnabled] attribute boolean webkitImageSmoothingEnabled;
     [MeasureAs=UnprefixedImageSmoothingEnabled] attribute boolean imageSmoothingEnabled;
@@ -163,7 +161,7 @@
     [MeasureAs=CanvasRenderingContext2DSetFillColor] void setFillColor(unrestricted float grayLevel, optional unrestricted float alpha);
     [MeasureAs=CanvasRenderingContext2DSetFillColor] void setFillColor(unrestricted float r, unrestricted float g, unrestricted float b, unrestricted float a);
     [MeasureAs=CanvasRenderingContext2DSetFillColor] void setFillColor(unrestricted float c, unrestricted float m, unrestricted float y, unrestricted float k, unrestricted float a);
-    [TypeChecking=Interface|Nullable, MeasureAs=CanvasRenderingContext2DDrawImageFromRect] void drawImageFromRect(
+    [MeasureAs=CanvasRenderingContext2DDrawImageFromRect] void drawImageFromRect(
         HTMLImageElement? image, optional unrestricted float sx, optional unrestricted float sy, optional unrestricted float sw, optional unrestricted float sh,
         optional unrestricted float dx, optional unrestricted float dy, optional unrestricted float dw, optional unrestricted float dh, optional DOMString compositeOperation);
     [MeasureAs=CanvasRenderingContext2DSetShadow] void setShadow(unrestricted float width, unrestricted float height, unrestricted float blur, [LegacyOverloadString] optional DOMString color, optional unrestricted float alpha);
diff --git a/Source/core/html/canvas/DataView.idl b/Source/core/html/canvas/DataView.idl
index 67d708b..4fc8961 100644
--- a/Source/core/html/canvas/DataView.idl
+++ b/Source/core/html/canvas/DataView.idl
@@ -26,7 +26,7 @@
 [
     Custom=Wrap,
     CustomConstructor(ArrayBuffer buffer, optional unsigned long byteOffset, optional unsigned long byteLength),
-    GlobalContext=Window&WorkerGlobalScope,
+    Exposed=Window&Worker,
     TypeChecking=Interface|Nullable,
 ] interface DataView : ArrayBufferView {
     // All these methods raise an exception if they would read or write beyond the end of the view.
diff --git a/Source/core/html/canvas/WebGLRenderingContextBase.idl b/Source/core/html/canvas/WebGLRenderingContextBase.idl
index 6841cbc..470fa50 100644
--- a/Source/core/html/canvas/WebGLRenderingContextBase.idl
+++ b/Source/core/html/canvas/WebGLRenderingContextBase.idl
@@ -35,16 +35,15 @@
 typedef octet          GLubyte; // 'octet' should be an unsigned 8 bit type.
 typedef unsigned short GLushort;
 typedef unsigned long  GLuint;
-// FIXME: Should be unrestricted: http://crbug.com/354298
-typedef /*unrestricted*/ float GLfloat;
-typedef /*unrestricted*/ float GLclampf;
+typedef unrestricted float GLfloat;
+typedef unrestricted float GLclampf;
 
 [
     // FIXME: [DoNotCheckConstants] and [TypeChecking=Interface|Nullable] should be applied
     // to members and not need to be put on implementing interface
     // DoNotCheckConstants, // need to put on implementing interface
     NoInterfaceObject, // Always used on target of 'implements'
-    // TypeChecking=Interface|Nullable, // need to put on implementing interface
+    // TypeChecking=Interface|Nullable|Unrestricted, // need to put on implementing interface
 ] interface WebGLRenderingContextBase {
 
     readonly attribute HTMLCanvasElement canvas;
diff --git a/Source/core/html/forms/BaseCheckableInputType.cpp b/Source/core/html/forms/BaseCheckableInputType.cpp
index 7ffe40b..a898183 100644
--- a/Source/core/html/forms/BaseCheckableInputType.cpp
+++ b/Source/core/html/forms/BaseCheckableInputType.cpp
@@ -111,4 +111,9 @@
     return true;
 }
 
+bool BaseCheckableInputType::shouldDispatchFormControlChangeEvent(String& oldValue, String& newValue)
+{
+    return oldValue != newValue;
+}
+
 } // namespace WebCore
diff --git a/Source/core/html/forms/BaseCheckableInputType.h b/Source/core/html/forms/BaseCheckableInputType.h
index 1e8a665..aeb6ee2 100644
--- a/Source/core/html/forms/BaseCheckableInputType.h
+++ b/Source/core/html/forms/BaseCheckableInputType.h
@@ -52,6 +52,7 @@
     virtual bool storesValueSeparateFromAttribute() OVERRIDE FINAL;
     virtual void setValue(const String&, bool, TextFieldEventBehavior) OVERRIDE FINAL;
     virtual bool isCheckable() OVERRIDE FINAL;
+    virtual bool shouldDispatchFormControlChangeEvent(String&, String&) OVERRIDE;
 };
 
 } // namespace WebCore
diff --git a/Source/core/html/forms/BaseMultipleFieldsDateAndTimeInputType.cpp b/Source/core/html/forms/BaseMultipleFieldsDateAndTimeInputType.cpp
index 80db48e..2d77463e 100644
--- a/Source/core/html/forms/BaseMultipleFieldsDateAndTimeInputType.cpp
+++ b/Source/core/html/forms/BaseMultipleFieldsDateAndTimeInputType.cpp
@@ -521,6 +521,8 @@
 
     setupLayoutParameters(layoutParameters, date);
 
+    DEFINE_STATIC_LOCAL(AtomicString, datetimeformatAttr, ("datetimeformat", AtomicString::ConstructFromLiteral));
+    edit->setAttribute(datetimeformatAttr, AtomicString(layoutParameters.dateTimeFormat), ASSERT_NO_EXCEPTION);
     const AtomicString pattern = edit->fastGetAttribute(HTMLNames::patternAttr);
     if (!pattern.isEmpty())
         layoutParameters.dateTimeFormat = pattern;
diff --git a/Source/core/html/forms/BaseMultipleFieldsDateAndTimeInputType.h b/Source/core/html/forms/BaseMultipleFieldsDateAndTimeInputType.h
index 70ee1ae..4867175 100644
--- a/Source/core/html/forms/BaseMultipleFieldsDateAndTimeInputType.h
+++ b/Source/core/html/forms/BaseMultipleFieldsDateAndTimeInputType.h
@@ -49,6 +49,8 @@
     , protected PickerIndicatorElement::PickerIndicatorOwner
     , protected SpinButtonElement::SpinButtonOwner
     , protected ClearButtonElement::ClearButtonOwner {
+    WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(BaseMultipleFieldsDateAndTimeInputType);
+
 public:
     virtual bool isValidFormat(bool hasYear, bool hasMonth, bool hasWeek, bool hasDay, bool hasAMPM, bool hasHour, bool hasMinute, bool hasSecond) const = 0;
 
diff --git a/Source/core/html/forms/ButtonInputType.cpp b/Source/core/html/forms/ButtonInputType.cpp
index 39e112c..0dd4316 100644
--- a/Source/core/html/forms/ButtonInputType.cpp
+++ b/Source/core/html/forms/ButtonInputType.cpp
@@ -36,9 +36,9 @@
 
 namespace WebCore {
 
-PassRefPtr<InputType> ButtonInputType::create(HTMLInputElement& element)
+PassRefPtrWillBeRawPtr<InputType> ButtonInputType::create(HTMLInputElement& element)
 {
-    return adoptRef(new ButtonInputType(element));
+    return adoptRefWillBeNoop(new ButtonInputType(element));
 }
 
 const AtomicString& ButtonInputType::formControlType() const
diff --git a/Source/core/html/forms/ButtonInputType.h b/Source/core/html/forms/ButtonInputType.h
index 68e2f28..5b18771 100644
--- a/Source/core/html/forms/ButtonInputType.h
+++ b/Source/core/html/forms/ButtonInputType.h
@@ -37,7 +37,7 @@
 
 class ButtonInputType FINAL : public BaseButtonInputType {
 public:
-    static PassRefPtr<InputType> create(HTMLInputElement&);
+    static PassRefPtrWillBeRawPtr<InputType> create(HTMLInputElement&);
 
 private:
     ButtonInputType(HTMLInputElement& element) : BaseButtonInputType(element) { }
diff --git a/Source/core/html/forms/CheckboxInputType.cpp b/Source/core/html/forms/CheckboxInputType.cpp
index 738f9d5..9e2dcd7 100644
--- a/Source/core/html/forms/CheckboxInputType.cpp
+++ b/Source/core/html/forms/CheckboxInputType.cpp
@@ -40,9 +40,9 @@
 
 namespace WebCore {
 
-PassRefPtr<InputType> CheckboxInputType::create(HTMLInputElement& element)
+PassRefPtrWillBeRawPtr<InputType> CheckboxInputType::create(HTMLInputElement& element)
 {
-    return adoptRef(new CheckboxInputType(element));
+    return adoptRefWillBeNoop(new CheckboxInputType(element));
 }
 
 const AtomicString& CheckboxInputType::formControlType() const
diff --git a/Source/core/html/forms/CheckboxInputType.h b/Source/core/html/forms/CheckboxInputType.h
index e6d15d7..3bb11c0 100644
--- a/Source/core/html/forms/CheckboxInputType.h
+++ b/Source/core/html/forms/CheckboxInputType.h
@@ -37,7 +37,7 @@
 
 class CheckboxInputType FINAL : public BaseCheckableInputType {
 public:
-    static PassRefPtr<InputType> create(HTMLInputElement&);
+    static PassRefPtrWillBeRawPtr<InputType> create(HTMLInputElement&);
 
 private:
     CheckboxInputType(HTMLInputElement& element) : BaseCheckableInputType(element) { }
diff --git a/Source/core/html/forms/ColorInputType.cpp b/Source/core/html/forms/ColorInputType.cpp
index 0cb79dc..08151e1 100644
--- a/Source/core/html/forms/ColorInputType.cpp
+++ b/Source/core/html/forms/ColorInputType.cpp
@@ -72,9 +72,9 @@
     return color.setFromString(value) && !color.hasAlpha();
 }
 
-PassRefPtr<InputType> ColorInputType::create(HTMLInputElement& element)
+PassRefPtrWillBeRawPtr<InputType> ColorInputType::create(HTMLInputElement& element)
 {
-    return adoptRef(new ColorInputType(element));
+    return adoptRefWillBeNoop(new ColorInputType(element));
 }
 
 ColorInputType::~ColorInputType()
diff --git a/Source/core/html/forms/ColorInputType.h b/Source/core/html/forms/ColorInputType.h
index a35abd2..d3ee55c 100644
--- a/Source/core/html/forms/ColorInputType.h
+++ b/Source/core/html/forms/ColorInputType.h
@@ -38,7 +38,7 @@
 
 class ColorInputType FINAL : public BaseClickableWithKeyInputType, public ColorChooserClient {
 public:
-    static PassRefPtr<InputType> create(HTMLInputElement&);
+    static PassRefPtrWillBeRawPtr<InputType> create(HTMLInputElement&);
     virtual ~ColorInputType();
 
     // ColorChooserClient implementation.
diff --git a/Source/core/html/forms/DateInputType.cpp b/Source/core/html/forms/DateInputType.cpp
index 148881e..f870ad7 100644
--- a/Source/core/html/forms/DateInputType.cpp
+++ b/Source/core/html/forms/DateInputType.cpp
@@ -53,9 +53,9 @@
 {
 }
 
-PassRefPtr<InputType> DateInputType::create(HTMLInputElement& element)
+PassRefPtrWillBeRawPtr<InputType> DateInputType::create(HTMLInputElement& element)
 {
-    return adoptRef(new DateInputType(element));
+    return adoptRefWillBeNoop(new DateInputType(element));
 }
 
 void DateInputType::countUsage()
diff --git a/Source/core/html/forms/DateInputType.h b/Source/core/html/forms/DateInputType.h
index 0e5abec..1583a2b 100644
--- a/Source/core/html/forms/DateInputType.h
+++ b/Source/core/html/forms/DateInputType.h
@@ -46,7 +46,7 @@
 
 class DateInputType FINAL : public BaseDateInputType {
 public:
-    static PassRefPtr<InputType> create(HTMLInputElement&);
+    static PassRefPtrWillBeRawPtr<InputType> create(HTMLInputElement&);
 
 private:
     DateInputType(HTMLInputElement&);
diff --git a/Source/core/html/forms/DateTimeLocalInputType.cpp b/Source/core/html/forms/DateTimeLocalInputType.cpp
index ae901a1..34c8e58 100644
--- a/Source/core/html/forms/DateTimeLocalInputType.cpp
+++ b/Source/core/html/forms/DateTimeLocalInputType.cpp
@@ -50,9 +50,9 @@
 static const int dateTimeLocalDefaultStepBase = 0;
 static const int dateTimeLocalStepScaleFactor = 1000;
 
-PassRefPtr<InputType> DateTimeLocalInputType::create(HTMLInputElement& element)
+PassRefPtrWillBeRawPtr<InputType> DateTimeLocalInputType::create(HTMLInputElement& element)
 {
-    return adoptRef(new DateTimeLocalInputType(element));
+    return adoptRefWillBeNoop(new DateTimeLocalInputType(element));
 }
 
 void DateTimeLocalInputType::countUsage()
diff --git a/Source/core/html/forms/DateTimeLocalInputType.h b/Source/core/html/forms/DateTimeLocalInputType.h
index f3fc386..8fb2f5e 100644
--- a/Source/core/html/forms/DateTimeLocalInputType.h
+++ b/Source/core/html/forms/DateTimeLocalInputType.h
@@ -46,7 +46,7 @@
 
 class DateTimeLocalInputType FINAL : public BaseDateTimeLocalInputType {
 public:
-    static PassRefPtr<InputType> create(HTMLInputElement&);
+    static PassRefPtrWillBeRawPtr<InputType> create(HTMLInputElement&);
 
 private:
     DateTimeLocalInputType(HTMLInputElement& element) : BaseDateTimeLocalInputType(element) { }
diff --git a/Source/core/html/forms/EmailInputType.cpp b/Source/core/html/forms/EmailInputType.cpp
index 968df8c..f3a4a1f 100644
--- a/Source/core/html/forms/EmailInputType.cpp
+++ b/Source/core/html/forms/EmailInputType.cpp
@@ -134,9 +134,9 @@
     return !matchOffset && matchLength == addressLength;
 }
 
-PassRefPtr<InputType> EmailInputType::create(HTMLInputElement& element)
+PassRefPtrWillBeRawPtr<InputType> EmailInputType::create(HTMLInputElement& element)
 {
-    return adoptRef(new EmailInputType(element));
+    return adoptRefWillBeNoop(new EmailInputType(element));
 }
 
 void EmailInputType::countUsage()
diff --git a/Source/core/html/forms/EmailInputType.h b/Source/core/html/forms/EmailInputType.h
index 1cfc7f9..230586f 100644
--- a/Source/core/html/forms/EmailInputType.h
+++ b/Source/core/html/forms/EmailInputType.h
@@ -37,7 +37,7 @@
 
 class EmailInputType FINAL : public BaseTextInputType {
 public:
-    static PassRefPtr<InputType> create(HTMLInputElement&);
+    static PassRefPtrWillBeRawPtr<InputType> create(HTMLInputElement&);
 
 private:
     EmailInputType(HTMLInputElement& element) : BaseTextInputType(element) { }
diff --git a/Source/core/html/forms/FileInputType.cpp b/Source/core/html/forms/FileInputType.cpp
index 2fbd187..980d293 100644
--- a/Source/core/html/forms/FileInputType.cpp
+++ b/Source/core/html/forms/FileInputType.cpp
@@ -54,9 +54,15 @@
 {
 }
 
-PassRefPtr<InputType> FileInputType::create(HTMLInputElement& element)
+PassRefPtrWillBeRawPtr<InputType> FileInputType::create(HTMLInputElement& element)
 {
-    return adoptRef(new FileInputType(element));
+    return adoptRefWillBeNoop(new FileInputType(element));
+}
+
+void FileInputType::trace(Visitor* visitor)
+{
+    visitor->trace(m_fileList);
+    BaseClickableWithKeyInputType::trace(visitor);
 }
 
 Vector<FileChooserFileInfo> FileInputType::filesFromFormControlState(const FormControlState& state)
@@ -360,6 +366,18 @@
     return m_droppedFileSystemId;
 }
 
+void FileInputType::copyNonAttributeProperties(const HTMLInputElement& sourceElement)
+{
+    RefPtrWillBeRawPtr<FileList> fileList(FileList::create());
+    FileList* sourceFileList = sourceElement.files();
+    unsigned size = sourceFileList->length();
+    for (unsigned i = 0; i < size; ++i) {
+        File* file = sourceFileList->item(i);
+        fileList->append(File::createWithRelativePath(file->path(), file->webkitRelativePath()));
+    }
+    setFiles(fileList.release());
+}
+
 String FileInputType::defaultToolTip() const
 {
     FileList* fileList = m_fileList.get();
diff --git a/Source/core/html/forms/FileInputType.h b/Source/core/html/forms/FileInputType.h
index 6214e8f..90721d0 100644
--- a/Source/core/html/forms/FileInputType.h
+++ b/Source/core/html/forms/FileInputType.h
@@ -44,7 +44,8 @@
 
 class FileInputType FINAL : public BaseClickableWithKeyInputType, private FileChooserClient {
 public:
-    static PassRefPtr<InputType> create(HTMLInputElement&);
+    static PassRefPtrWillBeRawPtr<InputType> create(HTMLInputElement&);
+    virtual void trace(Visitor*) OVERRIDE;
     static Vector<FileChooserFileInfo> filesFromFormControlState(const FormControlState&);
 
 private:
@@ -65,6 +66,7 @@
     virtual void setValue(const String&, bool valueChanged, TextFieldEventBehavior) OVERRIDE;
     virtual bool receiveDroppedFiles(const DragData*) OVERRIDE;
     virtual String droppedFileSystemId() OVERRIDE;
+    virtual void copyNonAttributeProperties(const HTMLInputElement&) OVERRIDE;
     virtual bool isFileUpload() const OVERRIDE;
     virtual void createShadowSubtree() OVERRIDE;
     virtual void disabledAttributeChanged() OVERRIDE;
@@ -77,7 +79,7 @@
     PassRefPtrWillBeRawPtr<FileList> createFileList(const Vector<FileChooserFileInfo>& files) const;
     void receiveDropForDirectoryUpload(const Vector<String>&);
 
-    RefPtrWillBePersistent<FileList> m_fileList;
+    RefPtrWillBeMember<FileList> m_fileList;
 
     String m_droppedFileSystemId;
 };
diff --git a/Source/core/html/forms/FormController.cpp b/Source/core/html/forms/FormController.cpp
index d7c6b30..fa7e901 100644
--- a/Source/core/html/forms/FormController.cpp
+++ b/Source/core/html/forms/FormController.cpp
@@ -310,7 +310,7 @@
 {
     // 2 is enough to distinguish forms in webkit.org/b/91209#c0
     const size_t namedControlsToBeRecorded = 2;
-    const Vector<FormAssociatedElement*>& controls = form.associatedElements();
+    const FormAssociatedElement::List& controls = form.associatedElements();
     builder.append(" [");
     for (size_t i = 0, namedControls = 0; i < controls.size() && namedControls < namedControlsToBeRecorded; ++i) {
         if (!controls[i]->isFormControlElementWithState())
@@ -374,15 +374,20 @@
 
 // ----------------------------------------------------------------------------
 
-PassRefPtr<DocumentState> DocumentState::create()
+PassRefPtrWillBeRawPtr<DocumentState> DocumentState::create()
 {
-    return adoptRef(new DocumentState);
+    return adoptRefWillBeNoop(new DocumentState);
 }
 
 DocumentState::~DocumentState()
 {
 }
 
+void DocumentState::trace(Visitor* visitor)
+{
+    visitor->trace(m_formControls);
+}
+
 void DocumentState::addControl(HTMLFormControlElementWithState* control)
 {
     ASSERT(!m_formControls.contains(control));
@@ -443,6 +448,11 @@
 {
 }
 
+void FormController::trace(Visitor* visitor)
+{
+    visitor->trace(m_documentState);
+}
+
 DocumentState* FormController::formElementsState() const
 {
     return m_documentState.get();
@@ -511,7 +521,7 @@
 
 void FormController::restoreControlStateIn(HTMLFormElement& form)
 {
-    const Vector<FormAssociatedElement*>& elements = form.associatedElements();
+    const FormAssociatedElement::List& elements = form.associatedElements();
     for (size_t i = 0; i < elements.size(); ++i) {
         if (!elements[i]->isFormControlElementWithState())
             continue;
diff --git a/Source/core/html/forms/FormController.h b/Source/core/html/forms/FormController.h
index 40505d3..d2e1586 100644
--- a/Source/core/html/forms/FormController.h
+++ b/Source/core/html/forms/FormController.h
@@ -23,6 +23,7 @@
 #define FormController_h
 
 #include "core/html/forms/RadioButtonGroupScope.h"
+#include "platform/heap/Handle.h"
 #include "wtf/Forward.h"
 #include "wtf/ListHashSet.h"
 #include "wtf/Vector.h"
@@ -73,28 +74,30 @@
 
 typedef HashMap<AtomicString, OwnPtr<SavedFormState> > SavedFormStateMap;
 
-class DocumentState : public RefCounted<DocumentState> {
+class DocumentState : public RefCountedWillBeGarbageCollectedFinalized<DocumentState> {
 public:
-    static PassRefPtr<DocumentState> create();
+    static PassRefPtrWillBeRawPtr<DocumentState> create();
     ~DocumentState();
+    void trace(Visitor*);
 
     void addControl(HTMLFormControlElementWithState*);
     void removeControl(HTMLFormControlElementWithState*);
     Vector<String> toStateVector();
 
 private:
-    typedef ListHashSet<RefPtr<HTMLFormControlElementWithState>, 64> FormElementListHashSet;
+    typedef WillBeHeapListHashSet<RefPtrWillBeMember<HTMLFormControlElementWithState>, 64> FormElementListHashSet;
     FormElementListHashSet m_formControls;
 };
 
-class FormController {
-    WTF_MAKE_FAST_ALLOCATED;
+class FormController : public NoBaseWillBeGarbageCollectedFinalized<FormController> {
+    WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED;
 public:
-    static PassOwnPtr<FormController> create()
+    static PassOwnPtrWillBeRawPtr<FormController> create()
     {
-        return adoptPtr(new FormController);
+        return adoptPtrWillBeNoop(new FormController);
     }
     ~FormController();
+    void trace(Visitor*);
 
     RadioButtonGroupScope& radioButtonGroupScope() { return m_radioButtonGroupScope; }
 
@@ -116,7 +119,7 @@
     static void formStatesFromStateVector(const Vector<String>&, SavedFormStateMap&);
 
     RadioButtonGroupScope m_radioButtonGroupScope;
-    RefPtr<DocumentState> m_documentState;
+    RefPtrWillBeMember<DocumentState> m_documentState;
     SavedFormStateMap m_savedFormStateMap;
     OwnPtr<FormKeyGenerator> m_formKeyGenerator;
 };
diff --git a/Source/core/html/forms/HiddenInputType.cpp b/Source/core/html/forms/HiddenInputType.cpp
index 7609742..e768298 100644
--- a/Source/core/html/forms/HiddenInputType.cpp
+++ b/Source/core/html/forms/HiddenInputType.cpp
@@ -43,9 +43,9 @@
 
 using namespace HTMLNames;
 
-PassRefPtr<InputType> HiddenInputType::create(HTMLInputElement& element)
+PassRefPtrWillBeRawPtr<InputType> HiddenInputType::create(HTMLInputElement& element)
 {
-    return adoptRef(new HiddenInputType(element));
+    return adoptRefWillBeNoop(new HiddenInputType(element));
 }
 
 const AtomicString& HiddenInputType::formControlType() const
diff --git a/Source/core/html/forms/HiddenInputType.h b/Source/core/html/forms/HiddenInputType.h
index 4670459..70eeeb8 100644
--- a/Source/core/html/forms/HiddenInputType.h
+++ b/Source/core/html/forms/HiddenInputType.h
@@ -37,7 +37,7 @@
 
 class HiddenInputType FINAL : public InputType {
 public:
-    static PassRefPtr<InputType> create(HTMLInputElement&);
+    static PassRefPtrWillBeRawPtr<InputType> create(HTMLInputElement&);
 
 private:
     HiddenInputType(HTMLInputElement& element) : InputType(element) { }
diff --git a/Source/core/html/forms/ImageInputType.cpp b/Source/core/html/forms/ImageInputType.cpp
index 23c89d8..d5dcf5c 100644
--- a/Source/core/html/forms/ImageInputType.cpp
+++ b/Source/core/html/forms/ImageInputType.cpp
@@ -45,9 +45,9 @@
 {
 }
 
-PassRefPtr<InputType> ImageInputType::create(HTMLInputElement& element)
+PassRefPtrWillBeRawPtr<InputType> ImageInputType::create(HTMLInputElement& element)
 {
-    return adoptRef(new ImageInputType(element));
+    return adoptRefWillBeNoop(new ImageInputType(element));
 }
 
 const AtomicString& ImageInputType::formControlType() const
diff --git a/Source/core/html/forms/ImageInputType.h b/Source/core/html/forms/ImageInputType.h
index d3a1ffa..a81356d 100644
--- a/Source/core/html/forms/ImageInputType.h
+++ b/Source/core/html/forms/ImageInputType.h
@@ -40,7 +40,7 @@
 
 class ImageInputType FINAL : public BaseButtonInputType {
 public:
-    static PassRefPtr<InputType> create(HTMLInputElement&);
+    static PassRefPtrWillBeRawPtr<InputType> create(HTMLInputElement&);
 
 private:
     ImageInputType(HTMLInputElement&);
diff --git a/Source/core/html/forms/InputType.cpp b/Source/core/html/forms/InputType.cpp
index 7b71422..db88583 100644
--- a/Source/core/html/forms/InputType.cpp
+++ b/Source/core/html/forms/InputType.cpp
@@ -75,7 +75,7 @@
 using namespace HTMLNames;
 using namespace std;
 
-typedef PassRefPtr<InputType> (*InputTypeFactoryFunction)(HTMLInputElement&);
+typedef PassRefPtrWillBeRawPtr<InputType> (*InputTypeFactoryFunction)(HTMLInputElement&);
 typedef HashMap<AtomicString, InputTypeFactoryFunction, CaseFoldingHash> InputTypeFactoryMap;
 
 static PassOwnPtr<InputTypeFactoryMap> createInputTypeFactoryMap()
@@ -112,7 +112,7 @@
     return factoryMap;
 }
 
-PassRefPtr<InputType> InputType::create(HTMLInputElement& element, const AtomicString& typeName)
+PassRefPtrWillBeRawPtr<InputType> InputType::create(HTMLInputElement& element, const AtomicString& typeName)
 {
     InputTypeFactoryFunction factory = typeName.isEmpty() ? 0 : factoryMap()->get(typeName);
     if (!factory)
@@ -120,7 +120,7 @@
     return factory(element);
 }
 
-PassRefPtr<InputType> InputType::createText(HTMLInputElement& element)
+PassRefPtrWillBeRawPtr<InputType> InputType::createText(HTMLInputElement& element)
 {
     return TextInputType::create(element);
 }
@@ -547,6 +547,11 @@
     return true;
 }
 
+bool InputType::shouldDispatchFormControlChangeEvent(String& oldValue, String& newValue)
+{
+    return !equalIgnoringNullity(oldValue, newValue);
+}
+
 void InputType::setValue(const String& sanitizedValue, bool valueChanged, TextFieldEventBehavior eventBehavior)
 {
     element().setValueInternal(sanitizedValue, eventBehavior);
@@ -598,6 +603,10 @@
     return String();
 }
 
+void InputType::copyNonAttributeProperties(const HTMLInputElement&)
+{
+}
+
 bool InputType::shouldRespectListAttribute()
 {
     return false;
diff --git a/Source/core/html/forms/InputType.h b/Source/core/html/forms/InputType.h
index 20f415a..2c1a25b 100644
--- a/Source/core/html/forms/InputType.h
+++ b/Source/core/html/forms/InputType.h
@@ -55,11 +55,11 @@
 // FIXME: InputType should not inherit InputTypeView. It's conceptually wrong.
 class InputType : public InputTypeView {
     WTF_MAKE_NONCOPYABLE(InputType);
-    WTF_MAKE_FAST_ALLOCATED;
+    WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED;
 
 public:
-    static PassRefPtr<InputType> create(HTMLInputElement&, const AtomicString&);
-    static PassRefPtr<InputType> createText(HTMLInputElement&);
+    static PassRefPtrWillBeRawPtr<InputType> create(HTMLInputElement&, const AtomicString&);
+    static PassRefPtrWillBeRawPtr<InputType> createText(HTMLInputElement&);
     static const AtomicString& normalizeTypeName(const AtomicString&);
     virtual ~InputType();
 
@@ -172,6 +172,7 @@
     // Should return true if the given DragData has more than one dropped files.
     virtual bool receiveDroppedFiles(const DragData*);
     virtual String droppedFileSystemId();
+    virtual void copyNonAttributeProperties(const HTMLInputElement&);
     // Should return true if the corresponding renderer for a type can display a suggested value.
     virtual bool canSetSuggestedValue();
     virtual bool shouldSendChangeEventAfterCheckedChanged();
@@ -220,6 +221,8 @@
     virtual bool shouldSubmitImplicitly(Event*) OVERRIDE;
     virtual bool hasCustomFocusLogic() const OVERRIDE;
 
+    virtual bool shouldDispatchFormControlChangeEvent(String&, String&);
+
 protected:
     InputType(HTMLInputElement& element) : InputTypeView(element) { }
     Chrome* chrome() const;
diff --git a/Source/core/html/forms/InputTypeView.cpp b/Source/core/html/forms/InputTypeView.cpp
index c87c062..74a71bb 100644
--- a/Source/core/html/forms/InputTypeView.cpp
+++ b/Source/core/html/forms/InputTypeView.cpp
@@ -35,15 +35,20 @@
 
 namespace WebCore {
 
-PassRefPtr<InputTypeView> InputTypeView::create(HTMLInputElement& input)
+PassRefPtrWillBeRawPtr<InputTypeView> InputTypeView::create(HTMLInputElement& input)
 {
-    return adoptRef(new InputTypeView(input));
+    return adoptRefWillBeNoop(new InputTypeView(input));
 }
 
 InputTypeView::~InputTypeView()
 {
 }
 
+void InputTypeView::trace(Visitor* visitor)
+{
+    visitor->trace(m_element);
+}
+
 bool InputTypeView::sizeShouldIncludeDecoration(int, int& preferredSize) const
 {
     preferredSize = element().size();
diff --git a/Source/core/html/forms/InputTypeView.h b/Source/core/html/forms/InputTypeView.h
index 408a3d2..8ff949a 100644
--- a/Source/core/html/forms/InputTypeView.h
+++ b/Source/core/html/forms/InputTypeView.h
@@ -34,6 +34,7 @@
 #define InputTypeView_h
 
 #include "core/page/FocusType.h"
+#include "platform/heap/Handle.h"
 #include "wtf/FastAllocBase.h"
 #include "wtf/Forward.h"
 #include "wtf/Noncopyable.h"
@@ -65,13 +66,14 @@
 // An InputTypeView object represents the UI-specific part of an
 // HTMLInputElement. Do not expose instances of InputTypeView and classes
 // derived from it to classes other than HTMLInputElement.
-class InputTypeView : public RefCounted<InputTypeView> {
+class InputTypeView : public RefCountedWillBeGarbageCollectedFinalized<InputTypeView> {
     WTF_MAKE_NONCOPYABLE(InputTypeView);
-    WTF_MAKE_FAST_ALLOCATED;
+    WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED;
 
 public:
-    static PassRefPtr<InputTypeView> create(HTMLInputElement&);
+    static PassRefPtrWillBeRawPtr<InputTypeView> create(HTMLInputElement&);
     virtual ~InputTypeView();
+    virtual void trace(Visitor*);
 
     virtual bool sizeShouldIncludeDecoration(int defaultSize, int& preferredSize) const;
     virtual void handleClickEvent(MouseEvent*);
@@ -114,13 +116,13 @@
     virtual void updatePlaceholderText();
 
 protected:
-    InputTypeView(HTMLInputElement& element) : m_element(element) { }
-    HTMLInputElement& element() const { return m_element; }
+    InputTypeView(HTMLInputElement& element) : m_element(&element) { }
+    HTMLInputElement& element() const { return *m_element; }
 
 private:
     // Not a RefPtr because the HTMLInputElement object owns this InputTypeView
     // object.
-    HTMLInputElement& m_element;
+    RawPtrWillBeMember<HTMLInputElement> m_element;
 };
 
 } // namespace WebCore
diff --git a/Source/core/html/forms/MonthInputType.cpp b/Source/core/html/forms/MonthInputType.cpp
index 02de23c..bbd781a 100644
--- a/Source/core/html/forms/MonthInputType.cpp
+++ b/Source/core/html/forms/MonthInputType.cpp
@@ -51,9 +51,9 @@
 static const int monthDefaultStepBase = 0;
 static const int monthStepScaleFactor = 1;
 
-PassRefPtr<InputType> MonthInputType::create(HTMLInputElement& element)
+PassRefPtrWillBeRawPtr<InputType> MonthInputType::create(HTMLInputElement& element)
 {
-    return adoptRef(new MonthInputType(element));
+    return adoptRefWillBeNoop(new MonthInputType(element));
 }
 
 void MonthInputType::countUsage()
diff --git a/Source/core/html/forms/MonthInputType.h b/Source/core/html/forms/MonthInputType.h
index a671044..34fd572 100644
--- a/Source/core/html/forms/MonthInputType.h
+++ b/Source/core/html/forms/MonthInputType.h
@@ -44,7 +44,7 @@
 
 class MonthInputType FINAL : public BaseMonthInputType {
 public:
-    static PassRefPtr<InputType> create(HTMLInputElement&);
+    static PassRefPtrWillBeRawPtr<InputType> create(HTMLInputElement&);
 
 private:
     MonthInputType(HTMLInputElement& element) : BaseMonthInputType(element) { }
diff --git a/Source/core/html/forms/NumberInputType.cpp b/Source/core/html/forms/NumberInputType.cpp
index 6ad66bb..c4f47f1 100644
--- a/Source/core/html/forms/NumberInputType.cpp
+++ b/Source/core/html/forms/NumberInputType.cpp
@@ -94,9 +94,9 @@
     return RealNumberRenderSize(sizeOfSign + sizeOfZero , numberOfZeroAfterDecimalPoint + sizeOfDigits);
 }
 
-PassRefPtr<InputType> NumberInputType::create(HTMLInputElement& element)
+PassRefPtrWillBeRawPtr<InputType> NumberInputType::create(HTMLInputElement& element)
 {
-    return adoptRef(new NumberInputType(element));
+    return adoptRefWillBeNoop(new NumberInputType(element));
 }
 
 void NumberInputType::countUsage()
diff --git a/Source/core/html/forms/NumberInputType.h b/Source/core/html/forms/NumberInputType.h
index cb60adc..be04ad8 100644
--- a/Source/core/html/forms/NumberInputType.h
+++ b/Source/core/html/forms/NumberInputType.h
@@ -39,7 +39,7 @@
 
 class NumberInputType FINAL : public TextFieldInputType {
 public:
-    static PassRefPtr<InputType> create(HTMLInputElement&);
+    static PassRefPtrWillBeRawPtr<InputType> create(HTMLInputElement&);
 
 private:
     NumberInputType(HTMLInputElement& element) : TextFieldInputType(element) { }
diff --git a/Source/core/html/forms/PasswordInputType.cpp b/Source/core/html/forms/PasswordInputType.cpp
index 9c448f3..174cfed 100644
--- a/Source/core/html/forms/PasswordInputType.cpp
+++ b/Source/core/html/forms/PasswordInputType.cpp
@@ -47,9 +47,9 @@
 
 namespace WebCore {
 
-PassRefPtr<InputType> PasswordInputType::create(HTMLInputElement& element)
+PassRefPtrWillBeRawPtr<InputType> PasswordInputType::create(HTMLInputElement& element)
 {
-    return adoptRef(new PasswordInputType(element));
+    return adoptRefWillBeNoop(new PasswordInputType(element));
 }
 
 void PasswordInputType::countUsage()
@@ -85,7 +85,7 @@
     BaseTextInputType::createShadowSubtree();
     if (!isPasswordGenerationEnabled())
         return;
-    RefPtr<PasswordGeneratorButtonElement> generatorButton = PasswordGeneratorButtonElement::create(element().document());
+    RefPtrWillBeRawPtr<PasswordGeneratorButtonElement> generatorButton = PasswordGeneratorButtonElement::create(element().document());
     if (!isPasswordGenerationDecorationEnabled())
         generatorButton->setInlineStyleProperty(CSSPropertyDisplay, CSSValueNone);
     containerElement()->appendChild(generatorButton.release());
diff --git a/Source/core/html/forms/PasswordInputType.h b/Source/core/html/forms/PasswordInputType.h
index ed9cdfa..7b32af8 100644
--- a/Source/core/html/forms/PasswordInputType.h
+++ b/Source/core/html/forms/PasswordInputType.h
@@ -38,7 +38,7 @@
 
 class PasswordInputType FINAL : public BaseTextInputType {
 public:
-    static PassRefPtr<InputType> create(HTMLInputElement&);
+    static PassRefPtrWillBeRawPtr<InputType> create(HTMLInputElement&);
 
 private:
     PasswordInputType(HTMLInputElement& element) : BaseTextInputType(element) { }
diff --git a/Source/core/html/forms/RadioInputType.cpp b/Source/core/html/forms/RadioInputType.cpp
index 7a90d2f..43dcc64 100644
--- a/Source/core/html/forms/RadioInputType.cpp
+++ b/Source/core/html/forms/RadioInputType.cpp
@@ -36,9 +36,9 @@
 
 using namespace HTMLNames;
 
-PassRefPtr<InputType> RadioInputType::create(HTMLInputElement& element)
+PassRefPtrWillBeRawPtr<InputType> RadioInputType::create(HTMLInputElement& element)
 {
-    return adoptRef(new RadioInputType(element));
+    return adoptRefWillBeNoop(new RadioInputType(element));
 }
 
 const AtomicString& RadioInputType::formControlType() const
diff --git a/Source/core/html/forms/RadioInputType.h b/Source/core/html/forms/RadioInputType.h
index 14a1386..baddf57 100644
--- a/Source/core/html/forms/RadioInputType.h
+++ b/Source/core/html/forms/RadioInputType.h
@@ -37,7 +37,7 @@
 
 class RadioInputType FINAL : public BaseCheckableInputType {
 public:
-    static PassRefPtr<InputType> create(HTMLInputElement&);
+    static PassRefPtrWillBeRawPtr<InputType> create(HTMLInputElement&);
 
 private:
     RadioInputType(HTMLInputElement& element) : BaseCheckableInputType(element) { }
diff --git a/Source/core/html/forms/RangeInputType.cpp b/Source/core/html/forms/RangeInputType.cpp
index 5066191..db6e536 100644
--- a/Source/core/html/forms/RangeInputType.cpp
+++ b/Source/core/html/forms/RangeInputType.cpp
@@ -74,9 +74,9 @@
     return proposedValue >= minimum ? proposedValue : std::max(minimum, fallbackValue);
 }
 
-PassRefPtr<InputType> RangeInputType::create(HTMLInputElement& element)
+PassRefPtrWillBeRawPtr<InputType> RangeInputType::create(HTMLInputElement& element)
 {
-    return adoptRef(new RangeInputType(element));
+    return adoptRefWillBeNoop(new RangeInputType(element));
 }
 
 RangeInputType::RangeInputType(HTMLInputElement& element)
@@ -250,7 +250,7 @@
     track->setShadowPseudoId(AtomicString("-webkit-slider-runnable-track", AtomicString::ConstructFromLiteral));
     track->setAttribute(idAttr, ShadowElementNames::sliderTrack());
     track->appendChild(SliderThumbElement::create(document));
-    RefPtr<HTMLElement> container = SliderContainerElement::create(document);
+    RefPtrWillBeRawPtr<HTMLElement> container = SliderContainerElement::create(document);
     container->appendChild(track.release());
     element().userAgentShadowRoot()->appendChild(container.release());
 }
diff --git a/Source/core/html/forms/RangeInputType.h b/Source/core/html/forms/RangeInputType.h
index 498e129..2cd9f71 100644
--- a/Source/core/html/forms/RangeInputType.h
+++ b/Source/core/html/forms/RangeInputType.h
@@ -40,7 +40,7 @@
 
 class RangeInputType FINAL : public InputType {
 public:
-    static PassRefPtr<InputType> create(HTMLInputElement&);
+    static PassRefPtrWillBeRawPtr<InputType> create(HTMLInputElement&);
 
 private:
     RangeInputType(HTMLInputElement&);
diff --git a/Source/core/html/forms/ResetInputType.cpp b/Source/core/html/forms/ResetInputType.cpp
index 6175a6c..a640f31 100644
--- a/Source/core/html/forms/ResetInputType.cpp
+++ b/Source/core/html/forms/ResetInputType.cpp
@@ -41,9 +41,9 @@
 
 namespace WebCore {
 
-PassRefPtr<InputType> ResetInputType::create(HTMLInputElement& element)
+PassRefPtrWillBeRawPtr<InputType> ResetInputType::create(HTMLInputElement& element)
 {
-    return adoptRef(new ResetInputType(element));
+    return adoptRefWillBeNoop(new ResetInputType(element));
 }
 
 const AtomicString& ResetInputType::formControlType() const
diff --git a/Source/core/html/forms/ResetInputType.h b/Source/core/html/forms/ResetInputType.h
index 1e5c0d0..e30b91c 100644
--- a/Source/core/html/forms/ResetInputType.h
+++ b/Source/core/html/forms/ResetInputType.h
@@ -37,7 +37,7 @@
 
 class ResetInputType FINAL : public BaseButtonInputType {
 public:
-    static PassRefPtr<InputType> create(HTMLInputElement&);
+    static PassRefPtrWillBeRawPtr<InputType> create(HTMLInputElement&);
 
 private:
     ResetInputType(HTMLInputElement& element) : BaseButtonInputType(element) { }
diff --git a/Source/core/html/forms/SearchInputType.cpp b/Source/core/html/forms/SearchInputType.cpp
index 16f40b1..08864bc 100644
--- a/Source/core/html/forms/SearchInputType.cpp
+++ b/Source/core/html/forms/SearchInputType.cpp
@@ -52,9 +52,9 @@
 {
 }
 
-PassRefPtr<InputType> SearchInputType::create(HTMLInputElement& element)
+PassRefPtrWillBeRawPtr<InputType> SearchInputType::create(HTMLInputElement& element)
 {
-    return adoptRef(new SearchInputType(element));
+    return adoptRefWillBeNoop(new SearchInputType(element));
 }
 
 void SearchInputType::countUsage()
diff --git a/Source/core/html/forms/SearchInputType.h b/Source/core/html/forms/SearchInputType.h
index 2bcf4c5..6687f6d 100644
--- a/Source/core/html/forms/SearchInputType.h
+++ b/Source/core/html/forms/SearchInputType.h
@@ -41,7 +41,7 @@
 
 class SearchInputType FINAL : public BaseTextInputType {
 public:
-    static PassRefPtr<InputType> create(HTMLInputElement&);
+    static PassRefPtrWillBeRawPtr<InputType> create(HTMLInputElement&);
 
     void stopSearchEventTimer();
 
diff --git a/Source/core/html/forms/SubmitInputType.cpp b/Source/core/html/forms/SubmitInputType.cpp
index e89d809..a9c60a0 100644
--- a/Source/core/html/forms/SubmitInputType.cpp
+++ b/Source/core/html/forms/SubmitInputType.cpp
@@ -42,9 +42,9 @@
 
 namespace WebCore {
 
-PassRefPtr<InputType> SubmitInputType::create(HTMLInputElement& element)
+PassRefPtrWillBeRawPtr<InputType> SubmitInputType::create(HTMLInputElement& element)
 {
-    return adoptRef(new SubmitInputType(element));
+    return adoptRefWillBeNoop(new SubmitInputType(element));
 }
 
 const AtomicString& SubmitInputType::formControlType() const
diff --git a/Source/core/html/forms/SubmitInputType.h b/Source/core/html/forms/SubmitInputType.h
index 77d86ca..169117c 100644
--- a/Source/core/html/forms/SubmitInputType.h
+++ b/Source/core/html/forms/SubmitInputType.h
@@ -37,7 +37,7 @@
 
 class SubmitInputType FINAL : public BaseButtonInputType {
 public:
-    static PassRefPtr<InputType> create(HTMLInputElement&);
+    static PassRefPtrWillBeRawPtr<InputType> create(HTMLInputElement&);
 
 private:
     SubmitInputType(HTMLInputElement& element) : BaseButtonInputType(element) { }
diff --git a/Source/core/html/forms/TelephoneInputType.cpp b/Source/core/html/forms/TelephoneInputType.cpp
index 4b5e2ed..64a4356 100644
--- a/Source/core/html/forms/TelephoneInputType.cpp
+++ b/Source/core/html/forms/TelephoneInputType.cpp
@@ -36,9 +36,9 @@
 
 namespace WebCore {
 
-PassRefPtr<InputType> TelephoneInputType::create(HTMLInputElement& element)
+PassRefPtrWillBeRawPtr<InputType> TelephoneInputType::create(HTMLInputElement& element)
 {
-    return adoptRef(new TelephoneInputType(element));
+    return adoptRefWillBeNoop(new TelephoneInputType(element));
 }
 
 void TelephoneInputType::countUsage()
diff --git a/Source/core/html/forms/TelephoneInputType.h b/Source/core/html/forms/TelephoneInputType.h
index 8ec46d7..dca6c4f 100644
--- a/Source/core/html/forms/TelephoneInputType.h
+++ b/Source/core/html/forms/TelephoneInputType.h
@@ -37,7 +37,7 @@
 
 class TelephoneInputType FINAL : public BaseTextInputType {
 public:
-    static PassRefPtr<InputType> create(HTMLInputElement&);
+    static PassRefPtrWillBeRawPtr<InputType> create(HTMLInputElement&);
 
 private:
     TelephoneInputType(HTMLInputElement& element) : BaseTextInputType(element) { }
diff --git a/Source/core/html/forms/TextFieldInputType.cpp b/Source/core/html/forms/TextFieldInputType.cpp
index 1b78abe..5bbc66f 100644
--- a/Source/core/html/forms/TextFieldInputType.cpp
+++ b/Source/core/html/forms/TextFieldInputType.cpp
@@ -98,9 +98,9 @@
     }
 
 public:
-    static PassRefPtr<DataListIndicatorElement> create(Document& document)
+    static PassRefPtrWillBeRawPtr<DataListIndicatorElement> create(Document& document)
     {
-        RefPtr<DataListIndicatorElement> element = adoptRef(new DataListIndicatorElement(document));
+        RefPtrWillBeRawPtr<DataListIndicatorElement> element = adoptRefWillBeRefCountedGarbageCollected(new DataListIndicatorElement(document));
         element->setShadowPseudoId(AtomicString("-webkit-calendar-picker-indicator", AtomicString::ConstructFromLiteral));
         element->setAttribute(idAttr, ShadowElementNames::pickerIndicator());
         return element.release();
@@ -115,8 +115,10 @@
 
 TextFieldInputType::~TextFieldInputType()
 {
+#if !ENABLE(OILPAN)
     if (SpinButtonElement* spinButton = spinButtonElement())
         spinButton->removeSpinButtonOwner();
+#endif
 }
 
 SpinButtonElement* TextFieldInputType::spinButtonElement() const
@@ -269,15 +271,6 @@
     return new RenderTextControlSingleLine(&element());
 }
 
-bool TextFieldInputType::needsContainer() const
-{
-#if ENABLE(INPUT_SPEECH)
-    return element().isSpeechEnabled();
-#else
-    return false;
-#endif
-}
-
 bool TextFieldInputType::shouldHaveSpinButton() const
 {
     return RenderTheme::theme().shouldHaveSpinButton(&element());
@@ -294,25 +287,20 @@
     bool shouldHaveDataListIndicator = element().hasValidDataListOptions();
     bool createsContainer = shouldHaveSpinButton || shouldHaveDataListIndicator || needsContainer();
 
-    RefPtr<TextControlInnerTextElement> innerEditor = TextControlInnerTextElement::create(document);
+    RefPtrWillBeRawPtr<TextControlInnerTextElement> innerEditor = TextControlInnerTextElement::create(document);
     if (!createsContainer) {
         shadowRoot->appendChild(innerEditor.release());
         return;
     }
 
-    RefPtr<TextControlInnerContainer> container = TextControlInnerContainer::create(document);
+    RefPtrWillBeRawPtr<TextControlInnerContainer> container = TextControlInnerContainer::create(document);
     container->setShadowPseudoId(AtomicString("-webkit-textfield-decoration-container", AtomicString::ConstructFromLiteral));
     shadowRoot->appendChild(container);
 
-    RefPtr<EditingViewPortElement> editingViewPort = EditingViewPortElement::create(document);
+    RefPtrWillBeRawPtr<EditingViewPortElement> editingViewPort = EditingViewPortElement::create(document);
     editingViewPort->appendChild(innerEditor.release());
     container->appendChild(editingViewPort.release());
 
-#if ENABLE(INPUT_SPEECH)
-    if (element().isSpeechEnabled())
-        container->appendChild(InputFieldSpeechButtonElement::create(document));
-#endif
-
     if (shouldHaveDataListIndicator)
         container->appendChild(DataListIndicatorElement::create(document));
     // FIXME: Because of a special handling for a spin button in
@@ -351,11 +339,11 @@
             // FIXME: The following code is similar to createShadowSubtree(),
             // but they are different. We should simplify the code by making
             // containerElement mandatory.
-            RefPtr<Element> rpContainer = TextControlInnerContainer::create(document);
+            RefPtrWillBeRawPtr<Element> rpContainer = TextControlInnerContainer::create(document);
             rpContainer->setShadowPseudoId(AtomicString("-webkit-textfield-decoration-container", AtomicString::ConstructFromLiteral));
-            RefPtr<Element> innerEditor = element().innerTextElement();
+            RefPtrWillBeRawPtr<Element> innerEditor = element().innerTextElement();
             innerEditor->parentNode()->replaceChild(rpContainer.get(), innerEditor.get());
-            RefPtr<Element> editingViewPort = EditingViewPortElement::create(document);
+            RefPtrWillBeRawPtr<Element> editingViewPort = EditingViewPortElement::create(document);
             editingViewPort->appendChild(innerEditor.release());
             rpContainer->appendChild(editingViewPort.release());
             rpContainer->appendChild(DataListIndicatorElement::create(document));
diff --git a/Source/core/html/forms/TextFieldInputType.h b/Source/core/html/forms/TextFieldInputType.h
index 4d9d15e..0eb1fda 100644
--- a/Source/core/html/forms/TextFieldInputType.h
+++ b/Source/core/html/forms/TextFieldInputType.h
@@ -41,6 +41,7 @@
 // The class represents types of which UI contain text fields.
 // It supports not only the types for BaseTextInputType but also type=number.
 class TextFieldInputType : public InputType, protected SpinButtonElement::SpinButtonOwner {
+    WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(TextFieldInputType);
 protected:
     TextFieldInputType(HTMLInputElement&);
     virtual ~TextFieldInputType();
@@ -49,7 +50,7 @@
     void handleKeydownEventForSpinButton(KeyboardEvent*);
 
 protected:
-    virtual bool needsContainer() const;
+    virtual bool needsContainer() const { return false; }
     bool shouldHaveSpinButton() const;
     virtual void createShadowSubtree() OVERRIDE;
     virtual void destroyShadowSubtree() OVERRIDE;
diff --git a/Source/core/html/forms/TextInputType.cpp b/Source/core/html/forms/TextInputType.cpp
index a5e9db1..3475b43 100644
--- a/Source/core/html/forms/TextInputType.cpp
+++ b/Source/core/html/forms/TextInputType.cpp
@@ -39,9 +39,9 @@
 
 using namespace HTMLNames;
 
-PassRefPtr<InputType> TextInputType::create(HTMLInputElement& element)
+PassRefPtrWillBeRawPtr<InputType> TextInputType::create(HTMLInputElement& element)
 {
-    return adoptRef(new TextInputType(element));
+    return adoptRefWillBeNoop(new TextInputType(element));
 }
 
 void TextInputType::countUsage()
diff --git a/Source/core/html/forms/TextInputType.h b/Source/core/html/forms/TextInputType.h
index d74cdbc..75608bd 100644
--- a/Source/core/html/forms/TextInputType.h
+++ b/Source/core/html/forms/TextInputType.h
@@ -37,7 +37,7 @@
 
 class TextInputType FINAL : public BaseTextInputType {
 public:
-    static PassRefPtr<InputType> create(HTMLInputElement&);
+    static PassRefPtrWillBeRawPtr<InputType> create(HTMLInputElement&);
 
 private:
     TextInputType(HTMLInputElement& element) : BaseTextInputType(element) { }
diff --git a/Source/core/html/forms/TimeInputType.cpp b/Source/core/html/forms/TimeInputType.cpp
index c8ab269..90cf3cc 100644
--- a/Source/core/html/forms/TimeInputType.cpp
+++ b/Source/core/html/forms/TimeInputType.cpp
@@ -56,9 +56,9 @@
 {
 }
 
-PassRefPtr<InputType> TimeInputType::create(HTMLInputElement& element)
+PassRefPtrWillBeRawPtr<InputType> TimeInputType::create(HTMLInputElement& element)
 {
-    return adoptRef(new TimeInputType(element));
+    return adoptRefWillBeNoop(new TimeInputType(element));
 }
 
 void TimeInputType::countUsage()
diff --git a/Source/core/html/forms/TimeInputType.h b/Source/core/html/forms/TimeInputType.h
index 99de035..b8d3f11 100644
--- a/Source/core/html/forms/TimeInputType.h
+++ b/Source/core/html/forms/TimeInputType.h
@@ -44,7 +44,7 @@
 
 class TimeInputType FINAL : public BaseTimeInputType {
 public:
-    static PassRefPtr<InputType> create(HTMLInputElement&);
+    static PassRefPtrWillBeRawPtr<InputType> create(HTMLInputElement&);
 
 private:
     TimeInputType(HTMLInputElement&);
diff --git a/Source/core/html/forms/URLInputType.cpp b/Source/core/html/forms/URLInputType.cpp
index 33017eb..75325e9 100644
--- a/Source/core/html/forms/URLInputType.cpp
+++ b/Source/core/html/forms/URLInputType.cpp
@@ -38,9 +38,9 @@
 
 namespace WebCore {
 
-PassRefPtr<InputType> URLInputType::create(HTMLInputElement& element)
+PassRefPtrWillBeRawPtr<InputType> URLInputType::create(HTMLInputElement& element)
 {
-    return adoptRef(new URLInputType(element));
+    return adoptRefWillBeNoop(new URLInputType(element));
 }
 
 void URLInputType::countUsage()
diff --git a/Source/core/html/forms/URLInputType.h b/Source/core/html/forms/URLInputType.h
index 9ec1e30..e11143f 100644
--- a/Source/core/html/forms/URLInputType.h
+++ b/Source/core/html/forms/URLInputType.h
@@ -37,7 +37,7 @@
 
 class URLInputType FINAL : public BaseTextInputType {
 public:
-    static PassRefPtr<InputType> create(HTMLInputElement&);
+    static PassRefPtrWillBeRawPtr<InputType> create(HTMLInputElement&);
 
 private:
     URLInputType(HTMLInputElement& element) : BaseTextInputType(element) { }
diff --git a/Source/core/html/forms/ValidationMessage.cpp b/Source/core/html/forms/ValidationMessage.cpp
index 7804646..f78b43c 100644
--- a/Source/core/html/forms/ValidationMessage.cpp
+++ b/Source/core/html/forms/ValidationMessage.cpp
@@ -46,8 +46,6 @@
 
 ValidationMessage::~ValidationMessage()
 {
-    if (ValidationMessageClient* client = validationMessageClient())
-        client->hideValidationMessage(*m_element);
 }
 
 PassOwnPtr<ValidationMessage> ValidationMessage::create(HTMLFormControlElement* element)
diff --git a/Source/core/html/forms/WeekInputType.cpp b/Source/core/html/forms/WeekInputType.cpp
index 419b160..36f38cd 100644
--- a/Source/core/html/forms/WeekInputType.cpp
+++ b/Source/core/html/forms/WeekInputType.cpp
@@ -48,9 +48,9 @@
 static const int weekDefaultStep = 1;
 static const int weekStepScaleFactor = 604800000;
 
-PassRefPtr<InputType> WeekInputType::create(HTMLInputElement& element)
+PassRefPtrWillBeRawPtr<InputType> WeekInputType::create(HTMLInputElement& element)
 {
-    return adoptRef(new WeekInputType(element));
+    return adoptRefWillBeNoop(new WeekInputType(element));
 }
 
 void WeekInputType::countUsage()
diff --git a/Source/core/html/forms/WeekInputType.h b/Source/core/html/forms/WeekInputType.h
index 7254f12..f3360f2 100644
--- a/Source/core/html/forms/WeekInputType.h
+++ b/Source/core/html/forms/WeekInputType.h
@@ -44,7 +44,7 @@
 
 class WeekInputType FINAL : public BaseWeekInputType {
 public:
-    static PassRefPtr<InputType> create(HTMLInputElement&);
+    static PassRefPtrWillBeRawPtr<InputType> create(HTMLInputElement&);
 
 private:
     WeekInputType(HTMLInputElement& element) : BaseWeekInputType(element) { }
diff --git a/Source/core/html/imports/HTMLImport.cpp b/Source/core/html/imports/HTMLImport.cpp
index 96a23cc..4726f71 100644
--- a/Source/core/html/imports/HTMLImport.cpp
+++ b/Source/core/html/imports/HTMLImport.cpp
@@ -54,6 +54,17 @@
     return false;
 }
 
+bool HTMLImport::formsCycle() const
+{
+    for (const HTMLImport* i = this->parent(); i; i = i->parent()) {
+        if (i->document() == this->document())
+            return true;
+    }
+
+    return false;
+
+}
+
 void HTMLImport::appendImport(HTMLImport* child)
 {
     appendChild(child);
diff --git a/Source/core/html/imports/HTMLImport.h b/Source/core/html/imports/HTMLImport.h
index c0d9e97..72d43f0 100644
--- a/Source/core/html/imports/HTMLImport.h
+++ b/Source/core/html/imports/HTMLImport.h
@@ -109,6 +109,7 @@
     bool precedes(HTMLImport*);
     bool isRoot() const { return !isChild(); }
     bool isSync() const { return SyncMode(m_sync) == Sync; }
+    bool formsCycle() const;
     const HTMLImportState& state() const { return m_state; }
 
     void appendImport(HTMLImport*);
diff --git a/Source/core/html/imports/HTMLImportChild.cpp b/Source/core/html/imports/HTMLImportChild.cpp
index 4309e07..34972b2 100644
--- a/Source/core/html/imports/HTMLImportChild.cpp
+++ b/Source/core/html/imports/HTMLImportChild.cpp
@@ -33,6 +33,7 @@
 
 #include "core/dom/Document.h"
 #include "core/dom/custom/CustomElement.h"
+#include "core/dom/custom/CustomElementMicrotaskDispatcher.h"
 #include "core/dom/custom/CustomElementMicrotaskImportStep.h"
 #include "core/html/imports/HTMLImportChildClient.h"
 #include "core/html/imports/HTMLImportLoader.h"
@@ -48,7 +49,7 @@
     , m_master(master)
 #endif
     , m_url(url)
-    , m_customElementMicrotaskStep(0)
+    , m_weakFactory(this)
     , m_loader(0)
     , m_client(0)
 {
@@ -62,12 +63,6 @@
     // importDestroyed() should be called before the destruction.
     ASSERT(!m_loader);
 
-    if (m_customElementMicrotaskStep) {
-        // if Custom Elements were blocked, must unblock them before death
-        m_customElementMicrotaskStep->importDidFinish();
-        m_customElementMicrotaskStep = 0;
-    }
-
     if (m_client)
         m_client->importChildWasDestroyed(this);
 
@@ -98,17 +93,25 @@
 {
     if (m_client)
         m_client->didFinish();
-
-    if (m_customElementMicrotaskStep) {
-        m_customElementMicrotaskStep->importDidFinish();
-        m_customElementMicrotaskStep = 0;
-    }
 }
 
 void HTMLImportChild::didFinishLoading()
 {
     clearResource();
     stateWillChange();
+    if (m_customElementMicrotaskStep)
+        CustomElementMicrotaskDispatcher::instance().importDidFinish(m_customElementMicrotaskStep.get());
+}
+
+void HTMLImportChild::didFinishUpgradingCustomElements()
+{
+    stateWillChange();
+    m_customElementMicrotaskStep.clear();
+}
+
+bool HTMLImportChild::isLoaded() const
+{
+    return m_loader && m_loader->isDone();
 }
 
 Document* HTMLImportChild::importedDocument() const
@@ -157,9 +160,9 @@
     else
         createLoader();
 
-    if (isSync() && !isDone()) {
+    if (!isDone() && !formsCycle()) {
         ASSERT(!m_customElementMicrotaskStep);
-        m_customElementMicrotaskStep = CustomElement::didCreateImport(this);
+        m_customElementMicrotaskStep = CustomElement::didCreateImport(this)->weakPtr();
     }
 }
 
@@ -181,7 +184,7 @@
 
 bool HTMLImportChild::isDone() const
 {
-    return m_loader && m_loader->isDone();
+    return m_loader && m_loader->isDone() && !m_customElementMicrotaskStep;
 }
 
 bool HTMLImportChild::loaderHasError() const
@@ -215,8 +218,9 @@
 void HTMLImportChild::showThis()
 {
     HTMLImport::showThis();
-    fprintf(stderr, " loader=%p sync=%s url=%s",
+    fprintf(stderr, " loader=%p step=%p sync=%s url=%s",
         m_loader,
+        m_customElementMicrotaskStep.get(),
         isSync() ? "Y" : "N",
         url().string().utf8().data());
 }
diff --git a/Source/core/html/imports/HTMLImportChild.h b/Source/core/html/imports/HTMLImportChild.h
index 2460e5f..3bd55bd 100644
--- a/Source/core/html/imports/HTMLImportChild.h
+++ b/Source/core/html/imports/HTMLImportChild.h
@@ -37,6 +37,7 @@
 #include "platform/heap/Handle.h"
 #include "platform/weborigin/KURL.h"
 #include "wtf/Vector.h"
+#include "wtf/WeakPtr.h"
 
 namespace WebCore {
 
@@ -66,6 +67,7 @@
     void wasAlreadyLoaded();
     void startLoading(const ResourcePtr<RawResource>&);
     void importDestroyed();
+    WeakPtr<HTMLImportChild> weakPtr() { return m_weakFactory.createWeakPtr(); }
 
     // HTMLImport
     virtual bool isChild() const OVERRIDE { return true; }
@@ -84,6 +86,8 @@
     bool loaderHasError() const;
 
     void didFinishLoading();
+    void didFinishUpgradingCustomElements();
+    bool isLoaded() const;
 
 private:
     // RawResourceOwner doing nothing.
@@ -103,7 +107,8 @@
     Document& m_master;
 #endif
     KURL m_url;
-    CustomElementMicrotaskImportStep* m_customElementMicrotaskStep;
+    WeakPtrFactory<HTMLImportChild> m_weakFactory;
+    WeakPtr<CustomElementMicrotaskImportStep> m_customElementMicrotaskStep;
     HTMLImportLoader* m_loader;
     HTMLImportChildClient* m_client;
 };
diff --git a/Source/core/html/imports/HTMLImportStateResolver.cpp b/Source/core/html/imports/HTMLImportStateResolver.cpp
index 593b174..bd083ad 100644
--- a/Source/core/html/imports/HTMLImportStateResolver.cpp
+++ b/Source/core/html/imports/HTMLImportStateResolver.cpp
@@ -37,6 +37,8 @@
 
 inline bool HTMLImportStateResolver::isBlockingFollowers(HTMLImport* import)
 {
+    if (!import->isSync())
+        return false;
     if (!import->loader())
         return true;
     return !import->state().isReady();
@@ -50,7 +52,7 @@
     }
 
     for (HTMLImport* child = m_import->firstChild(); child; child = child->next()) {
-        if (child->isSync() && isBlockingFollowers(child))
+        if (isBlockingFollowers(child))
             return true;
     }
 
diff --git a/Source/core/html/imports/HTMLImportsController.h b/Source/core/html/imports/HTMLImportsController.h
index ef541a9..4be2dcb 100644
--- a/Source/core/html/imports/HTMLImportsController.h
+++ b/Source/core/html/imports/HTMLImportsController.h
@@ -78,8 +78,6 @@
 
     void recalcTimerFired(Timer<HTMLImportsController>*);
 
-
-    virtual void trace(Visitor*) OVERRIDE { }
     HTMLImportLoader* createLoader();
 
     size_t loaderCount() const { return m_loaders.size(); }
diff --git a/Source/core/html/imports/LinkImport.cpp b/Source/core/html/imports/LinkImport.cpp
index 62bfcc0..6183852 100644
--- a/Source/core/html/imports/LinkImport.cpp
+++ b/Source/core/html/imports/LinkImport.cpp
@@ -41,9 +41,9 @@
 
 namespace WebCore {
 
-PassOwnPtr<LinkImport> LinkImport::create(HTMLLinkElement* owner)
+PassOwnPtrWillBeRawPtr<LinkImport> LinkImport::create(HTMLLinkElement* owner)
 {
-    return adoptPtr(new LinkImport(owner));
+    return adoptPtrWillBeNoop(new LinkImport(owner));
 }
 
 LinkImport::LinkImport(HTMLLinkElement* owner)
@@ -54,7 +54,10 @@
 
 LinkImport::~LinkImport()
 {
-    clear();
+    if (m_child) {
+        m_child->clearClient();
+        m_child = 0;
+    }
 }
 
 Document* LinkImport::importedDocument() const
@@ -94,15 +97,6 @@
     }
 }
 
-void LinkImport::clear()
-{
-    m_owner = 0;
-    if (m_child) {
-        m_child->clearClient();
-        m_child = 0;
-    }
-}
-
 void LinkImport::didFinish()
 {
     if (!m_owner || !m_owner->inDocument())
@@ -114,12 +108,12 @@
 {
     ASSERT(m_child == child);
     m_child = 0;
-    clear();
+    m_owner = nullptr;
 }
 
 bool LinkImport::isSync() const
 {
-    return m_owner && m_owner->isCreatedByParser() && !m_owner->async();
+    return m_owner && !m_owner->async();
 }
 
 HTMLLinkElement* LinkImport::link()
@@ -132,4 +126,9 @@
     return m_child && m_child->isDone() && !m_child->loaderHasError();
 }
 
+void LinkImport::trace(Visitor* visitor)
+{
+    LinkResource::trace(visitor);
+}
+
 } // namespace WebCore
diff --git a/Source/core/html/imports/LinkImport.h b/Source/core/html/imports/LinkImport.h
index 8ef55f5..bb3a8ea 100644
--- a/Source/core/html/imports/LinkImport.h
+++ b/Source/core/html/imports/LinkImport.h
@@ -46,10 +46,10 @@
 // A LinkResource subclasss used for @rel=import.
 //
 class LinkImport FINAL : public LinkResource, public HTMLImportChildClient {
-    WTF_MAKE_FAST_ALLOCATED;
+    WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED;
 public:
 
-    static PassOwnPtr<LinkImport> create(HTMLLinkElement* owner);
+    static PassOwnPtrWillBeRawPtr<LinkImport> create(HTMLLinkElement* owner);
 
     explicit LinkImport(HTMLLinkElement* owner);
     virtual ~LinkImport();
@@ -58,6 +58,7 @@
     virtual void process() OVERRIDE;
     virtual Type type() const OVERRIDE { return Import; }
     virtual bool hasLoaded() const OVERRIDE;
+    virtual void trace(Visitor*) OVERRIDE;
 
     // HTMLImportChildClient
     virtual void didFinish() OVERRIDE;
@@ -68,8 +69,6 @@
     Document* importedDocument() const;
 
 private:
-    void clear();
-
     HTMLImportChild* m_child;
 };
 
diff --git a/Source/core/html/parser/HTMLDocumentParser.cpp b/Source/core/html/parser/HTMLDocumentParser.cpp
index 73a438b..55a36a6 100644
--- a/Source/core/html/parser/HTMLDocumentParser.cpp
+++ b/Source/core/html/parser/HTMLDocumentParser.cpp
@@ -498,6 +498,7 @@
 
     // FIXME: Pass in current input length.
     TRACE_EVENT_BEGIN1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "ParseHTML", "beginData", InspectorParseHtmlEvent::beginData(document(), lineNumber().zeroBasedInt()));
+    TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline.stack"), "CallStack", "stack", InspectorCallStackEvent::currentCallStack());
     // FIXME(361045): remove InspectorInstrumentation calls once DevTools Timeline migrates to tracing.
     InspectorInstrumentationCookie cookie = InspectorInstrumentation::willWriteHTML(document(), lineNumber().zeroBasedInt());
 
@@ -519,6 +520,7 @@
     TRACE_EVENT_END1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "ParseHTML", "endLine", lineNumber().zeroBasedInt());
     // FIXME(361045): remove InspectorInstrumentation calls once DevTools Timeline migrates to tracing.
     InspectorInstrumentation::didWriteHTML(cookie, lineNumber().zeroBasedInt());
+    TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "UpdateCounters", "data", InspectorUpdateCountersEvent::data());
 }
 
 void HTMLDocumentParser::forcePlaintextForTextDocument()
@@ -569,6 +571,7 @@
     // end up parsing the whole buffer in this pump.  We should pass how
     // much we parsed as part of didWriteHTML instead of willWriteHTML.
     TRACE_EVENT_BEGIN1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "ParseHTML", "beginData", InspectorParseHtmlEvent::beginData(document(), m_input.current().currentLine().zeroBasedInt()));
+    TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline.stack"), "CallStack", "stack", InspectorCallStackEvent::currentCallStack());
     // FIXME(361045): remove InspectorInstrumentation calls once DevTools Timeline migrates to tracing.
     InspectorInstrumentationCookie cookie = InspectorInstrumentation::willWriteHTML(document(), m_input.current().currentLine().zeroBasedInt());
 
diff --git a/Source/core/html/parser/HTMLScriptRunner.cpp b/Source/core/html/parser/HTMLScriptRunner.cpp
index 91e008b..6a66243 100644
--- a/Source/core/html/parser/HTMLScriptRunner.cpp
+++ b/Source/core/html/parser/HTMLScriptRunner.cpp
@@ -244,9 +244,9 @@
     return true;
 }
 
-void HTMLScriptRunner::requestParsingBlockingScript(Element* element)
+void HTMLScriptRunner::requestParsingBlockingScript(const ResourcePtr<ScriptResource>& resource, Element* element)
 {
-    if (!requestPendingScript(m_parserBlockingScript, element))
+    if (!requestPendingScript(resource, m_parserBlockingScript, element))
         return;
 
     ASSERT(m_parserBlockingScript.resource());
@@ -258,27 +258,26 @@
         watchForLoad(m_parserBlockingScript);
 }
 
-void HTMLScriptRunner::requestDeferredScript(Element* element)
+void HTMLScriptRunner::requestDeferredScript(const ResourcePtr<ScriptResource>& resource, Element* element)
 {
     PendingScript pendingScript;
-    if (!requestPendingScript(pendingScript, element))
+    if (!requestPendingScript(resource, pendingScript, element))
         return;
 
     ASSERT(pendingScript.resource());
     m_scriptsToExecuteAfterParsing.append(pendingScript);
 }
 
-bool HTMLScriptRunner::requestPendingScript(PendingScript& pendingScript, Element* script) const
+bool HTMLScriptRunner::requestPendingScript(const ResourcePtr<ScriptResource>& resource, PendingScript& pendingScript, Element* script) const
 {
     ASSERT(!pendingScript.element());
     pendingScript.setElement(script);
     // This should correctly return 0 for empty or invalid srcValues.
-    ScriptResource* resource = toScriptLoaderIfPossible(script)->resource().get();
     if (!resource) {
         notImplemented(); // Dispatch error event.
         return false;
     }
-    pendingScript.setScriptResource(resource);
+    pendingScript.setScriptResource(resource.get());
     return true;
 }
 
@@ -307,13 +306,13 @@
         InsertionPointRecord insertionPointRecord(m_host->inputStream());
         NestingLevelIncrementer nestingLevelIncrementer(m_scriptNestingLevel);
 
-        scriptLoader->prepareScript(scriptStartPosition);
+        ScriptPrep prep = scriptLoader->prepareScript(scriptStartPosition);
 
         if (!scriptLoader->willBeParserExecuted())
             return;
 
         if (scriptLoader->willExecuteWhenDocumentFinishedParsing()) {
-            requestDeferredScript(script);
+            requestDeferredScript(prep.resource(), script);
         } else if (scriptLoader->readyToBeParserExecuted()) {
             if (m_scriptNestingLevel == 1) {
                 m_parserBlockingScript.setElement(script);
@@ -323,7 +322,7 @@
                 scriptLoader->executeScript(sourceCode);
             }
         } else {
-            requestParsingBlockingScript(script);
+            requestParsingBlockingScript(prep.resource(), script);
         }
     }
 }
diff --git a/Source/core/html/parser/HTMLScriptRunner.h b/Source/core/html/parser/HTMLScriptRunner.h
index e193f95..23588ef 100644
--- a/Source/core/html/parser/HTMLScriptRunner.h
+++ b/Source/core/html/parser/HTMLScriptRunner.h
@@ -77,9 +77,9 @@
     void executePendingScriptAndDispatchEvent(PendingScript&, PendingScriptType);
     void executeParsingBlockingScripts();
 
-    void requestParsingBlockingScript(Element*);
-    void requestDeferredScript(Element*);
-    bool requestPendingScript(PendingScript&, Element*) const;
+    void requestParsingBlockingScript(const ResourcePtr<ScriptResource>&, Element*);
+    void requestDeferredScript(const ResourcePtr<ScriptResource>&, Element*);
+    bool requestPendingScript(const ResourcePtr<ScriptResource>&, PendingScript&, Element*) const;
 
     void runScript(Element*, const TextPosition& scriptStartPosition);
 
diff --git a/Source/core/html/parser/HTMLSrcsetParserTest.cpp b/Source/core/html/parser/HTMLSrcsetParserTest.cpp
index 418e19e..ec00f58 100644
--- a/Source/core/html/parser/HTMLSrcsetParserTest.cpp
+++ b/Source/core/html/parser/HTMLSrcsetParserTest.cpp
@@ -44,6 +44,10 @@
         {4.0, -1, "", "1x,,  ,   x    ,2x  , 1x.gif, 3x, 4x.gif 4x 100h, 5x.gif 5, dx.gif dx, 2x.gif   2x ,", "4x.gif", 4.0, -1},
         {1.0, -1, "", "1x,,  ,   x    ,2x  , 1x.gif, 3x, 4x.gif 4x 100h, 5x.gif 5, dx.gif dx, 2x.gif   2x ,", "1x,", 1.0, -1},
         {5.0, -1, "", "1x,,  ,   x    ,2x  , 1x.gif, 3x, 4x.gif 4x 100h, 5x.gif 5, dx.gif dx, 2x.gif   2x ,", "4x.gif", 4.0, -1},
+        {2.0, -1, "", "1x.gif 1x, data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDAiIGhlaWdodD0iMTAwIj4KCTxyZWN0IHdpZHRoPSIxMDAiIGhlaWdodD0iMTAwIiBmaWxsPSJncmVlbiIvPgo8L3N2Zz4K 2x", "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDAiIGhlaWdodD0iMTAwIj4KCTxyZWN0IHdpZHRoPSIxMDAiIGhlaWdodD0iMTAwIiBmaWxsPSJncmVlbiIvPgo8L3N2Zz4K", 2.0, -1 },
+        {2.0, -1, "1x.gif", "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDAiIGhlaWdodD0iMTAwIj4KCTxyZWN0IHdpZHRoPSIxMDAiIGhlaWdodD0iMTAwIiBmaWxsPSJncmVlbiIvPgo8L3N2Zz4K 2x", "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDAiIGhlaWdodD0iMTAwIj4KCTxyZWN0IHdpZHRoPSIxMDAiIGhlaWdodD0iMTAwIiBmaWxsPSJncmVlbiIvPgo8L3N2Zz4K", 2.0, -1 },
+        {2.0, -1, "1x.svg#red", "1x.svg#green 2x", "1x.svg#green", 2.0, -1 },
+        {2.0, -1, "", "1x.svg#red 1x, 1x.svg#green 2x", "1x.svg#green", 2.0, -1 },
         {1.0, 400, "", "400.gif 400w, 6000.gif 6000w", "400.gif", 1.0, 400},
         {2.0, 400, "", "400.gif 400w, 6000.gif 6000w", "6000.gif", 15.0, 6000},
         {1.0, 400, "src.gif", "800.gif 800w", "800.gif", 2.0, 800},
diff --git a/Source/core/html/shadow/ClearButtonElement.cpp b/Source/core/html/shadow/ClearButtonElement.cpp
index c67e02d..5527cdf 100644
--- a/Source/core/html/shadow/ClearButtonElement.cpp
+++ b/Source/core/html/shadow/ClearButtonElement.cpp
@@ -43,9 +43,9 @@
 {
 }
 
-PassRefPtr<ClearButtonElement> ClearButtonElement::create(Document& document, ClearButtonOwner& clearButtonOwner)
+PassRefPtrWillBeRawPtr<ClearButtonElement> ClearButtonElement::create(Document& document, ClearButtonOwner& clearButtonOwner)
 {
-    RefPtr<ClearButtonElement> element = adoptRef(new ClearButtonElement(document, clearButtonOwner));
+    RefPtrWillBeRawPtr<ClearButtonElement> element = adoptRefWillBeRefCountedGarbageCollected(new ClearButtonElement(document, clearButtonOwner));
     element->setShadowPseudoId(AtomicString("-webkit-clear-button", AtomicString::ConstructFromLiteral));
     element->setAttribute(idAttr, ShadowElementNames::clearButton());
     return element.release();
@@ -117,4 +117,10 @@
     return true;
 }
 
+void ClearButtonElement::trace(Visitor* visitor)
+{
+    visitor->trace(m_clearButtonOwner);
+    HTMLDivElement::trace(visitor);
+}
+
 }
diff --git a/Source/core/html/shadow/ClearButtonElement.h b/Source/core/html/shadow/ClearButtonElement.h
index 6acf100..eba5309 100644
--- a/Source/core/html/shadow/ClearButtonElement.h
+++ b/Source/core/html/shadow/ClearButtonElement.h
@@ -33,7 +33,7 @@
 
 class ClearButtonElement FINAL : public HTMLDivElement {
 public:
-    class ClearButtonOwner {
+    class ClearButtonOwner : public WillBeGarbageCollectedMixin {
     public:
         virtual ~ClearButtonOwner() { }
         virtual void focusAndSelectClearButtonOwner() = 0;
@@ -41,9 +41,11 @@
         virtual void clearValue() = 0;
     };
 
-    static PassRefPtr<ClearButtonElement> create(Document&, ClearButtonOwner&);
+    static PassRefPtrWillBeRawPtr<ClearButtonElement> create(Document&, ClearButtonOwner&);
     void releaseCapture();
-    void removeClearButtonOwner() { m_clearButtonOwner = 0; }
+    void removeClearButtonOwner() { m_clearButtonOwner = nullptr; }
+
+    virtual void trace(Visitor*) OVERRIDE;
 
 private:
     ClearButtonElement(Document&, ClearButtonOwner&);
@@ -52,7 +54,7 @@
     virtual void defaultEventHandler(Event*) OVERRIDE;
     virtual bool isClearButtonElement() const OVERRIDE;
 
-    ClearButtonOwner* m_clearButtonOwner;
+    RawPtrWillBeMember<ClearButtonOwner> m_clearButtonOwner;
     bool m_capturing;
 };
 
diff --git a/Source/core/html/shadow/DateTimeEditElement.cpp b/Source/core/html/shadow/DateTimeEditElement.cpp
index 11dde15..a7a70f9 100644
--- a/Source/core/html/shadow/DateTimeEditElement.cpp
+++ b/Source/core/html/shadow/DateTimeEditElement.cpp
@@ -147,7 +147,7 @@
 
     switch (fieldType) {
     case DateTimeFormat::FieldTypeDayOfMonth: {
-        RefPtr<DateTimeFieldElement> field = DateTimeDayFieldElement::create(document, m_editElement, m_parameters.placeholderForDay, m_dayRange);
+        RefPtrWillBeRawPtr<DateTimeFieldElement> field = DateTimeDayFieldElement::create(document, m_editElement, m_parameters.placeholderForDay, m_dayRange);
         m_editElement.addField(field);
         if (shouldDayOfMonthFieldDisabled()) {
             field->setValueAsDate(m_dateValue);
@@ -158,7 +158,7 @@
 
     case DateTimeFormat::FieldTypeHour11: {
         DateTimeNumericFieldElement::Step step = createStep(msPerHour, msPerHour * 12);
-        RefPtr<DateTimeFieldElement> field = DateTimeHour11FieldElement::create(document, m_editElement, m_hour23Range, step);
+        RefPtrWillBeRawPtr<DateTimeFieldElement> field = DateTimeHour11FieldElement::create(document, m_editElement, m_hour23Range, step);
         m_editElement.addField(field);
         if (shouldHourFieldDisabled()) {
             field->setValueAsDate(m_dateValue);
@@ -169,7 +169,7 @@
 
     case DateTimeFormat::FieldTypeHour12: {
         DateTimeNumericFieldElement::Step step = createStep(msPerHour, msPerHour * 12);
-        RefPtr<DateTimeFieldElement> field = DateTimeHour12FieldElement::create(document, m_editElement, m_hour23Range, step);
+        RefPtrWillBeRawPtr<DateTimeFieldElement> field = DateTimeHour12FieldElement::create(document, m_editElement, m_hour23Range, step);
         m_editElement.addField(field);
         if (shouldHourFieldDisabled()) {
             field->setValueAsDate(m_dateValue);
@@ -180,7 +180,7 @@
 
     case DateTimeFormat::FieldTypeHour23: {
         DateTimeNumericFieldElement::Step step = createStep(msPerHour, msPerDay);
-        RefPtr<DateTimeFieldElement> field = DateTimeHour23FieldElement::create(document, m_editElement, m_hour23Range, step);
+        RefPtrWillBeRawPtr<DateTimeFieldElement> field = DateTimeHour23FieldElement::create(document, m_editElement, m_hour23Range, step);
         m_editElement.addField(field);
         if (shouldHourFieldDisabled()) {
             field->setValueAsDate(m_dateValue);
@@ -191,7 +191,7 @@
 
     case DateTimeFormat::FieldTypeHour24: {
         DateTimeNumericFieldElement::Step step = createStep(msPerHour, msPerDay);
-        RefPtr<DateTimeFieldElement> field = DateTimeHour24FieldElement::create(document, m_editElement, m_hour23Range, step);
+        RefPtrWillBeRawPtr<DateTimeFieldElement> field = DateTimeHour24FieldElement::create(document, m_editElement, m_hour23Range, step);
         m_editElement.addField(field);
         if (shouldHourFieldDisabled()) {
             field->setValueAsDate(m_dateValue);
@@ -202,7 +202,7 @@
 
     case DateTimeFormat::FieldTypeMinute: {
         DateTimeNumericFieldElement::Step step = createStep(msPerMinute, msPerHour);
-        RefPtr<DateTimeNumericFieldElement> field = DateTimeMinuteFieldElement::create(document, m_editElement, m_minuteRange, step);
+        RefPtrWillBeRawPtr<DateTimeNumericFieldElement> field = DateTimeMinuteFieldElement::create(document, m_editElement, m_minuteRange, step);
         m_editElement.addField(field);
         if (shouldMinuteFieldDisabled()) {
             field->setValueAsDate(m_dateValue);
@@ -221,7 +221,7 @@
             minMonth = m_parameters.minimum.month();
             maxMonth = m_parameters.maximum.month();
         }
-        RefPtr<DateTimeFieldElement> field;
+        RefPtrWillBeRawPtr<DateTimeFieldElement> field;
         switch (count) {
         case countForNarrowMonth: // Fallthrough.
         case countForAbbreviatedMonth:
@@ -243,7 +243,7 @@
     }
 
     case DateTimeFormat::FieldTypePeriod: {
-        RefPtr<DateTimeFieldElement> field = DateTimeAMPMFieldElement::create(document, m_editElement, m_parameters.locale.timeAMPMLabels());
+        RefPtrWillBeRawPtr<DateTimeFieldElement> field = DateTimeAMPMFieldElement::create(document, m_editElement, m_parameters.locale.timeAMPMLabels());
         m_editElement.addField(field);
         if (shouldAMPMFieldDisabled()) {
             field->setValueAsDate(m_dateValue);
@@ -254,7 +254,7 @@
 
     case DateTimeFormat::FieldTypeSecond: {
         DateTimeNumericFieldElement::Step step = createStep(msPerSecond, msPerMinute);
-        RefPtr<DateTimeNumericFieldElement> field = DateTimeSecondFieldElement::create(document, m_editElement, m_secondRange, step);
+        RefPtrWillBeRawPtr<DateTimeNumericFieldElement> field = DateTimeSecondFieldElement::create(document, m_editElement, m_secondRange, step);
         m_editElement.addField(field);
         if (shouldSecondFieldDisabled()) {
             field->setValueAsDate(m_dateValue);
@@ -270,7 +270,7 @@
 
     case DateTimeFormat::FieldTypeFractionalSecond: {
         DateTimeNumericFieldElement::Step step = createStep(1, msPerSecond);
-        RefPtr<DateTimeNumericFieldElement> field = DateTimeMillisecondFieldElement::create(document, m_editElement, m_millisecondRange, step);
+        RefPtrWillBeRawPtr<DateTimeNumericFieldElement> field = DateTimeMillisecondFieldElement::create(document, m_editElement, m_millisecondRange, step);
         m_editElement.addField(field);
         if (shouldMillisecondFieldDisabled()) {
             field->setValueAsDate(m_dateValue);
@@ -313,7 +313,7 @@
             std::swap(yearParams.minIsSpecified, yearParams.maxIsSpecified);
         }
         yearParams.placeholder = m_parameters.placeholderForYear;
-        RefPtr<DateTimeFieldElement> field = DateTimeYearFieldElement::create(document, m_editElement, yearParams);
+        RefPtrWillBeRawPtr<DateTimeFieldElement> field = DateTimeYearFieldElement::create(document, m_editElement, yearParams);
         m_editElement.addField(field);
         if (shouldYearFieldDisabled()) {
             field->setValueAsDate(m_dateValue);
@@ -454,13 +454,22 @@
 #endif
 }
 
+void DateTimeEditElement::trace(Visitor* visitor)
+{
+#if ENABLE(OILPAN)
+    visitor->trace(m_fields);
+#endif
+    visitor->trace(m_editControlOwner);
+    HTMLDivElement::trace(visitor);
+}
+
 inline Element* DateTimeEditElement::fieldsWrapperElement() const
 {
     ASSERT(firstChild());
     return toElement(firstChild());
 }
 
-void DateTimeEditElement::addField(PassRefPtr<DateTimeFieldElement> field)
+void DateTimeEditElement::addField(PassRefPtrWillBeRawPtr<DateTimeFieldElement> field)
 {
     if (m_fields.size() == m_fields.capacity())
         return;
@@ -483,9 +492,9 @@
         field->blur();
 }
 
-PassRefPtr<DateTimeEditElement> DateTimeEditElement::create(Document& document, EditControlOwner& editControlOwner)
+PassRefPtrWillBeRawPtr<DateTimeEditElement> DateTimeEditElement::create(Document& document, EditControlOwner& editControlOwner)
 {
-    RefPtr<DateTimeEditElement> container = adoptRef(new DateTimeEditElement(document, editControlOwner));
+    RefPtrWillBeRawPtr<DateTimeEditElement> container = adoptRefWillBeRefCountedGarbageCollected(new DateTimeEditElement(document, editControlOwner));
     container->setShadowPseudoId(AtomicString("-webkit-datetime-edit", AtomicString::ConstructFromLiteral));
     container->setAttribute(idAttr, ShadowElementNames::dateTimeEdit());
     return container.release();
@@ -536,7 +545,7 @@
 
 DateTimeFieldElement* DateTimeEditElement::fieldAt(size_t fieldIndex) const
 {
-    return fieldIndex < m_fields.size() ? m_fields[fieldIndex] : 0;
+    return fieldIndex < m_fields.size() ? m_fields[fieldIndex].get() : 0;
 }
 
 size_t DateTimeEditElement::fieldIndexOf(const DateTimeFieldElement& field) const
diff --git a/Source/core/html/shadow/DateTimeEditElement.h b/Source/core/html/shadow/DateTimeEditElement.h
index eb2c0a6..8621afd 100644
--- a/Source/core/html/shadow/DateTimeEditElement.h
+++ b/Source/core/html/shadow/DateTimeEditElement.h
@@ -45,11 +45,12 @@
 //  - Hour, Minute, Second, Millisecond, AM/PM
 class DateTimeEditElement FINAL : public HTMLDivElement, public DateTimeFieldElement::FieldOwner {
     WTF_MAKE_NONCOPYABLE(DateTimeEditElement);
+    WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(DateTimeEditElement);
 
 public:
     // EditControlOwner implementer must call removeEditControlOwner when
     // it doesn't handle event, e.g. at destruction.
-    class EditControlOwner {
+    class EditControlOwner : public WillBeGarbageCollectedMixin {
     public:
         virtual ~EditControlOwner();
         virtual void didBlurFromControl() = 0;
@@ -80,10 +81,12 @@
         }
     };
 
-    static PassRefPtr<DateTimeEditElement> create(Document&, EditControlOwner&);
+    static PassRefPtrWillBeRawPtr<DateTimeEditElement> create(Document&, EditControlOwner&);
 
     virtual ~DateTimeEditElement();
-    void addField(PassRefPtr<DateTimeFieldElement>);
+    virtual void trace(Visitor*) OVERRIDE;
+
+    void addField(PassRefPtrWillBeRawPtr<DateTimeFieldElement>);
     bool anyEditableFieldsHaveValues() const;
     void blurByOwner();
     virtual void defaultEventHandler(Event*) OVERRIDE;
@@ -95,7 +98,7 @@
     void focusByOwner(Element* oldFocusedElement = 0);
     bool hasFocusedField();
     void readOnlyStateChanged();
-    void removeEditControlOwner() { m_editControlOwner = 0; }
+    void removeEditControlOwner() { m_editControlOwner = nullptr; }
     void resetFields();
     void setEmptyValue(const LayoutParameters&, const DateComponents& dateForReadOnlyField);
     void setValueAsDate(const LayoutParameters&, const DateComponents&);
@@ -147,8 +150,8 @@
     virtual AtomicString localeIdentifier() const OVERRIDE;
     virtual void fieldDidChangeValueByKeyboard() OVERRIDE;
 
-    Vector<DateTimeFieldElement*, maximumNumberOfFields> m_fields;
-    EditControlOwner* m_editControlOwner;
+    WillBeHeapVector<RawPtrWillBeMember<DateTimeFieldElement>, maximumNumberOfFields> m_fields;
+    RawPtrWillBeMember<EditControlOwner> m_editControlOwner;
 };
 
 DEFINE_TYPE_CASTS(DateTimeEditElement, Element, element, element->isDateTimeEditElement(), element.isDateTimeEditElement());
diff --git a/Source/core/html/shadow/DateTimeFieldElement.cpp b/Source/core/html/shadow/DateTimeFieldElement.cpp
index e9e221c..163a7df 100644
--- a/Source/core/html/shadow/DateTimeFieldElement.cpp
+++ b/Source/core/html/shadow/DateTimeFieldElement.cpp
@@ -52,6 +52,12 @@
 {
 }
 
+void DateTimeFieldElement::trace(Visitor* visitor)
+{
+    visitor->trace(m_fieldOwner);
+    HTMLSpanElement::trace(visitor);
+}
+
 void DateTimeFieldElement::defaultEventHandler(Event* event)
 {
     if (event->isKeyboardEvent()) {
diff --git a/Source/core/html/shadow/DateTimeFieldElement.h b/Source/core/html/shadow/DateTimeFieldElement.h
index ade59e0..1fe3259 100644
--- a/Source/core/html/shadow/DateTimeFieldElement.h
+++ b/Source/core/html/shadow/DateTimeFieldElement.h
@@ -48,7 +48,7 @@
 
     // FieldOwner implementer must call removeEventHandler when
     // it doesn't handle event, e.g. at destruction.
-    class FieldOwner {
+    class FieldOwner : public WillBeGarbageCollectedMixin {
     public:
         virtual ~FieldOwner();
         virtual void didBlurFromField() = 0;
@@ -67,7 +67,7 @@
     bool isDisabled() const;
     virtual float maximumWidth(const Font&);
     virtual void populateDateTimeFieldsState(DateTimeFieldsState&) = 0;
-    void removeEventHandler() { m_fieldOwner = 0; }
+    void removeEventHandler() { m_fieldOwner = nullptr; }
     void setDisabled();
     virtual void setEmptyValue(EventBehavior = DispatchNoEvent) = 0;
     virtual void setValueAsDate(const DateComponents&) = 0;
@@ -77,6 +77,7 @@
     virtual void stepUp() = 0;
     virtual String value() const = 0;
     virtual String visibleValue() const = 0;
+    virtual void trace(Visitor*) OVERRIDE;
 
 protected:
     DateTimeFieldElement(Document&, FieldOwner&);
@@ -99,7 +100,7 @@
     bool isFieldOwnerReadOnly() const;
     virtual bool supportsFocus() const OVERRIDE FINAL;
 
-    FieldOwner* m_fieldOwner;
+    RawPtrWillBeMember<FieldOwner> m_fieldOwner;
 };
 
 } // namespace WebCore
diff --git a/Source/core/html/shadow/DateTimeFieldElements.cpp b/Source/core/html/shadow/DateTimeFieldElements.cpp
index 5353c04..f91ff1f 100644
--- a/Source/core/html/shadow/DateTimeFieldElements.cpp
+++ b/Source/core/html/shadow/DateTimeFieldElements.cpp
@@ -47,10 +47,10 @@
 {
 }
 
-PassRefPtr<DateTimeAMPMFieldElement> DateTimeAMPMFieldElement::create(Document& document, FieldOwner& fieldOwner, const Vector<String>& ampmLabels)
+PassRefPtrWillBeRawPtr<DateTimeAMPMFieldElement> DateTimeAMPMFieldElement::create(Document& document, FieldOwner& fieldOwner, const Vector<String>& ampmLabels)
 {
     DEFINE_STATIC_LOCAL(AtomicString, ampmPsuedoId, ("-webkit-datetime-edit-ampm-field", AtomicString::ConstructFromLiteral));
-    RefPtr<DateTimeAMPMFieldElement> field = adoptRef(new DateTimeAMPMFieldElement(document, fieldOwner, ampmLabels));
+    RefPtrWillBeRawPtr<DateTimeAMPMFieldElement> field = adoptRefWillBeRefCountedGarbageCollected(new DateTimeAMPMFieldElement(document, fieldOwner, ampmLabels));
     field->initialize(ampmPsuedoId, queryString(WebLocalizedString::AXAMPMFieldText));
     return field.release();
 }
@@ -83,10 +83,10 @@
 {
 }
 
-PassRefPtr<DateTimeDayFieldElement> DateTimeDayFieldElement::create(Document& document, FieldOwner& fieldOwner, const String& placeholder, const Range& range)
+PassRefPtrWillBeRawPtr<DateTimeDayFieldElement> DateTimeDayFieldElement::create(Document& document, FieldOwner& fieldOwner, const String& placeholder, const Range& range)
 {
     DEFINE_STATIC_LOCAL(AtomicString, dayPsuedoId, ("-webkit-datetime-edit-day-field", AtomicString::ConstructFromLiteral));
-    RefPtr<DateTimeDayFieldElement> field = adoptRef(new DateTimeDayFieldElement(document, fieldOwner, placeholder.isEmpty() ? "--" : placeholder, range));
+    RefPtrWillBeRawPtr<DateTimeDayFieldElement> field = adoptRefWillBeRefCountedGarbageCollected(new DateTimeDayFieldElement(document, fieldOwner, placeholder.isEmpty() ? "--" : placeholder, range));
     field->initialize(dayPsuedoId, queryString(WebLocalizedString::AXDayOfMonthFieldText));
     return field.release();
 }
@@ -159,7 +159,7 @@
 {
 }
 
-PassRefPtr<DateTimeHour11FieldElement> DateTimeHour11FieldElement::create(Document& document, FieldOwner& fieldOwner, const Range& hour23Range, const Step& step)
+PassRefPtrWillBeRawPtr<DateTimeHour11FieldElement> DateTimeHour11FieldElement::create(Document& document, FieldOwner& fieldOwner, const Range& hour23Range, const Step& step)
 {
     ASSERT(hour23Range.minimum >= 0);
     ASSERT(hour23Range.maximum <= 23);
@@ -172,7 +172,7 @@
         range.maximum = hour23Range.maximum - 12;
     }
 
-    RefPtr<DateTimeHour11FieldElement> field = adoptRef(new DateTimeHour11FieldElement(document, fieldOwner, range, step));
+    RefPtrWillBeRawPtr<DateTimeHour11FieldElement> field = adoptRefWillBeRefCountedGarbageCollected(new DateTimeHour11FieldElement(document, fieldOwner, range, step));
     field->initialize();
     return field.release();
 }
@@ -200,7 +200,7 @@
 {
 }
 
-PassRefPtr<DateTimeHour12FieldElement> DateTimeHour12FieldElement::create(Document& document, FieldOwner& fieldOwner, const Range& hour23Range, const Step& step)
+PassRefPtrWillBeRawPtr<DateTimeHour12FieldElement> DateTimeHour12FieldElement::create(Document& document, FieldOwner& fieldOwner, const Range& hour23Range, const Step& step)
 {
     ASSERT(hour23Range.minimum >= 0);
     ASSERT(hour23Range.maximum <= 23);
@@ -220,7 +220,7 @@
         range.minimum = 1;
         range.maximum = 12;
     }
-    RefPtr<DateTimeHour12FieldElement> field = adoptRef(new DateTimeHour12FieldElement(document, fieldOwner, range, step));
+    RefPtrWillBeRawPtr<DateTimeHour12FieldElement> field = adoptRefWillBeRefCountedGarbageCollected(new DateTimeHour12FieldElement(document, fieldOwner, range, step));
     field->initialize();
     return field.release();
 }
@@ -243,12 +243,12 @@
 {
 }
 
-PassRefPtr<DateTimeHour23FieldElement> DateTimeHour23FieldElement::create(Document& document, FieldOwner& fieldOwner, const Range& hour23Range, const Step& step)
+PassRefPtrWillBeRawPtr<DateTimeHour23FieldElement> DateTimeHour23FieldElement::create(Document& document, FieldOwner& fieldOwner, const Range& hour23Range, const Step& step)
 {
     ASSERT(hour23Range.minimum >= 0);
     ASSERT(hour23Range.maximum <= 23);
     ASSERT(hour23Range.minimum <= hour23Range.maximum);
-    RefPtr<DateTimeHour23FieldElement> field = adoptRef(new DateTimeHour23FieldElement(document, fieldOwner, hour23Range, step));
+    RefPtrWillBeRawPtr<DateTimeHour23FieldElement> field = adoptRefWillBeRefCountedGarbageCollected(new DateTimeHour23FieldElement(document, fieldOwner, hour23Range, step));
     field->initialize();
     return field.release();
 }
@@ -279,7 +279,7 @@
 {
 }
 
-PassRefPtr<DateTimeHour24FieldElement> DateTimeHour24FieldElement::create(Document& document, FieldOwner& fieldOwner, const Range& hour23Range, const Step& step)
+PassRefPtrWillBeRawPtr<DateTimeHour24FieldElement> DateTimeHour24FieldElement::create(Document& document, FieldOwner& fieldOwner, const Range& hour23Range, const Step& step)
 {
     ASSERT(hour23Range.minimum >= 0);
     ASSERT(hour23Range.maximum <= 23);
@@ -290,7 +290,7 @@
         range.maximum = 24;
     }
 
-    RefPtr<DateTimeHour24FieldElement> field = adoptRef(new DateTimeHour24FieldElement(document, fieldOwner, range, step));
+    RefPtrWillBeRawPtr<DateTimeHour24FieldElement> field = adoptRefWillBeRefCountedGarbageCollected(new DateTimeHour24FieldElement(document, fieldOwner, range, step));
     field->initialize();
     return field.release();
 }
@@ -326,10 +326,10 @@
 {
 }
 
-PassRefPtr<DateTimeMillisecondFieldElement> DateTimeMillisecondFieldElement::create(Document& document, FieldOwner& fieldOwner, const Range& range, const Step& step)
+PassRefPtrWillBeRawPtr<DateTimeMillisecondFieldElement> DateTimeMillisecondFieldElement::create(Document& document, FieldOwner& fieldOwner, const Range& range, const Step& step)
 {
     DEFINE_STATIC_LOCAL(AtomicString, millisecondPsuedoId, ("-webkit-datetime-edit-millisecond-field", AtomicString::ConstructFromLiteral));
-    RefPtr<DateTimeMillisecondFieldElement> field = adoptRef(new DateTimeMillisecondFieldElement(document, fieldOwner, range, step));
+    RefPtrWillBeRawPtr<DateTimeMillisecondFieldElement> field = adoptRefWillBeRefCountedGarbageCollected(new DateTimeMillisecondFieldElement(document, fieldOwner, range, step));
     field->initialize(millisecondPsuedoId, queryString(WebLocalizedString::AXMillisecondFieldText));
     return field.release();
 }
@@ -367,10 +367,10 @@
 {
 }
 
-PassRefPtr<DateTimeMinuteFieldElement> DateTimeMinuteFieldElement::create(Document& document, FieldOwner& fieldOwner, const Range& range, const Step& step)
+PassRefPtrWillBeRawPtr<DateTimeMinuteFieldElement> DateTimeMinuteFieldElement::create(Document& document, FieldOwner& fieldOwner, const Range& range, const Step& step)
 {
     DEFINE_STATIC_LOCAL(AtomicString, minutePsuedoId, ("-webkit-datetime-edit-minute-field", AtomicString::ConstructFromLiteral));
-    RefPtr<DateTimeMinuteFieldElement> field = adoptRef(new DateTimeMinuteFieldElement(document, fieldOwner, range, step));
+    RefPtrWillBeRawPtr<DateTimeMinuteFieldElement> field = adoptRefWillBeRefCountedGarbageCollected(new DateTimeMinuteFieldElement(document, fieldOwner, range, step));
     field->initialize(minutePsuedoId, queryString(WebLocalizedString::AXMinuteFieldText));
     return field.release();
 }
@@ -408,10 +408,10 @@
 {
 }
 
-PassRefPtr<DateTimeMonthFieldElement> DateTimeMonthFieldElement::create(Document& document, FieldOwner& fieldOwner, const String& placeholder, const Range& range)
+PassRefPtrWillBeRawPtr<DateTimeMonthFieldElement> DateTimeMonthFieldElement::create(Document& document, FieldOwner& fieldOwner, const String& placeholder, const Range& range)
 {
     DEFINE_STATIC_LOCAL(AtomicString, monthPsuedoId, ("-webkit-datetime-edit-month-field", AtomicString::ConstructFromLiteral));
-    RefPtr<DateTimeMonthFieldElement> field = adoptRef(new DateTimeMonthFieldElement(document, fieldOwner, placeholder.isEmpty() ? "--" : placeholder, range));
+    RefPtrWillBeRawPtr<DateTimeMonthFieldElement> field = adoptRefWillBeRefCountedGarbageCollected(new DateTimeMonthFieldElement(document, fieldOwner, placeholder.isEmpty() ? "--" : placeholder, range));
     field->initialize(monthPsuedoId, queryString(WebLocalizedString::AXMonthFieldText));
     return field.release();
 }
@@ -449,10 +449,10 @@
 {
 }
 
-PassRefPtr<DateTimeSecondFieldElement> DateTimeSecondFieldElement::create(Document& document, FieldOwner& fieldOwner, const Range& range, const Step& step)
+PassRefPtrWillBeRawPtr<DateTimeSecondFieldElement> DateTimeSecondFieldElement::create(Document& document, FieldOwner& fieldOwner, const Range& range, const Step& step)
 {
     DEFINE_STATIC_LOCAL(AtomicString, secondPsuedoId, ("-webkit-datetime-edit-second-field", AtomicString::ConstructFromLiteral));
-    RefPtr<DateTimeSecondFieldElement> field = adoptRef(new DateTimeSecondFieldElement(document, fieldOwner, range, step));
+    RefPtrWillBeRawPtr<DateTimeSecondFieldElement> field = adoptRefWillBeRefCountedGarbageCollected(new DateTimeSecondFieldElement(document, fieldOwner, range, step));
     field->initialize(secondPsuedoId, queryString(WebLocalizedString::AXSecondFieldText));
     return field.release();
 }
@@ -490,10 +490,10 @@
 {
 }
 
-PassRefPtr<DateTimeSymbolicMonthFieldElement> DateTimeSymbolicMonthFieldElement::create(Document& document, FieldOwner& fieldOwner, const Vector<String>& labels, int minimum, int maximum)
+PassRefPtrWillBeRawPtr<DateTimeSymbolicMonthFieldElement> DateTimeSymbolicMonthFieldElement::create(Document& document, FieldOwner& fieldOwner, const Vector<String>& labels, int minimum, int maximum)
 {
     DEFINE_STATIC_LOCAL(AtomicString, monthPsuedoId, ("-webkit-datetime-edit-month-field", AtomicString::ConstructFromLiteral));
-    RefPtr<DateTimeSymbolicMonthFieldElement> field = adoptRef(new DateTimeSymbolicMonthFieldElement(document, fieldOwner, labels, minimum, maximum));
+    RefPtrWillBeRawPtr<DateTimeSymbolicMonthFieldElement> field = adoptRefWillBeRefCountedGarbageCollected(new DateTimeSymbolicMonthFieldElement(document, fieldOwner, labels, minimum, maximum));
     field->initialize(monthPsuedoId, queryString(WebLocalizedString::AXMonthFieldText));
     return field.release();
 }
@@ -534,10 +534,10 @@
 {
 }
 
-PassRefPtr<DateTimeWeekFieldElement> DateTimeWeekFieldElement::create(Document& document, FieldOwner& fieldOwner, const Range& range)
+PassRefPtrWillBeRawPtr<DateTimeWeekFieldElement> DateTimeWeekFieldElement::create(Document& document, FieldOwner& fieldOwner, const Range& range)
 {
     DEFINE_STATIC_LOCAL(AtomicString, weekPsuedoId, ("-webkit-datetime-edit-week-field", AtomicString::ConstructFromLiteral));
-    RefPtr<DateTimeWeekFieldElement> field = adoptRef(new DateTimeWeekFieldElement(document, fieldOwner, range));
+    RefPtrWillBeRawPtr<DateTimeWeekFieldElement> field = adoptRefWillBeRefCountedGarbageCollected(new DateTimeWeekFieldElement(document, fieldOwner, range));
     field->initialize(weekPsuedoId, queryString(WebLocalizedString::AXWeekOfYearFieldText));
     return field.release();
 }
@@ -579,10 +579,10 @@
     ASSERT(parameters.maximumYear <= DateComponents::maximumYear());
 }
 
-PassRefPtr<DateTimeYearFieldElement> DateTimeYearFieldElement::create(Document& document, FieldOwner& fieldOwner, const DateTimeYearFieldElement::Parameters& parameters)
+PassRefPtrWillBeRawPtr<DateTimeYearFieldElement> DateTimeYearFieldElement::create(Document& document, FieldOwner& fieldOwner, const DateTimeYearFieldElement::Parameters& parameters)
 {
     DEFINE_STATIC_LOCAL(AtomicString, yearPsuedoId, ("-webkit-datetime-edit-year-field", AtomicString::ConstructFromLiteral));
-    RefPtr<DateTimeYearFieldElement> field = adoptRef(new DateTimeYearFieldElement(document, fieldOwner, parameters));
+    RefPtrWillBeRawPtr<DateTimeYearFieldElement> field = adoptRefWillBeRefCountedGarbageCollected(new DateTimeYearFieldElement(document, fieldOwner, parameters));
     field->initialize(yearPsuedoId, queryString(WebLocalizedString::AXYearFieldText));
     return field.release();
 }
diff --git a/Source/core/html/shadow/DateTimeFieldElements.h b/Source/core/html/shadow/DateTimeFieldElements.h
index d2a2da4..19050db 100644
--- a/Source/core/html/shadow/DateTimeFieldElements.h
+++ b/Source/core/html/shadow/DateTimeFieldElements.h
@@ -36,7 +36,7 @@
     WTF_MAKE_NONCOPYABLE(DateTimeAMPMFieldElement);
 
 public:
-    static PassRefPtr<DateTimeAMPMFieldElement> create(Document&, FieldOwner&, const Vector<String>&);
+    static PassRefPtrWillBeRawPtr<DateTimeAMPMFieldElement> create(Document&, FieldOwner&, const Vector<String>&);
 
 private:
     DateTimeAMPMFieldElement(Document&, FieldOwner&, const Vector<String>&);
@@ -51,7 +51,7 @@
     WTF_MAKE_NONCOPYABLE(DateTimeDayFieldElement);
 
 public:
-    static PassRefPtr<DateTimeDayFieldElement> create(Document&, FieldOwner&, const String& placeholder, const Range&);
+    static PassRefPtrWillBeRawPtr<DateTimeDayFieldElement> create(Document&, FieldOwner&, const String& placeholder, const Range&);
 
 private:
     DateTimeDayFieldElement(Document&, FieldOwner&, const String& placeholder, const Range&);
@@ -79,7 +79,7 @@
     WTF_MAKE_NONCOPYABLE(DateTimeHour11FieldElement);
 
 public:
-    static PassRefPtr<DateTimeHour11FieldElement> create(Document&, FieldOwner&, const Range&, const Step&);
+    static PassRefPtrWillBeRawPtr<DateTimeHour11FieldElement> create(Document&, FieldOwner&, const Range&, const Step&);
 
 private:
     DateTimeHour11FieldElement(Document&, FieldOwner&, const Range& hour23Range, const Step&);
@@ -93,7 +93,7 @@
     WTF_MAKE_NONCOPYABLE(DateTimeHour12FieldElement);
 
 public:
-    static PassRefPtr<DateTimeHour12FieldElement> create(Document&, FieldOwner&, const Range&, const Step&);
+    static PassRefPtrWillBeRawPtr<DateTimeHour12FieldElement> create(Document&, FieldOwner&, const Range&, const Step&);
 
 private:
     DateTimeHour12FieldElement(Document&, FieldOwner&, const Range& hour23Range, const Step&);
@@ -107,7 +107,7 @@
     WTF_MAKE_NONCOPYABLE(DateTimeHour23FieldElement);
 
 public:
-    static PassRefPtr<DateTimeHour23FieldElement> create(Document&, FieldOwner&, const Range&, const Step&);
+    static PassRefPtrWillBeRawPtr<DateTimeHour23FieldElement> create(Document&, FieldOwner&, const Range&, const Step&);
 
 private:
     DateTimeHour23FieldElement(Document&, FieldOwner&, const Range& hour23Range, const Step&);
@@ -121,7 +121,7 @@
     WTF_MAKE_NONCOPYABLE(DateTimeHour24FieldElement);
 
 public:
-    static PassRefPtr<DateTimeHour24FieldElement> create(Document&, FieldOwner&, const Range&, const Step&);
+    static PassRefPtrWillBeRawPtr<DateTimeHour24FieldElement> create(Document&, FieldOwner&, const Range&, const Step&);
 
 private:
     DateTimeHour24FieldElement(Document&, FieldOwner&, const Range& hour23Range, const Step&);
@@ -135,7 +135,7 @@
     WTF_MAKE_NONCOPYABLE(DateTimeMillisecondFieldElement);
 
 public:
-    static PassRefPtr<DateTimeMillisecondFieldElement> create(Document&, FieldOwner&, const Range&, const Step&);
+    static PassRefPtrWillBeRawPtr<DateTimeMillisecondFieldElement> create(Document&, FieldOwner&, const Range&, const Step&);
 
 private:
     DateTimeMillisecondFieldElement(Document&, FieldOwner&, const Range&, const Step&);
@@ -150,7 +150,7 @@
     WTF_MAKE_NONCOPYABLE(DateTimeMinuteFieldElement);
 
 public:
-    static PassRefPtr<DateTimeMinuteFieldElement> create(Document&, FieldOwner&, const Range&, const Step&);
+    static PassRefPtrWillBeRawPtr<DateTimeMinuteFieldElement> create(Document&, FieldOwner&, const Range&, const Step&);
 
 private:
     DateTimeMinuteFieldElement(Document&, FieldOwner&, const Range&, const Step&);
@@ -165,7 +165,7 @@
     WTF_MAKE_NONCOPYABLE(DateTimeMonthFieldElement);
 
 public:
-    static PassRefPtr<DateTimeMonthFieldElement> create(Document&, FieldOwner&, const String& placeholder, const Range&);
+    static PassRefPtrWillBeRawPtr<DateTimeMonthFieldElement> create(Document&, FieldOwner&, const String& placeholder, const Range&);
 
 private:
     DateTimeMonthFieldElement(Document&, FieldOwner&, const String& placeholder, const Range&);
@@ -180,7 +180,7 @@
     WTF_MAKE_NONCOPYABLE(DateTimeSecondFieldElement);
 
 public:
-    static PassRefPtr<DateTimeSecondFieldElement> create(Document&, FieldOwner&, const Range&, const Step&);
+    static PassRefPtrWillBeRawPtr<DateTimeSecondFieldElement> create(Document&, FieldOwner&, const Range&, const Step&);
 
 private:
     DateTimeSecondFieldElement(Document&, FieldOwner&, const Range&, const Step&);
@@ -195,7 +195,7 @@
     WTF_MAKE_NONCOPYABLE(DateTimeSymbolicMonthFieldElement);
 
 public:
-    static PassRefPtr<DateTimeSymbolicMonthFieldElement> create(Document&, FieldOwner&, const Vector<String>&, int minimum, int maximum);
+    static PassRefPtrWillBeRawPtr<DateTimeSymbolicMonthFieldElement> create(Document&, FieldOwner&, const Vector<String>&, int minimum, int maximum);
 
 private:
     DateTimeSymbolicMonthFieldElement(Document&, FieldOwner&, const Vector<String>&, int minimum, int maximum);
@@ -210,7 +210,7 @@
     WTF_MAKE_NONCOPYABLE(DateTimeWeekFieldElement);
 
 public:
-    static PassRefPtr<DateTimeWeekFieldElement> create(Document&, FieldOwner&, const Range&);
+    static PassRefPtrWillBeRawPtr<DateTimeWeekFieldElement> create(Document&, FieldOwner&, const Range&);
 
 private:
     DateTimeWeekFieldElement(Document&, FieldOwner&, const Range&);
@@ -241,7 +241,7 @@
         }
     };
 
-    static PassRefPtr<DateTimeYearFieldElement> create(Document&, FieldOwner&, const Parameters&);
+    static PassRefPtrWillBeRawPtr<DateTimeYearFieldElement> create(Document&, FieldOwner&, const Parameters&);
 
 private:
     DateTimeYearFieldElement(Document&, FieldOwner&, const Parameters&);
diff --git a/Source/core/html/shadow/PasswordGeneratorButtonElement.cpp b/Source/core/html/shadow/PasswordGeneratorButtonElement.cpp
index b2ac683..a2037dc 100644
--- a/Source/core/html/shadow/PasswordGeneratorButtonElement.cpp
+++ b/Source/core/html/shadow/PasswordGeneratorButtonElement.cpp
@@ -53,9 +53,9 @@
     setHasCustomStyleCallbacks();
 }
 
-PassRefPtr<PasswordGeneratorButtonElement> PasswordGeneratorButtonElement::create(Document& document)
+PassRefPtrWillBeRawPtr<PasswordGeneratorButtonElement> PasswordGeneratorButtonElement::create(Document& document)
 {
-    RefPtr<PasswordGeneratorButtonElement> element = adoptRef(new PasswordGeneratorButtonElement(document));
+    RefPtrWillBeRawPtr<PasswordGeneratorButtonElement> element = adoptRefWillBeRefCountedGarbageCollected(new PasswordGeneratorButtonElement(document));
     element->setAttribute(idAttr, ShadowElementNames::passwordGenerator());
     return element.release();
 }
diff --git a/Source/core/html/shadow/PasswordGeneratorButtonElement.h b/Source/core/html/shadow/PasswordGeneratorButtonElement.h
index 0d220f9..948b015 100644
--- a/Source/core/html/shadow/PasswordGeneratorButtonElement.h
+++ b/Source/core/html/shadow/PasswordGeneratorButtonElement.h
@@ -42,7 +42,7 @@
 
 class PasswordGeneratorButtonElement FINAL : public HTMLDivElement {
 public:
-    static PassRefPtr<PasswordGeneratorButtonElement> create(Document&);
+    static PassRefPtrWillBeRawPtr<PasswordGeneratorButtonElement> create(Document&);
 
     void decorate(HTMLInputElement*);
 
diff --git a/Source/core/html/shadow/PickerIndicatorElement.cpp b/Source/core/html/shadow/PickerIndicatorElement.cpp
index 06452e6..cb31abc 100644
--- a/Source/core/html/shadow/PickerIndicatorElement.cpp
+++ b/Source/core/html/shadow/PickerIndicatorElement.cpp
@@ -50,9 +50,9 @@
 {
 }
 
-PassRefPtr<PickerIndicatorElement> PickerIndicatorElement::create(Document& document, PickerIndicatorOwner& pickerIndicatorOwner)
+PassRefPtrWillBeRawPtr<PickerIndicatorElement> PickerIndicatorElement::create(Document& document, PickerIndicatorOwner& pickerIndicatorOwner)
 {
-    RefPtr<PickerIndicatorElement> element = adoptRef(new PickerIndicatorElement(document, pickerIndicatorOwner));
+    RefPtrWillBeRawPtr<PickerIndicatorElement> element = adoptRefWillBeRefCountedGarbageCollected(new PickerIndicatorElement(document, pickerIndicatorOwner));
     element->setShadowPseudoId(AtomicString("-webkit-calendar-picker-indicator", AtomicString::ConstructFromLiteral));
     element->setAttribute(idAttr, ShadowElementNames::pickerIndicator());
     return element.release();
@@ -143,6 +143,12 @@
     return true;
 }
 
+void PickerIndicatorElement::trace(Visitor* visitor)
+{
+    visitor->trace(m_pickerIndicatorOwner);
+    HTMLDivElement::trace(visitor);
+}
+
 }
 
 #endif
diff --git a/Source/core/html/shadow/PickerIndicatorElement.h b/Source/core/html/shadow/PickerIndicatorElement.h
index 8b7a5e3..961bc31 100644
--- a/Source/core/html/shadow/PickerIndicatorElement.h
+++ b/Source/core/html/shadow/PickerIndicatorElement.h
@@ -45,7 +45,7 @@
 public:
     // PickerIndicatorOwner implementer must call removePickerIndicatorOwner when
     // it doesn't handle event, e.g. at destruction.
-    class PickerIndicatorOwner {
+    class PickerIndicatorOwner : public WillBeGarbageCollectedMixin {
     public:
         virtual ~PickerIndicatorOwner() { }
         virtual bool isPickerIndicatorOwnerDisabledOrReadOnly() const = 0;
@@ -55,12 +55,14 @@
         virtual bool setupDateTimeChooserParameters(DateTimeChooserParameters&) = 0;
     };
 
-    static PassRefPtr<PickerIndicatorElement> create(Document&, PickerIndicatorOwner&);
+    static PassRefPtrWillBeRawPtr<PickerIndicatorElement> create(Document&, PickerIndicatorOwner&);
     virtual ~PickerIndicatorElement();
+    virtual void trace(Visitor*) OVERRIDE;
+
     void openPopup();
     void closePopup();
     virtual bool willRespondToMouseClickEvents() OVERRIDE;
-    void removePickerIndicatorOwner() { m_pickerIndicatorOwner = 0; }
+    void removePickerIndicatorOwner() { m_pickerIndicatorOwner = nullptr; }
 
     // DateTimeChooserClient implementation.
     virtual void didChooseValue(const String&) OVERRIDE;
@@ -76,7 +78,7 @@
 
     HTMLInputElement* hostInput();
 
-    PickerIndicatorOwner* m_pickerIndicatorOwner;
+    RawPtrWillBeMember<PickerIndicatorOwner> m_pickerIndicatorOwner;
     RefPtr<DateTimeChooser> m_chooser;
 };
 
diff --git a/Source/core/html/shadow/SliderThumbElement.cpp b/Source/core/html/shadow/SliderThumbElement.cpp
index c968156..5f260df 100644
--- a/Source/core/html/shadow/SliderThumbElement.cpp
+++ b/Source/core/html/shadow/SliderThumbElement.cpp
@@ -205,9 +205,9 @@
 {
 }
 
-PassRefPtr<SliderThumbElement> SliderThumbElement::create(Document& document)
+PassRefPtrWillBeRawPtr<SliderThumbElement> SliderThumbElement::create(Document& document)
 {
-    RefPtr<SliderThumbElement> element = adoptRef(new SliderThumbElement(document));
+    RefPtrWillBeRawPtr<SliderThumbElement> element = adoptRefWillBeRefCountedGarbageCollected(new SliderThumbElement(document));
     element->setAttribute(idAttr, ShadowElementNames::sliderThumb());
     return element.release();
 }
@@ -444,9 +444,9 @@
 {
 }
 
-PassRefPtr<SliderContainerElement> SliderContainerElement::create(Document& document)
+PassRefPtrWillBeRawPtr<SliderContainerElement> SliderContainerElement::create(Document& document)
 {
-    return adoptRef(new SliderContainerElement(document));
+    return adoptRefWillBeRefCountedGarbageCollected(new SliderContainerElement(document));
 }
 
 RenderObject* SliderContainerElement::createRenderer(RenderStyle*)
diff --git a/Source/core/html/shadow/SliderThumbElement.h b/Source/core/html/shadow/SliderThumbElement.h
index 255d58a..ce5d536 100644
--- a/Source/core/html/shadow/SliderThumbElement.h
+++ b/Source/core/html/shadow/SliderThumbElement.h
@@ -46,7 +46,7 @@
 
 class SliderThumbElement FINAL : public HTMLDivElement {
 public:
-    static PassRefPtr<SliderThumbElement> create(Document&);
+    static PassRefPtrWillBeRawPtr<SliderThumbElement> create(Document&);
 
     void setPositionFromValue();
 
@@ -96,7 +96,7 @@
 
 class SliderContainerElement FINAL : public HTMLDivElement {
 public:
-    static PassRefPtr<SliderContainerElement> create(Document&);
+    static PassRefPtrWillBeRawPtr<SliderContainerElement> create(Document&);
 
 private:
     SliderContainerElement(Document&);
diff --git a/Source/core/html/shadow/SpinButtonElement.cpp b/Source/core/html/shadow/SpinButtonElement.cpp
index 21bea8b..8031b02 100644
--- a/Source/core/html/shadow/SpinButtonElement.cpp
+++ b/Source/core/html/shadow/SpinButtonElement.cpp
@@ -257,4 +257,10 @@
     return !m_spinButtonOwner || m_spinButtonOwner->shouldSpinButtonRespondToMouseEvents();
 }
 
+void SpinButtonElement::trace(Visitor* visitor)
+{
+    visitor->trace(m_spinButtonOwner);
+    HTMLDivElement::trace(visitor);
+}
+
 }
diff --git a/Source/core/html/shadow/SpinButtonElement.h b/Source/core/html/shadow/SpinButtonElement.h
index 231b220..d29fdbe 100644
--- a/Source/core/html/shadow/SpinButtonElement.h
+++ b/Source/core/html/shadow/SpinButtonElement.h
@@ -44,7 +44,7 @@
         EventDispatchAllowed,
         EventDispatchDisallowed,
     };
-    class SpinButtonOwner {
+    class SpinButtonOwner : public WillBeGarbageCollectedMixin {
     public:
         virtual ~SpinButtonOwner() { }
         virtual void focusAndSelectSpinButtonOwner() = 0;
@@ -61,7 +61,7 @@
     static PassRefPtr<SpinButtonElement> create(Document&, SpinButtonOwner&);
     UpDownState upDownState() const { return m_upDownState; }
     void releaseCapture(EventDispatch = EventDispatchAllowed);
-    void removeSpinButtonOwner() { m_spinButtonOwner = 0; }
+    void removeSpinButtonOwner() { m_spinButtonOwner = nullptr; }
 
     void step(int amount);
 
@@ -70,6 +70,8 @@
 
     void forwardEvent(Event*);
 
+    virtual void trace(Visitor*) OVERRIDE;
+
 private:
     SpinButtonElement(Document&, SpinButtonOwner&);
 
@@ -88,7 +90,7 @@
     bool shouldRespondToMouseEvents();
     virtual bool isMouseFocusable() const OVERRIDE { return false; }
 
-    SpinButtonOwner* m_spinButtonOwner;
+    RawPtrWillBeMember<SpinButtonOwner> m_spinButtonOwner;
     bool m_capturing;
     UpDownState m_upDownState;
     UpDownState m_pressStartingState;
diff --git a/Source/core/html/shadow/TextControlInnerElements.cpp b/Source/core/html/shadow/TextControlInnerElements.cpp
index f03e3ec..f05ed02 100644
--- a/Source/core/html/shadow/TextControlInnerElements.cpp
+++ b/Source/core/html/shadow/TextControlInnerElements.cpp
@@ -39,8 +39,6 @@
 #include "core/page/EventHandler.h"
 #include "core/rendering/RenderTextControlSingleLine.h"
 #include "core/rendering/RenderView.h"
-#include "core/speech/SpeechInput.h"
-#include "core/speech/SpeechInputEvent.h"
 #include "platform/UserGestureIndicator.h"
 
 namespace WebCore {
@@ -52,9 +50,9 @@
 {
 }
 
-PassRefPtr<TextControlInnerContainer> TextControlInnerContainer::create(Document& document)
+PassRefPtrWillBeRawPtr<TextControlInnerContainer> TextControlInnerContainer::create(Document& document)
 {
-    RefPtr<TextControlInnerContainer> element = adoptRef(new TextControlInnerContainer(document));
+    RefPtrWillBeRawPtr<TextControlInnerContainer> element = adoptRefWillBeRefCountedGarbageCollected(new TextControlInnerContainer(document));
     element->setAttribute(idAttr, ShadowElementNames::textFieldContainer());
     return element.release();
 }
@@ -72,9 +70,9 @@
     setHasCustomStyleCallbacks();
 }
 
-PassRefPtr<EditingViewPortElement> EditingViewPortElement::create(Document& document)
+PassRefPtrWillBeRawPtr<EditingViewPortElement> EditingViewPortElement::create(Document& document)
 {
-    RefPtr<EditingViewPortElement> element = adoptRef(new EditingViewPortElement(document));
+    RefPtrWillBeRawPtr<EditingViewPortElement> element = adoptRefWillBeRefCountedGarbageCollected(new EditingViewPortElement(document));
     element->setAttribute(idAttr, ShadowElementNames::editingViewPort());
     return element.release();
 }
@@ -106,9 +104,9 @@
     setHasCustomStyleCallbacks();
 }
 
-PassRefPtr<TextControlInnerTextElement> TextControlInnerTextElement::create(Document& document)
+PassRefPtrWillBeRawPtr<TextControlInnerTextElement> TextControlInnerTextElement::create(Document& document)
 {
-    RefPtr<TextControlInnerTextElement> element = adoptRef(new TextControlInnerTextElement(document));
+    RefPtrWillBeRawPtr<TextControlInnerTextElement> element = adoptRefWillBeRefCountedGarbageCollected(new TextControlInnerTextElement(document));
     element->setAttribute(idAttr, ShadowElementNames::innerEditor());
     return element.release();
 }
@@ -153,9 +151,9 @@
 {
 }
 
-PassRefPtr<SearchFieldDecorationElement> SearchFieldDecorationElement::create(Document& document)
+PassRefPtrWillBeRawPtr<SearchFieldDecorationElement> SearchFieldDecorationElement::create(Document& document)
 {
-    RefPtr<SearchFieldDecorationElement> element = adoptRef(new SearchFieldDecorationElement(document));
+    RefPtrWillBeRawPtr<SearchFieldDecorationElement> element = adoptRefWillBeRefCountedGarbageCollected(new SearchFieldDecorationElement(document));
     element->setAttribute(idAttr, ShadowElementNames::searchDecoration());
     return element.release();
 }
@@ -202,9 +200,9 @@
 {
 }
 
-PassRefPtr<SearchFieldCancelButtonElement> SearchFieldCancelButtonElement::create(Document& document)
+PassRefPtrWillBeRawPtr<SearchFieldCancelButtonElement> SearchFieldCancelButtonElement::create(Document& document)
 {
-    RefPtr<SearchFieldCancelButtonElement> element = adoptRef(new SearchFieldCancelButtonElement(document));
+    RefPtrWillBeRawPtr<SearchFieldCancelButtonElement> element = adoptRefWillBeRefCountedGarbageCollected(new SearchFieldCancelButtonElement(document));
     element->setShadowPseudoId(AtomicString("-webkit-search-cancel-button", AtomicString::ConstructFromLiteral));
     element->setAttribute(idAttr, ShadowElementNames::clearButton());
     return element.release();
@@ -250,212 +248,4 @@
     return HTMLDivElement::willRespondToMouseClickEvents();
 }
 
-// ----------------------------
-
-#if ENABLE(INPUT_SPEECH)
-
-inline InputFieldSpeechButtonElement::InputFieldSpeechButtonElement(Document& document)
-    : HTMLDivElement(document)
-    , m_capturing(false)
-    , m_state(Idle)
-    , m_listenerId(0)
-{
-}
-
-InputFieldSpeechButtonElement::~InputFieldSpeechButtonElement()
-{
-#if !ENABLE(OILPAN)
-    // With Oilpan, this cleanup is handled with weak processing of the
-    // SpeechInputs.
-    SpeechInput* speech = speechInput();
-    if (speech && m_listenerId)  { // Could be null when page is unloading.
-        if (m_state != Idle)
-            speech->cancelRecognition(m_listenerId);
-        speech->unregisterListener(m_listenerId);
-    }
-#endif
-}
-
-PassRefPtr<InputFieldSpeechButtonElement> InputFieldSpeechButtonElement::create(Document& document)
-{
-    RefPtr<InputFieldSpeechButtonElement> element = adoptRef(new InputFieldSpeechButtonElement(document));
-    element->setShadowPseudoId(AtomicString("-webkit-input-speech-button", AtomicString::ConstructFromLiteral));
-    element->setAttribute(idAttr, ShadowElementNames::speechButton());
-    return element.release();
-}
-
-void InputFieldSpeechButtonElement::defaultEventHandler(Event* event)
-{
-    // For privacy reasons, only allow clicks directly coming from the user.
-    if (!UserGestureIndicator::processingUserGesture()) {
-        HTMLDivElement::defaultEventHandler(event);
-        return;
-    }
-
-    // The call to focus() below dispatches a focus event, and an event handler in the page might
-    // remove the input element from DOM. To make sure it remains valid until we finish our work
-    // here, we take a temporary reference.
-    RefPtr<HTMLInputElement> input(toHTMLInputElement(shadowHost()));
-
-    if (!input || input->isDisabledOrReadOnly()) {
-        if (!event->defaultHandled())
-            HTMLDivElement::defaultEventHandler(event);
-        return;
-    }
-
-    // On mouse down, select the text and set focus.
-    if (event->type() == EventTypeNames::mousedown && event->isMouseEvent() && toMouseEvent(event)->button() == LeftButton) {
-        if (renderer() && renderer()->visibleToHitTesting()) {
-            if (LocalFrame* frame = document().frame()) {
-                frame->eventHandler().setCapturingMouseEventsNode(this);
-                m_capturing = true;
-            }
-        }
-        RefPtr<InputFieldSpeechButtonElement> holdRefButton(this);
-        input->focus();
-        input->select();
-        event->setDefaultHandled();
-    }
-    // On mouse up, release capture cleanly.
-    if (event->type() == EventTypeNames::mouseup && event->isMouseEvent() && toMouseEvent(event)->button() == LeftButton) {
-        if (m_capturing && renderer() && renderer()->visibleToHitTesting()) {
-            if (LocalFrame* frame = document().frame()) {
-                frame->eventHandler().setCapturingMouseEventsNode(nullptr);
-                m_capturing = false;
-            }
-        }
-    }
-
-    if (event->type() == EventTypeNames::click && m_listenerId) {
-        switch (m_state) {
-        case Idle:
-            startSpeechInput();
-            break;
-        case Recording:
-            stopSpeechInput();
-            break;
-        case Recognizing:
-            // Nothing to do here, we will continue to wait for results.
-            break;
-        }
-        event->setDefaultHandled();
-    }
-
-    if (!event->defaultHandled())
-        HTMLDivElement::defaultEventHandler(event);
-}
-
-bool InputFieldSpeechButtonElement::willRespondToMouseClickEvents()
-{
-    const HTMLInputElement* input = toHTMLInputElement(shadowHost());
-    if (input && !input->isDisabledOrReadOnly())
-        return true;
-
-    return HTMLDivElement::willRespondToMouseClickEvents();
-}
-
-void InputFieldSpeechButtonElement::setState(SpeechInputState state)
-{
-    if (m_state != state) {
-        m_state = state;
-        shadowHost()->renderer()->repaint();
-    }
-}
-
-SpeechInput* InputFieldSpeechButtonElement::speechInput()
-{
-    return SpeechInput::from(document().page());
-}
-
-void InputFieldSpeechButtonElement::didCompleteRecording(int)
-{
-    setState(Recognizing);
-}
-
-void InputFieldSpeechButtonElement::didCompleteRecognition(int)
-{
-    setState(Idle);
-}
-
-void InputFieldSpeechButtonElement::setRecognitionResult(int, const SpeechInputResultArray& results)
-{
-    m_results = results;
-
-    // The call to setValue() below dispatches an event, and an event handler in the page might
-    // remove the input element from DOM. To make sure it remains valid until we finish our work
-    // here, we take a temporary reference.
-    RefPtr<HTMLInputElement> input(toHTMLInputElement(shadowHost()));
-    if (!input || input->isDisabledOrReadOnly())
-        return;
-
-    RefPtr<InputFieldSpeechButtonElement> holdRefButton(this);
-    if (document().domWindow()) {
-        // Call selectionChanged, causing the element to cache the selection,
-        // so that the text event inserts the text in this element even if
-        // focus has moved away from it.
-        input->selectionChanged(false);
-        input->dispatchEvent(TextEvent::create(document().domWindow(), results.isEmpty() ? "" : results[0]->utterance(), TextEventInputOther));
-    }
-
-    // This event is sent after the text event so the website can perform actions using the input field content immediately.
-    // It provides alternative recognition hypotheses and notifies that the results come from speech input.
-    input->dispatchEvent(SpeechInputEvent::create(EventTypeNames::webkitspeechchange, results));
-
-    // Check before accessing the renderer as the above event could have potentially turned off
-    // speech in the input element, hence removing this button and renderer from the hierarchy.
-    if (renderer())
-        renderer()->repaint();
-}
-
-void InputFieldSpeechButtonElement::attach(const AttachContext& context)
-{
-    ASSERT(!m_listenerId);
-    if (SpeechInput* input = SpeechInput::from(document().page()))
-        m_listenerId = input->registerListener(this);
-    HTMLDivElement::attach(context);
-}
-
-void InputFieldSpeechButtonElement::detach(const AttachContext& context)
-{
-    if (m_capturing) {
-        if (LocalFrame* frame = document().frame())
-            frame->eventHandler().setCapturingMouseEventsNode(nullptr);
-    }
-
-    if (m_listenerId) {
-        if (m_state != Idle)
-            speechInput()->cancelRecognition(m_listenerId);
-        speechInput()->unregisterListener(m_listenerId);
-        m_listenerId = 0;
-    }
-
-    HTMLDivElement::detach(context);
-}
-
-void InputFieldSpeechButtonElement::startSpeechInput()
-{
-    if (m_state != Idle)
-        return;
-
-    RefPtr<HTMLInputElement> input = toHTMLInputElement(shadowHost());
-    AtomicString language = input->computeInheritedLanguage();
-    String grammar = input->getAttribute(webkitgrammarAttr);
-    IntRect rect = document().view()->contentsToRootView(pixelSnappedBoundingBox());
-    if (speechInput()->startRecognition(m_listenerId, rect, language, grammar, document().securityOrigin()))
-        setState(Recording);
-}
-
-void InputFieldSpeechButtonElement::stopSpeechInput()
-{
-    if (m_state == Recording)
-        speechInput()->stopRecording(m_listenerId);
-}
-
-void InputFieldSpeechButtonElement::trace(Visitor* visitor)
-{
-    visitor->trace(m_results);
-    HTMLDivElement::trace(visitor);
-}
-#endif // ENABLE(INPUT_SPEECH)
-
 }
diff --git a/Source/core/html/shadow/TextControlInnerElements.h b/Source/core/html/shadow/TextControlInnerElements.h
index 534c449..d9a9de9 100644
--- a/Source/core/html/shadow/TextControlInnerElements.h
+++ b/Source/core/html/shadow/TextControlInnerElements.h
@@ -28,27 +28,25 @@
 #define TextControlInnerElements_h
 
 #include "core/html/HTMLDivElement.h"
-#include "core/speech/SpeechInputListener.h"
 #include "wtf/Forward.h"
 
 namespace WebCore {
 
-class SpeechInput;
-
 class TextControlInnerContainer FINAL : public HTMLDivElement {
 public:
-    static PassRefPtr<TextControlInnerContainer> create(Document&);
+    static PassRefPtrWillBeRawPtr<TextControlInnerContainer> create(Document&);
+
 protected:
-    TextControlInnerContainer(Document&);
+    explicit TextControlInnerContainer(Document&);
     virtual RenderObject* createRenderer(RenderStyle*) OVERRIDE;
 };
 
 class EditingViewPortElement FINAL : public HTMLDivElement {
 public:
-    static PassRefPtr<EditingViewPortElement> create(Document&);
+    static PassRefPtrWillBeRawPtr<EditingViewPortElement> create(Document&);
 
 protected:
-    EditingViewPortElement(Document&);
+    explicit EditingViewPortElement(Document&);
     virtual PassRefPtr<RenderStyle> customStyleForRenderer() OVERRIDE;
 
 private:
@@ -57,12 +55,12 @@
 
 class TextControlInnerTextElement FINAL : public HTMLDivElement {
 public:
-    static PassRefPtr<TextControlInnerTextElement> create(Document&);
+    static PassRefPtrWillBeRawPtr<TextControlInnerTextElement> create(Document&);
 
     virtual void defaultEventHandler(Event*) OVERRIDE;
 
 private:
-    TextControlInnerTextElement(Document&);
+    explicit TextControlInnerTextElement(Document&);
     virtual RenderObject* createRenderer(RenderStyle*) OVERRIDE;
     virtual PassRefPtr<RenderStyle> customStyleForRenderer() OVERRIDE;
     virtual bool supportsFocus() const OVERRIDE { return false; }
@@ -70,80 +68,32 @@
 
 class SearchFieldDecorationElement FINAL : public HTMLDivElement {
 public:
-    static PassRefPtr<SearchFieldDecorationElement> create(Document&);
+    static PassRefPtrWillBeRawPtr<SearchFieldDecorationElement> create(Document&);
 
     virtual void defaultEventHandler(Event*) OVERRIDE;
     virtual bool willRespondToMouseClickEvents() OVERRIDE;
 
 private:
-    SearchFieldDecorationElement(Document&);
+    explicit SearchFieldDecorationElement(Document&);
     virtual const AtomicString& shadowPseudoId() const OVERRIDE;
     virtual bool supportsFocus() const OVERRIDE { return false; }
 };
 
 class SearchFieldCancelButtonElement FINAL : public HTMLDivElement {
 public:
-    static PassRefPtr<SearchFieldCancelButtonElement> create(Document&);
+    static PassRefPtrWillBeRawPtr<SearchFieldCancelButtonElement> create(Document&);
 
     virtual void defaultEventHandler(Event*) OVERRIDE;
     virtual bool willRespondToMouseClickEvents() OVERRIDE;
 
 private:
-    SearchFieldCancelButtonElement(Document&);
+    explicit SearchFieldCancelButtonElement(Document&);
     virtual void detach(const AttachContext& = AttachContext()) OVERRIDE;
     virtual bool supportsFocus() const OVERRIDE { return false; }
 
     bool m_capturing;
 };
 
-#if ENABLE(INPUT_SPEECH)
-
-class InputFieldSpeechButtonElement FINAL
-    : public HTMLDivElement,
-      public SpeechInputListener {
-    WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(InputFieldSpeechButtonElement);
-public:
-    enum SpeechInputState {
-        Idle,
-        Recording,
-        Recognizing,
-    };
-
-    static PassRefPtr<InputFieldSpeechButtonElement> create(Document&);
-    virtual ~InputFieldSpeechButtonElement();
-
-    virtual void detach(const AttachContext& = AttachContext()) OVERRIDE;
-    virtual void defaultEventHandler(Event*) OVERRIDE;
-    virtual bool willRespondToMouseClickEvents() OVERRIDE;
-    virtual bool isInputFieldSpeechButtonElement() const OVERRIDE { return true; }
-    SpeechInputState state() const { return m_state; }
-    void startSpeechInput();
-    void stopSpeechInput();
-
-    // SpeechInputListener methods.
-    virtual void didCompleteRecording(int) OVERRIDE;
-    virtual void didCompleteRecognition(int) OVERRIDE;
-    virtual void setRecognitionResult(int, const SpeechInputResultArray&) OVERRIDE;
-
-    virtual void trace(Visitor*) OVERRIDE;
-
-private:
-    InputFieldSpeechButtonElement(Document&);
-    SpeechInput* speechInput();
-    void setState(SpeechInputState state);
-    virtual bool isMouseFocusable() const OVERRIDE { return false; }
-    virtual void attach(const AttachContext& = AttachContext()) OVERRIDE;
-
-    bool m_capturing;
-    SpeechInputState m_state;
-    int m_listenerId;
-    SpeechInputResultArray m_results;
-};
-
-DEFINE_TYPE_CASTS(InputFieldSpeechButtonElement, Element, element, element->isInputFieldSpeechButtonElement(), element.isInputFieldSpeechButtonElement());
-
-#endif // ENABLE(INPUT_SPEECH)
-
 } // namespace
 
 #endif
diff --git a/Source/core/html/track/TextTrackCue.cpp b/Source/core/html/track/TextTrackCue.cpp
index 483fb38..cc0ea31 100644
--- a/Source/core/html/track/TextTrackCue.cpp
+++ b/Source/core/html/track/TextTrackCue.cpp
@@ -42,15 +42,6 @@
 
 static const int invalidCueIndex = -1;
 
-bool TextTrackCue::isInfiniteOrNonNumber(double value, ExceptionState& exceptionState)
-{
-    if (!std::isfinite(value)) {
-        exceptionState.throwTypeError(ExceptionMessages::notAFiniteNumber(value));
-        return true;
-    }
-    return false;
-}
-
 TextTrackCue::TextTrackCue(double start, double end)
     : m_startTime(start)
     , m_endTime(end)
@@ -98,12 +89,8 @@
     cueDidChange();
 }
 
-void TextTrackCue::setStartTime(double value, ExceptionState& exceptionState)
+void TextTrackCue::setStartTime(double value)
 {
-    // NaN, Infinity and -Infinity values should trigger a TypeError.
-    if (isInfiniteOrNonNumber(value, exceptionState))
-        return;
-
     // TODO(93143): Add spec-compliant behavior for negative time values.
     if (m_startTime == value || value < 0)
         return;
@@ -113,12 +100,8 @@
     cueDidChange();
 }
 
-void TextTrackCue::setEndTime(double value, ExceptionState& exceptionState)
+void TextTrackCue::setEndTime(double value)
 {
-    // NaN, Infinity and -Infinity values should trigger a TypeError.
-    if (isInfiniteOrNonNumber(value, exceptionState))
-        return;
-
     // TODO(93143): Add spec-compliant behavior for negative time values.
     if (m_endTime == value || value < 0)
         return;
diff --git a/Source/core/html/track/TextTrackCue.h b/Source/core/html/track/TextTrackCue.h
index 2f9524b..d90ec88 100644
--- a/Source/core/html/track/TextTrackCue.h
+++ b/Source/core/html/track/TextTrackCue.h
@@ -44,8 +44,6 @@
 class TextTrackCue : public RefCountedWillBeRefCountedGarbageCollected<TextTrackCue>, public EventTargetWithInlineData {
     DEFINE_EVENT_TARGET_REFCOUNTING(RefCountedWillBeRefCountedGarbageCollected<TextTrackCue>);
 public:
-    static bool isInfiniteOrNonNumber(double value, ExceptionState&);
-
     static const AtomicString& cueShadowPseudoId()
     {
         DEFINE_STATIC_LOCAL(const AtomicString, cue, ("cue", AtomicString::ConstructFromLiteral));
@@ -63,10 +61,10 @@
     void setId(const AtomicString&);
 
     double startTime() const { return m_startTime; }
-    void setStartTime(double, ExceptionState&);
+    void setStartTime(double);
 
     double endTime() const { return m_endTime; }
-    void setEndTime(double, ExceptionState&);
+    void setEndTime(double);
 
     bool pauseOnExit() const { return m_pauseOnExit; }
     void setPauseOnExit(bool);
diff --git a/Source/core/html/track/TextTrackCue.idl b/Source/core/html/track/TextTrackCue.idl
index b44e611..d243c43 100644
--- a/Source/core/html/track/TextTrackCue.idl
+++ b/Source/core/html/track/TextTrackCue.idl
@@ -23,18 +23,21 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+// http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#texttrackcue
+
 [
     Custom=ToV8,
     SetWrapperReferenceFrom=owner,
+    TypeChecking=Unrestricted,
     WillBeGarbageCollected,
 ] interface TextTrackCue : EventTarget {
-    readonly attribute TextTrack track;
+    readonly attribute TextTrack track; // FIXME: should be nullable
 
-    attribute DOMString id;
-    [RaisesException=Setter] attribute double startTime;
-    [RaisesException=Setter] attribute double endTime;
-    attribute boolean pauseOnExit;
+             attribute DOMString id;
+             attribute double startTime;
+             attribute double endTime;
+             attribute boolean pauseOnExit;
 
-    attribute EventHandler onenter;
-    attribute EventHandler onexit;
+             attribute EventHandler onenter;
+             attribute EventHandler onexit;
 };
diff --git a/Source/core/html/track/vtt/VTTCue.cpp b/Source/core/html/track/vtt/VTTCue.cpp
index 8c515ec..83eb98e 100644
--- a/Source/core/html/track/vtt/VTTCue.cpp
+++ b/Source/core/html/track/vtt/VTTCue.cpp
@@ -38,6 +38,7 @@
 #include "core/dom/DocumentFragment.h"
 #include "core/dom/NodeTraversal.h"
 #include "core/events/Event.h"
+#include "core/frame/UseCounter.h"
 #include "core/html/HTMLDivElement.h"
 #include "core/html/track/TextTrack.h"
 #include "core/html/track/TextTrackCueList.h"
@@ -115,12 +116,10 @@
     return verticallr;
 }
 
-static bool isInvalidPercentage(double value, ExceptionState& exceptionState)
+static bool isInvalidPercentage(int value, ExceptionState& exceptionState)
 {
-    if (TextTrackCue::isInfiniteOrNonNumber(value, exceptionState))
-        return true;
     if (value < 0 || value > 100) {
-        exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::indexOutsideRange("value", value, 0.0, ExceptionMessages::InclusiveBound, 100.0, ExceptionMessages::InclusiveBound));
+        exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::indexOutsideRange("value", value, 0, ExceptionMessages::InclusiveBound, 100, ExceptionMessages::InclusiveBound));
         return true;
     }
     return false;
@@ -201,6 +200,12 @@
     return new RenderVTTCue(this);
 }
 
+void VTTCueBox::trace(Visitor* visitor)
+{
+    visitor->trace(m_cue);
+    HTMLDivElement::trace(visitor);
+}
+
 VTTCue::VTTCue(Document& document, double startTime, double endTime, const String& text)
     : TextTrackCue(startTime, endTime)
     , m_text(text)
@@ -219,14 +224,20 @@
     , m_notifyRegion(true)
 {
     ScriptWrappable::init(this);
+    UseCounter::count(document, UseCounter::VTTCue);
 }
 
 VTTCue::~VTTCue()
 {
+    // Using oilpan, if m_displayTree is in the document it will strongly keep
+    // the cue alive. Thus, if the cue is dead, either m_displayTree is not in
+    // the document or the entire document is dead too.
+#if !ENABLE(OILPAN)
     // FIXME: This is scary, we should make the life cycle smarter so the destructor
     // doesn't need to do DOM mutations.
     if (m_displayTree)
         m_displayTree->remove(ASSERT_NO_EXCEPTION);
+#endif
 }
 
 #ifndef NDEBUG
@@ -703,11 +714,11 @@
     m_cueBackgroundBox->appendChild(referenceTree, ASSERT_NO_EXCEPTION);
 }
 
-PassRefPtr<VTTCueBox> VTTCue::getDisplayTree(const IntSize& videoSize)
+PassRefPtrWillBeRawPtr<VTTCueBox> VTTCue::getDisplayTree(const IntSize& videoSize)
 {
-    RefPtr<VTTCueBox> displayTree(ensureDisplayTree());
+    RefPtrWillBeRawPtr<VTTCueBox> displayTree(ensureDisplayTree());
     if (!m_displayTreeShouldChange || !track()->isRendered())
-        return displayTree;
+        return displayTree.release();
 
     // 10.1 - 10.10
     calculateDisplayParameters();
@@ -744,7 +755,7 @@
 
     // 10.15. Let cue's text track cue display state have the CSS boxes in
     // boxes.
-    return displayTree;
+    return displayTree.release();
 }
 
 void VTTCue::removeDisplayTree()
@@ -762,7 +773,27 @@
 
 void VTTCue::updateDisplay(const IntSize& videoSize, HTMLDivElement& container)
 {
-    RefPtr<VTTCueBox> displayBox = getDisplayTree(videoSize);
+    UseCounter::count(document(), UseCounter::VTTCueRender);
+
+    if (m_writingDirection != Horizontal)
+        UseCounter::count(document(), UseCounter::VTTCueRenderVertical);
+
+    if (!m_snapToLines)
+        UseCounter::count(document(), UseCounter::VTTCueRenderSnapToLinesFalse);
+
+    if (m_linePosition != undefinedPosition)
+        UseCounter::count(document(), UseCounter::VTTCueRenderLineNotAuto);
+
+    if (m_textPosition != 50)
+        UseCounter::count(document(), UseCounter::VTTCueRenderPositionNot50);
+
+    if (m_cueSize != 100)
+        UseCounter::count(document(), UseCounter::VTTCueRenderSizeNot100);
+
+    if (m_cueAlignment != Middle)
+        UseCounter::count(document(), UseCounter::VTTCueRenderAlignNotMiddle);
+
+    RefPtrWillBeRawPtr<VTTCueBox> displayBox = getDisplayTree(videoSize);
     VTTRegion* region = 0;
     if (track()->regions())
         region = track()->regions()->getRegionById(regionId());
@@ -1065,6 +1096,9 @@
 
 void VTTCue::trace(Visitor* visitor)
 {
+    visitor->trace(m_vttNodeTree);
+    visitor->trace(m_cueBackgroundBox);
+    visitor->trace(m_displayTree);
     TextTrackCue::trace(visitor);
 }
 
diff --git a/Source/core/html/track/vtt/VTTCue.h b/Source/core/html/track/vtt/VTTCue.h
index f9a05ea..0c870c8 100644
--- a/Source/core/html/track/vtt/VTTCue.h
+++ b/Source/core/html/track/vtt/VTTCue.h
@@ -43,23 +43,22 @@
 
 class VTTCueBox FINAL : public HTMLDivElement {
 public:
-    static PassRefPtr<VTTCueBox> create(Document& document, VTTCue* cue)
+    static PassRefPtrWillBeRawPtr<VTTCueBox> create(Document& document, VTTCue* cue)
     {
-        return adoptRef(new VTTCueBox(document, cue));
+        return adoptRefWillBeRefCountedGarbageCollected(new VTTCueBox(document, cue));
     }
 
     VTTCue* getCue() const { return m_cue; }
     void applyCSSProperties(const IntSize& videoSize);
 
+    virtual void trace(Visitor*) OVERRIDE;
+
 private:
     VTTCueBox(Document&, VTTCue*);
 
     virtual RenderObject* createRenderer(RenderStyle*) OVERRIDE;
 
-    // FIXME: Oilpan: once Node has been moved onto the heap fully,
-    // drop the raw pointer for a Member (and vice versa from
-    // VTTCue.)
-    VTTCue* m_cue;
+    RawPtrWillBeMember<VTTCue> m_cue;
 };
 
 class VTTCue FINAL : public TextTrackCue, public ScriptWrappable {
@@ -149,7 +148,7 @@
     Document& document() const;
 
     VTTCueBox& ensureDisplayTree();
-    PassRefPtr<VTTCueBox> getDisplayTree(const IntSize& videoSize);
+    PassRefPtrWillBeRawPtr<VTTCueBox> getDisplayTree(const IntSize& videoSize);
 
     virtual void cueDidChange() OVERRIDE;
 
@@ -180,9 +179,9 @@
     CueAlignment m_cueAlignment;
     String m_regionId;
 
-    RefPtr<DocumentFragment> m_vttNodeTree;
-    RefPtr<HTMLDivElement> m_cueBackgroundBox;
-    RefPtr<VTTCueBox> m_displayTree;
+    RefPtrWillBeMember<DocumentFragment> m_vttNodeTree;
+    RefPtrWillBeMember<HTMLDivElement> m_cueBackgroundBox;
+    RefPtrWillBeMember<VTTCueBox> m_displayTree;
 
     CSSValueID m_displayDirection;
     int m_displaySize;
diff --git a/Source/core/html/track/vtt/VTTElement.cpp b/Source/core/html/track/vtt/VTTElement.cpp
index e9b350a..d192deb 100644
--- a/Source/core/html/track/vtt/VTTElement.cpp
+++ b/Source/core/html/track/vtt/VTTElement.cpp
@@ -71,16 +71,16 @@
 {
 }
 
-PassRefPtr<VTTElement> VTTElement::create(VTTNodeType nodeType, Document* document)
+PassRefPtrWillBeRawPtr<VTTElement> VTTElement::create(VTTNodeType nodeType, Document* document)
 {
-    return adoptRef(new VTTElement(nodeType, document));
+    return adoptRefWillBeRefCountedGarbageCollected(new VTTElement(nodeType, document));
 }
 
 PassRefPtr<Element> VTTElement::cloneElementWithoutAttributesAndChildren()
 {
-    RefPtr<VTTElement> clone = create(static_cast<VTTNodeType>(m_webVTTNodeType), &document());
+    RefPtrWillBeRawPtr<VTTElement> clone = create(static_cast<VTTNodeType>(m_webVTTNodeType), &document());
     clone->setLanguage(m_language);
-    return clone;
+    return clone.release();
 }
 
 PassRefPtr<HTMLElement> VTTElement::createEquivalentHTMLElement(Document& document)
diff --git a/Source/core/html/track/vtt/VTTElement.h b/Source/core/html/track/vtt/VTTElement.h
index f0181ad..dbf4b4c 100644
--- a/Source/core/html/track/vtt/VTTElement.h
+++ b/Source/core/html/track/vtt/VTTElement.h
@@ -41,8 +41,8 @@
 
 class VTTElement FINAL : public Element {
 public:
-    static PassRefPtr<VTTElement> create(const VTTNodeType, Document*);
-    static PassRefPtr<VTTElement> create(const QualifiedName&, Document*);
+    static PassRefPtrWillBeRawPtr<VTTElement> create(const VTTNodeType, Document*);
+    static PassRefPtrWillBeRawPtr<VTTElement> create(const QualifiedName&, Document*);
     PassRefPtr<HTMLElement> createEquivalentHTMLElement(Document&);
 
     virtual PassRefPtr<Element> cloneElementWithoutAttributesAndChildren() OVERRIDE;
diff --git a/Source/core/html/track/vtt/VTTParser.cpp b/Source/core/html/track/vtt/VTTParser.cpp
index 6415588..c742521 100644
--- a/Source/core/html/track/vtt/VTTParser.cpp
+++ b/Source/core/html/track/vtt/VTTParser.cpp
@@ -503,7 +503,7 @@
         if (nodeType == VTTNodeTypeRubyText && currentType != VTTNodeTypeRuby)
             break;
 
-        RefPtr<VTTElement> child = VTTElement::create(nodeType, &document);
+        RefPtrWillBeRawPtr<VTTElement> child = VTTElement::create(nodeType, &document);
         if (!m_token.classes().isEmpty())
             child->setAttribute(classAttr, m_token.classes());
 
diff --git a/Source/core/html/track/vtt/VTTRegion.cpp b/Source/core/html/track/vtt/VTTRegion.cpp
index c67428a..4db1376 100644
--- a/Source/core/html/track/vtt/VTTRegion.cpp
+++ b/Source/core/html/track/vtt/VTTRegion.cpp
@@ -68,12 +68,8 @@
 // Default scrolling animation time period (s).
 static const float scrollTime = 0.433;
 
-static bool isInfiniteOrNonNumberOrNonPercentage(double value, const char* method, ExceptionState& exceptionState)
+static bool isNonPercentage(double value, const char* method, ExceptionState& exceptionState)
 {
-    if (!std::isfinite(value)) {
-        exceptionState.throwTypeError(ExceptionMessages::notAFiniteNumber(value));
-        return true;
-    }
     if (value < 0 || value > 100) {
         exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::indexOutsideRange("value", value, 0.0, ExceptionMessages::InclusiveBound, 100.0, ExceptionMessages::InclusiveBound));
         return true;
@@ -110,7 +106,7 @@
 
 void VTTRegion::setWidth(double value, ExceptionState& exceptionState)
 {
-    if (isInfiniteOrNonNumberOrNonPercentage(value, "width", exceptionState))
+    if (isNonPercentage(value, "width", exceptionState))
         return;
 
     m_width = value;
@@ -128,7 +124,7 @@
 
 void VTTRegion::setRegionAnchorX(double value, ExceptionState& exceptionState)
 {
-    if (isInfiniteOrNonNumberOrNonPercentage(value, "regionAnchorX", exceptionState))
+    if (isNonPercentage(value, "regionAnchorX", exceptionState))
         return;
 
     m_regionAnchor.setX(value);
@@ -136,7 +132,7 @@
 
 void VTTRegion::setRegionAnchorY(double value, ExceptionState& exceptionState)
 {
-    if (isInfiniteOrNonNumberOrNonPercentage(value, "regionAnchorY", exceptionState))
+    if (isNonPercentage(value, "regionAnchorY", exceptionState))
         return;
 
     m_regionAnchor.setY(value);
@@ -144,7 +140,7 @@
 
 void VTTRegion::setViewportAnchorX(double value, ExceptionState& exceptionState)
 {
-    if (isInfiniteOrNonNumberOrNonPercentage(value, "viewportAnchorX", exceptionState))
+    if (isNonPercentage(value, "viewportAnchorX", exceptionState))
         return;
 
     m_viewportAnchor.setX(value);
@@ -152,7 +148,7 @@
 
 void VTTRegion::setViewportAnchorY(double value, ExceptionState& exceptionState)
 {
-    if (isInfiniteOrNonNumberOrNonPercentage(value, "viewportAnchorY", exceptionState))
+    if (isNonPercentage(value, "viewportAnchorY", exceptionState))
         return;
 
     m_viewportAnchor.setY(value);
@@ -345,7 +341,7 @@
     m_cueContainer->setInlineStyleProperty(CSSPropertyTop, m_currentTop, CSSPrimitiveValue::CSS_PX);
 }
 
-void VTTRegion::appendVTTCueBox(PassRefPtr<VTTCueBox> displayBox)
+void VTTRegion::appendVTTCueBox(PassRefPtrWillBeRawPtr<VTTCueBox> displayBox)
 {
     ASSERT(m_cueContainer);
 
@@ -473,6 +469,8 @@
 
 void VTTRegion::trace(Visitor* visitor)
 {
+    visitor->trace(m_cueContainer);
+    visitor->trace(m_regionDisplayTree);
     visitor->trace(m_track);
 }
 
diff --git a/Source/core/html/track/vtt/VTTRegion.h b/Source/core/html/track/vtt/VTTRegion.h
index 8d1ca86..854e320 100644
--- a/Source/core/html/track/vtt/VTTRegion.h
+++ b/Source/core/html/track/vtt/VTTRegion.h
@@ -91,7 +91,7 @@
 
     PassRefPtr<HTMLDivElement> getDisplayTree(Document&);
 
-    void appendVTTCueBox(PassRefPtr<VTTCueBox>);
+    void appendVTTCueBox(PassRefPtrWillBeRawPtr<VTTCueBox>);
     void displayLastVTTCueBox();
     void willRemoveVTTCueBox(VTTCueBox*);
 
@@ -133,8 +133,8 @@
 
     // The cue container is the container that is scrolled up to obtain the
     // effect of scrolling cues when this is enabled for the regions.
-    RefPtr<HTMLDivElement> m_cueContainer;
-    RefPtr<HTMLDivElement> m_regionDisplayTree;
+    RefPtrWillBeMember<HTMLDivElement> m_cueContainer;
+    RefPtrWillBeMember<HTMLDivElement> m_regionDisplayTree;
 
     // The member variable track can be a raw pointer as it will never
     // reference a destroyed TextTrack, as this member variable
diff --git a/Source/core/html/track/vtt/VTTRegion.idl b/Source/core/html/track/vtt/VTTRegion.idl
index 98f8907..1a28e70 100644
--- a/Source/core/html/track/vtt/VTTRegion.idl
+++ b/Source/core/html/track/vtt/VTTRegion.idl
@@ -26,6 +26,7 @@
 [
     Constructor,
     RuntimeEnabled=WebVTTRegions,
+    TypeChecking=Unrestricted,
     WillBeGarbageCollected,
 ] interface VTTRegion {
     readonly attribute TextTrack track;
@@ -39,4 +40,3 @@
     [RaisesException=Setter] attribute double viewportAnchorY;
     [RaisesException=Setter] attribute DOMString scroll;
 };
-
diff --git a/Source/core/injected_canvas_script_source.target.darwin-arm.mk b/Source/core/injected_canvas_script_source.target.darwin-arm.mk
index 6458eff..ae6eea4 100644
--- a/Source/core/injected_canvas_script_source.target.darwin-arm.mk
+++ b/Source/core/injected_canvas_script_source.target.darwin-arm.mk
@@ -16,6 +16,7 @@
 
 ### Rules for action "ConvertFileToHeaderWithCharacterArray":
 $(gyp_shared_intermediate_dir)/blink/InjectedScriptCanvasModuleSource.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/InjectedScriptCanvasModuleSource.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/InjectedScriptCanvasModuleSource.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InjectedScriptCanvasModuleSource.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InjectedScriptCanvasModuleSource.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/injected_canvas_script_source.target.darwin-arm64.mk b/Source/core/injected_canvas_script_source.target.darwin-arm64.mk
index 6458eff..ae6eea4 100644
--- a/Source/core/injected_canvas_script_source.target.darwin-arm64.mk
+++ b/Source/core/injected_canvas_script_source.target.darwin-arm64.mk
@@ -16,6 +16,7 @@
 
 ### Rules for action "ConvertFileToHeaderWithCharacterArray":
 $(gyp_shared_intermediate_dir)/blink/InjectedScriptCanvasModuleSource.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/InjectedScriptCanvasModuleSource.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/InjectedScriptCanvasModuleSource.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InjectedScriptCanvasModuleSource.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InjectedScriptCanvasModuleSource.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/injected_canvas_script_source.target.darwin-mips.mk b/Source/core/injected_canvas_script_source.target.darwin-mips.mk
index 6458eff..ae6eea4 100644
--- a/Source/core/injected_canvas_script_source.target.darwin-mips.mk
+++ b/Source/core/injected_canvas_script_source.target.darwin-mips.mk
@@ -16,6 +16,7 @@
 
 ### Rules for action "ConvertFileToHeaderWithCharacterArray":
 $(gyp_shared_intermediate_dir)/blink/InjectedScriptCanvasModuleSource.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/InjectedScriptCanvasModuleSource.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/InjectedScriptCanvasModuleSource.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InjectedScriptCanvasModuleSource.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InjectedScriptCanvasModuleSource.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/injected_canvas_script_source.target.darwin-x86.mk b/Source/core/injected_canvas_script_source.target.darwin-x86.mk
index 6458eff..ae6eea4 100644
--- a/Source/core/injected_canvas_script_source.target.darwin-x86.mk
+++ b/Source/core/injected_canvas_script_source.target.darwin-x86.mk
@@ -16,6 +16,7 @@
 
 ### Rules for action "ConvertFileToHeaderWithCharacterArray":
 $(gyp_shared_intermediate_dir)/blink/InjectedScriptCanvasModuleSource.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/InjectedScriptCanvasModuleSource.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/InjectedScriptCanvasModuleSource.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InjectedScriptCanvasModuleSource.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InjectedScriptCanvasModuleSource.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/injected_canvas_script_source.target.darwin-x86_64.mk b/Source/core/injected_canvas_script_source.target.darwin-x86_64.mk
index 6458eff..ae6eea4 100644
--- a/Source/core/injected_canvas_script_source.target.darwin-x86_64.mk
+++ b/Source/core/injected_canvas_script_source.target.darwin-x86_64.mk
@@ -16,6 +16,7 @@
 
 ### Rules for action "ConvertFileToHeaderWithCharacterArray":
 $(gyp_shared_intermediate_dir)/blink/InjectedScriptCanvasModuleSource.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/InjectedScriptCanvasModuleSource.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/InjectedScriptCanvasModuleSource.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InjectedScriptCanvasModuleSource.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InjectedScriptCanvasModuleSource.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/injected_canvas_script_source.target.linux-arm.mk b/Source/core/injected_canvas_script_source.target.linux-arm.mk
index 6458eff..ae6eea4 100644
--- a/Source/core/injected_canvas_script_source.target.linux-arm.mk
+++ b/Source/core/injected_canvas_script_source.target.linux-arm.mk
@@ -16,6 +16,7 @@
 
 ### Rules for action "ConvertFileToHeaderWithCharacterArray":
 $(gyp_shared_intermediate_dir)/blink/InjectedScriptCanvasModuleSource.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/InjectedScriptCanvasModuleSource.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/InjectedScriptCanvasModuleSource.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InjectedScriptCanvasModuleSource.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InjectedScriptCanvasModuleSource.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/injected_canvas_script_source.target.linux-arm64.mk b/Source/core/injected_canvas_script_source.target.linux-arm64.mk
index 6458eff..ae6eea4 100644
--- a/Source/core/injected_canvas_script_source.target.linux-arm64.mk
+++ b/Source/core/injected_canvas_script_source.target.linux-arm64.mk
@@ -16,6 +16,7 @@
 
 ### Rules for action "ConvertFileToHeaderWithCharacterArray":
 $(gyp_shared_intermediate_dir)/blink/InjectedScriptCanvasModuleSource.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/InjectedScriptCanvasModuleSource.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/InjectedScriptCanvasModuleSource.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InjectedScriptCanvasModuleSource.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InjectedScriptCanvasModuleSource.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/injected_canvas_script_source.target.linux-mips.mk b/Source/core/injected_canvas_script_source.target.linux-mips.mk
index 6458eff..ae6eea4 100644
--- a/Source/core/injected_canvas_script_source.target.linux-mips.mk
+++ b/Source/core/injected_canvas_script_source.target.linux-mips.mk
@@ -16,6 +16,7 @@
 
 ### Rules for action "ConvertFileToHeaderWithCharacterArray":
 $(gyp_shared_intermediate_dir)/blink/InjectedScriptCanvasModuleSource.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/InjectedScriptCanvasModuleSource.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/InjectedScriptCanvasModuleSource.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InjectedScriptCanvasModuleSource.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InjectedScriptCanvasModuleSource.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/injected_canvas_script_source.target.linux-x86.mk b/Source/core/injected_canvas_script_source.target.linux-x86.mk
index 6458eff..ae6eea4 100644
--- a/Source/core/injected_canvas_script_source.target.linux-x86.mk
+++ b/Source/core/injected_canvas_script_source.target.linux-x86.mk
@@ -16,6 +16,7 @@
 
 ### Rules for action "ConvertFileToHeaderWithCharacterArray":
 $(gyp_shared_intermediate_dir)/blink/InjectedScriptCanvasModuleSource.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/InjectedScriptCanvasModuleSource.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/InjectedScriptCanvasModuleSource.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InjectedScriptCanvasModuleSource.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InjectedScriptCanvasModuleSource.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/injected_canvas_script_source.target.linux-x86_64.mk b/Source/core/injected_canvas_script_source.target.linux-x86_64.mk
index 6458eff..ae6eea4 100644
--- a/Source/core/injected_canvas_script_source.target.linux-x86_64.mk
+++ b/Source/core/injected_canvas_script_source.target.linux-x86_64.mk
@@ -16,6 +16,7 @@
 
 ### Rules for action "ConvertFileToHeaderWithCharacterArray":
 $(gyp_shared_intermediate_dir)/blink/InjectedScriptCanvasModuleSource.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/InjectedScriptCanvasModuleSource.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/InjectedScriptCanvasModuleSource.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InjectedScriptCanvasModuleSource.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InjectedScriptCanvasModuleSource.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/injected_script_source.target.darwin-arm.mk b/Source/core/injected_script_source.target.darwin-arm.mk
index c58b08f..f79663f 100644
--- a/Source/core/injected_script_source.target.darwin-arm.mk
+++ b/Source/core/injected_script_source.target.darwin-arm.mk
@@ -16,6 +16,7 @@
 
 ### Rules for action "ConvertFileToHeaderWithCharacterArray":
 $(gyp_shared_intermediate_dir)/blink/InjectedScriptSource.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/InjectedScriptSource.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/InjectedScriptSource.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InjectedScriptSource.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InjectedScriptSource.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/injected_script_source.target.darwin-arm64.mk b/Source/core/injected_script_source.target.darwin-arm64.mk
index c58b08f..f79663f 100644
--- a/Source/core/injected_script_source.target.darwin-arm64.mk
+++ b/Source/core/injected_script_source.target.darwin-arm64.mk
@@ -16,6 +16,7 @@
 
 ### Rules for action "ConvertFileToHeaderWithCharacterArray":
 $(gyp_shared_intermediate_dir)/blink/InjectedScriptSource.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/InjectedScriptSource.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/InjectedScriptSource.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InjectedScriptSource.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InjectedScriptSource.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/injected_script_source.target.darwin-mips.mk b/Source/core/injected_script_source.target.darwin-mips.mk
index c58b08f..f79663f 100644
--- a/Source/core/injected_script_source.target.darwin-mips.mk
+++ b/Source/core/injected_script_source.target.darwin-mips.mk
@@ -16,6 +16,7 @@
 
 ### Rules for action "ConvertFileToHeaderWithCharacterArray":
 $(gyp_shared_intermediate_dir)/blink/InjectedScriptSource.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/InjectedScriptSource.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/InjectedScriptSource.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InjectedScriptSource.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InjectedScriptSource.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/injected_script_source.target.darwin-x86.mk b/Source/core/injected_script_source.target.darwin-x86.mk
index c58b08f..f79663f 100644
--- a/Source/core/injected_script_source.target.darwin-x86.mk
+++ b/Source/core/injected_script_source.target.darwin-x86.mk
@@ -16,6 +16,7 @@
 
 ### Rules for action "ConvertFileToHeaderWithCharacterArray":
 $(gyp_shared_intermediate_dir)/blink/InjectedScriptSource.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/InjectedScriptSource.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/InjectedScriptSource.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InjectedScriptSource.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InjectedScriptSource.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/injected_script_source.target.darwin-x86_64.mk b/Source/core/injected_script_source.target.darwin-x86_64.mk
index c58b08f..f79663f 100644
--- a/Source/core/injected_script_source.target.darwin-x86_64.mk
+++ b/Source/core/injected_script_source.target.darwin-x86_64.mk
@@ -16,6 +16,7 @@
 
 ### Rules for action "ConvertFileToHeaderWithCharacterArray":
 $(gyp_shared_intermediate_dir)/blink/InjectedScriptSource.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/InjectedScriptSource.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/InjectedScriptSource.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InjectedScriptSource.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InjectedScriptSource.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/injected_script_source.target.linux-arm.mk b/Source/core/injected_script_source.target.linux-arm.mk
index c58b08f..f79663f 100644
--- a/Source/core/injected_script_source.target.linux-arm.mk
+++ b/Source/core/injected_script_source.target.linux-arm.mk
@@ -16,6 +16,7 @@
 
 ### Rules for action "ConvertFileToHeaderWithCharacterArray":
 $(gyp_shared_intermediate_dir)/blink/InjectedScriptSource.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/InjectedScriptSource.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/InjectedScriptSource.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InjectedScriptSource.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InjectedScriptSource.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/injected_script_source.target.linux-arm64.mk b/Source/core/injected_script_source.target.linux-arm64.mk
index c58b08f..f79663f 100644
--- a/Source/core/injected_script_source.target.linux-arm64.mk
+++ b/Source/core/injected_script_source.target.linux-arm64.mk
@@ -16,6 +16,7 @@
 
 ### Rules for action "ConvertFileToHeaderWithCharacterArray":
 $(gyp_shared_intermediate_dir)/blink/InjectedScriptSource.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/InjectedScriptSource.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/InjectedScriptSource.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InjectedScriptSource.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InjectedScriptSource.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/injected_script_source.target.linux-mips.mk b/Source/core/injected_script_source.target.linux-mips.mk
index c58b08f..f79663f 100644
--- a/Source/core/injected_script_source.target.linux-mips.mk
+++ b/Source/core/injected_script_source.target.linux-mips.mk
@@ -16,6 +16,7 @@
 
 ### Rules for action "ConvertFileToHeaderWithCharacterArray":
 $(gyp_shared_intermediate_dir)/blink/InjectedScriptSource.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/InjectedScriptSource.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/InjectedScriptSource.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InjectedScriptSource.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InjectedScriptSource.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/injected_script_source.target.linux-x86.mk b/Source/core/injected_script_source.target.linux-x86.mk
index c58b08f..f79663f 100644
--- a/Source/core/injected_script_source.target.linux-x86.mk
+++ b/Source/core/injected_script_source.target.linux-x86.mk
@@ -16,6 +16,7 @@
 
 ### Rules for action "ConvertFileToHeaderWithCharacterArray":
 $(gyp_shared_intermediate_dir)/blink/InjectedScriptSource.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/InjectedScriptSource.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/InjectedScriptSource.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InjectedScriptSource.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InjectedScriptSource.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/injected_script_source.target.linux-x86_64.mk b/Source/core/injected_script_source.target.linux-x86_64.mk
index c58b08f..f79663f 100644
--- a/Source/core/injected_script_source.target.linux-x86_64.mk
+++ b/Source/core/injected_script_source.target.linux-x86_64.mk
@@ -16,6 +16,7 @@
 
 ### Rules for action "ConvertFileToHeaderWithCharacterArray":
 $(gyp_shared_intermediate_dir)/blink/InjectedScriptSource.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/InjectedScriptSource.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/InjectedScriptSource.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InjectedScriptSource.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InjectedScriptSource.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/inspector/InjectedScriptBase.cpp b/Source/core/inspector/InjectedScriptBase.cpp
index c03f4a2..cf05edd 100644
--- a/Source/core/inspector/InjectedScriptBase.cpp
+++ b/Source/core/inspector/InjectedScriptBase.cpp
@@ -76,6 +76,7 @@
 {
     ExecutionContext* executionContext = m_injectedScriptObject.scriptState()->executionContext();
     TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "FunctionCall", "data", InspectorFunctionCallEvent::data(executionContext, 0, name(), 1));
+    TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline.stack"), "CallStack", "stack", InspectorCallStackEvent::currentCallStack());
     // FIXME(361045): remove InspectorInstrumentation calls once DevTools Timeline migrates to tracing.
     InspectorInstrumentationCookie cookie = InspectorInstrumentation::willCallFunction(executionContext, 0, name(), 1);
 
@@ -94,6 +95,7 @@
         scriptState->setEvalEnabled(false);
 
     InspectorInstrumentation::didCallFunction(cookie);
+    TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "UpdateCounters", "data", InspectorUpdateCountersEvent::data());
     return resultValue;
 }
 
diff --git a/Source/core/inspector/InspectorCSSAgent.cpp b/Source/core/inspector/InspectorCSSAgent.cpp
index b7303ad..9ad452c 100644
--- a/Source/core/inspector/InspectorCSSAgent.cpp
+++ b/Source/core/inspector/InspectorCSSAgent.cpp
@@ -729,7 +729,7 @@
     if (!node)
         return;
 
-    RefPtr<CSSComputedStyleDeclaration> computedStyleInfo = CSSComputedStyleDeclaration::create(node, true);
+    RefPtrWillBeRawPtr<CSSComputedStyleDeclaration> computedStyleInfo = CSSComputedStyleDeclaration::create(node, true);
     RefPtr<InspectorStyle> inspectorStyle = InspectorStyle::create(InspectorCSSId(), computedStyleInfo, 0);
     style = inspectorStyle->buildArrayForComputedStyle();
 }
@@ -759,7 +759,7 @@
     if (!node)
         return;
 
-    RefPtr<CSSComputedStyleDeclaration> computedStyleInfo = CSSComputedStyleDeclaration::create(node, true);
+    RefPtrWillBeRawPtr<CSSComputedStyleDeclaration> computedStyleInfo = CSSComputedStyleDeclaration::create(node, true);
     *cssFamilyName = computedStyleInfo->getPropertyValue(CSSPropertyFontFamily);
 
     Vector<Node*> textNodes;
diff --git a/Source/core/inspector/InspectorController.cpp b/Source/core/inspector/InspectorController.cpp
index 59e4613..93fb081 100644
--- a/Source/core/inspector/InspectorController.cpp
+++ b/Source/core/inspector/InspectorController.cpp
@@ -96,15 +96,15 @@
     m_agents.append(domAgentPtr.release());
 
 
-    OwnPtr<InspectorLayerTreeAgent> layerTreeAgentPtr(InspectorLayerTreeAgent::create(m_domAgent, m_page));
+    OwnPtr<InspectorLayerTreeAgent> layerTreeAgentPtr(InspectorLayerTreeAgent::create(m_page));
     m_layerTreeAgent = layerTreeAgentPtr.get();
     m_agents.append(layerTreeAgentPtr.release());
 
-    OwnPtr<InspectorTracingAgent> tracingAgentPtr = InspectorTracingAgent::create();
+    OwnPtr<InspectorTracingAgent> tracingAgentPtr = InspectorTracingAgent::create(inspectorClient);
     m_tracingAgent = tracingAgentPtr.get();
     m_agents.append(tracingAgentPtr.release());
 
-    OwnPtr<InspectorTimelineAgent> timelineAgentPtr(InspectorTimelineAgent::create(m_pageAgent, m_domAgent, m_layerTreeAgent,
+    OwnPtr<InspectorTimelineAgent> timelineAgentPtr(InspectorTimelineAgent::create(m_pageAgent, m_layerTreeAgent,
         overlay, InspectorTimelineAgent::PageInspector, inspectorClient));
     m_timelineAgent = timelineAgentPtr.get();
     m_agents.append(timelineAgentPtr.release());
@@ -199,7 +199,7 @@
     m_inspectorFrontendClient = inspectorFrontendClient;
 }
 
-void InspectorController::didClearWindowObjectInMainWorld(LocalFrame* frame)
+void InspectorController::didClearDocumentOfWindowObject(LocalFrame* frame)
 {
     // If the page is supposed to serve as InspectorFrontend notify inspector frontend
     // client that it's cleared so that the client can expose inspector bindings.
diff --git a/Source/core/inspector/InspectorController.h b/Source/core/inspector/InspectorController.h
index 99ab6bd..cb20342 100644
--- a/Source/core/inspector/InspectorController.h
+++ b/Source/core/inspector/InspectorController.h
@@ -84,7 +84,7 @@
     void registerModuleAgent(PassOwnPtr<InspectorAgent>);
 
     void setInspectorFrontendClient(PassOwnPtr<InspectorFrontendClient>);
-    void didClearWindowObjectInMainWorld(LocalFrame*);
+    void didClearDocumentOfWindowObject(LocalFrame*);
     void setInjectedScriptForOrigin(const String& origin, const String& source);
 
     void dispatchMessageFromFrontend(const String& message);
diff --git a/Source/core/inspector/InspectorDOMAgent.cpp b/Source/core/inspector/InspectorDOMAgent.cpp
index f35221a..3fc82c1 100644
--- a/Source/core/inspector/InspectorDOMAgent.cpp
+++ b/Source/core/inspector/InspectorDOMAgent.cpp
@@ -64,6 +64,7 @@
 #include "core/inspector/DOMPatchSupport.h"
 #include "core/inspector/IdentifiersFactory.h"
 #include "core/inspector/InspectorHistory.h"
+#include "core/inspector/InspectorNodeIds.h"
 #include "core/inspector/InspectorOverlay.h"
 #include "core/inspector/InspectorPageAgent.h"
 #include "core/inspector/InspectorState.h"
@@ -232,7 +233,6 @@
     , m_frontend(0)
     , m_domListener(0)
     , m_lastNodeId(1)
-    , m_lastBackendNodeId(-1)
     , m_searchingForNode(NotSearching)
     , m_suppressAttributeModifiedEvent(false)
 {
@@ -294,7 +294,6 @@
 void InspectorDOMAgent::reset()
 {
     discardFrontendBindings();
-    discardBackendBindings();
     m_document = nullptr;
 }
 
@@ -537,12 +536,6 @@
         m_revalidateStyleAttrTask->reset();
 }
 
-void InspectorDOMAgent::discardBackendBindings()
-{
-    m_backendIdToNode.clear();
-    m_nodeGroupToBackendIdMap.clear();
-}
-
 Node* InspectorDOMAgent::nodeForId(int id)
 {
     if (!id)
@@ -661,37 +654,6 @@
     return m_documentNodeToIdMap.get(node);
 }
 
-BackendNodeId InspectorDOMAgent::backendNodeIdForNode(Node* node, const String& nodeGroup)
-{
-    if (!node)
-        return 0;
-
-    if (!m_nodeGroupToBackendIdMap.contains(nodeGroup))
-        m_nodeGroupToBackendIdMap.set(nodeGroup, NodeToBackendIdMap());
-
-    NodeToBackendIdMap& map = m_nodeGroupToBackendIdMap.find(nodeGroup)->value;
-    BackendNodeId id = map.get(node);
-    if (!id) {
-        id = --m_lastBackendNodeId;
-        map.set(node, id);
-        m_backendIdToNode.set(id, std::make_pair(node, nodeGroup));
-    }
-
-    return id;
-}
-
-void InspectorDOMAgent::releaseBackendNodeIds(ErrorString* errorString, const String& nodeGroup)
-{
-    if (m_nodeGroupToBackendIdMap.contains(nodeGroup)) {
-        NodeToBackendIdMap& map = m_nodeGroupToBackendIdMap.find(nodeGroup)->value;
-        for (NodeToBackendIdMap::iterator it = map.begin(); it != map.end(); ++it)
-            m_backendIdToNode.remove(it->value);
-        m_nodeGroupToBackendIdMap.remove(nodeGroup);
-        return;
-    }
-    *errorString = "Group name not found";
-}
-
 void InspectorDOMAgent::setAttributeValue(ErrorString* errorString, int elementId, const String& name, const String& value)
 {
     Element* element = assertEditableElement(errorString, elementId);
@@ -1397,6 +1359,7 @@
 
     IntRect boundingBox = pixelSnappedIntRect(view->contentsToRootView(renderer->absoluteBoundingBoxRect()));
     RenderBoxModelObject* modelObject = renderer->isBoxModelObject() ? toRenderBoxModelObject(renderer) : 0;
+    RefPtr<TypeBuilder::DOM::ShapeOutsideInfo> shapeOutsideInfo = m_overlay->buildObjectForShapeOutside(node);
 
     model = TypeBuilder::DOM::BoxModel::create()
         .setContent(buildArrayForQuad(quads.at(3)))
@@ -1405,6 +1368,8 @@
         .setMargin(buildArrayForQuad(quads.at(0)))
         .setWidth(modelObject ? adjustForAbsoluteZoom(modelObject->pixelSnappedOffsetWidth(), modelObject) : boundingBox.width())
         .setHeight(modelObject ? adjustForAbsoluteZoom(modelObject->pixelSnappedOffsetHeight(), modelObject) : boundingBox.height());
+    if (shapeOutsideInfo)
+        model->setShapeOutside(shapeOutsideInfo);
 }
 
 void InspectorDOMAgent::getNodeForLocation(ErrorString* errorString, int x, int y, int* nodeId)
@@ -2049,21 +2014,18 @@
 {
     result = TypeBuilder::Array<int>::create();
     for (JSONArray::const_iterator it = backendNodeIds->begin(); it != backendNodeIds->end(); ++it) {
-        BackendNodeId backendNodeId;
+        int backendNodeId;
 
         if (!(*it)->asNumber(&backendNodeId)) {
             *errorString = "Invalid argument type";
             return;
         }
 
-        BackendIdToNodeMap::iterator backendIdToNodeIterator = m_backendIdToNode.find(backendNodeId);
-        if (backendIdToNodeIterator == m_backendIdToNode.end()) {
-            *errorString = "Node not found";
-            return;
-        }
-
-        Node* node = backendIdToNodeIterator->value.first;
-        result->addItem(pushNodePathToFrontend(node));
+        Node* node = InspectorNodeIds::nodeForId(backendNodeId);
+        if (node && node->document().page() == m_pageAgent->page())
+            result->addItem(pushNodePathToFrontend(node));
+        else
+            result->addItem(0);
     }
 }
 
diff --git a/Source/core/inspector/InspectorDOMAgent.h b/Source/core/inspector/InspectorDOMAgent.h
index 95b9659..65959c1 100644
--- a/Source/core/inspector/InspectorDOMAgent.h
+++ b/Source/core/inspector/InspectorDOMAgent.h
@@ -68,7 +68,6 @@
 struct HighlightConfig;
 
 typedef String ErrorString;
-typedef int BackendNodeId;
 
 
 struct EventListenerInfo {
@@ -135,7 +134,6 @@
     virtual void requestNode(ErrorString*, const String& objectId, int* nodeId) OVERRIDE;
     virtual void pushNodeByPathToFrontend(ErrorString*, const String& path, int* nodeId) OVERRIDE;
     virtual void pushNodesByBackendIdsToFrontend(ErrorString*, const RefPtr<JSONArray>& nodeIds, RefPtr<TypeBuilder::Array<int> >&) OVERRIDE;
-    virtual void releaseBackendNodeIds(ErrorString*, const String& nodeGroup) OVERRIDE;
     virtual void hideHighlight(ErrorString*) OVERRIDE;
     virtual void highlightRect(ErrorString*, int x, int y, int width, int height, const RefPtr<JSONObject>* color, const RefPtr<JSONObject>* outlineColor) OVERRIDE;
     virtual void highlightQuad(ErrorString*, const RefPtr<JSONArray>& quad, const RefPtr<JSONObject>* color, const RefPtr<JSONObject>* outlineColor) OVERRIDE;
@@ -178,7 +176,6 @@
     Node* nodeForId(int nodeId);
     int boundNodeId(Node*);
     void setDOMListener(DOMListener*);
-    BackendNodeId backendNodeIdForNode(Node*, const String& nodeGroup);
 
     static String documentURLString(Document*);
 
@@ -238,7 +235,6 @@
 
     Node* nodeForPath(const String& path);
 
-    void discardBackendBindings();
     void discardFrontendBindings();
 
     void innerHighlightQuad(PassOwnPtr<FloatQuad>, const RefPtr<JSONObject>* color, const RefPtr<JSONObject>* outlineColor);
@@ -251,18 +247,13 @@
     InspectorFrontend::DOM* m_frontend;
     DOMListener* m_domListener;
     NodeToIdMap m_documentNodeToIdMap;
-    typedef HashMap<RefPtr<Node>, BackendNodeId> NodeToBackendIdMap;
-    HashMap<String, NodeToBackendIdMap> m_nodeGroupToBackendIdMap;
     // Owns node mappings for dangling nodes.
     Vector<OwnPtr<NodeToIdMap> > m_danglingNodeToIdMaps;
     HashMap<int, Node*> m_idToNode;
     HashMap<int, NodeToIdMap*> m_idToNodesMap;
     HashSet<int> m_childrenRequested;
     HashMap<int, int> m_cachedChildCount;
-    typedef HashMap<BackendNodeId, std::pair<Node*, String> > BackendIdToNodeMap;
-    BackendIdToNodeMap m_backendIdToNode;
     int m_lastNodeId;
-    BackendNodeId m_lastBackendNodeId;
     RefPtr<Document> m_document;
     typedef HashMap<String, Vector<RefPtr<Node> > > SearchResults;
     SearchResults m_searchResults;
diff --git a/Source/core/inspector/InspectorFrontendClient.h b/Source/core/inspector/InspectorFrontendClient.h
index 00848e1..41e414d 100644
--- a/Source/core/inspector/InspectorFrontendClient.h
+++ b/Source/core/inspector/InspectorFrontendClient.h
@@ -42,8 +42,6 @@
 
     virtual void windowObjectCleared() = 0;
 
-    virtual void inspectedURLChanged(const String&) = 0;
-
     virtual void sendMessageToBackend(const String&) = 0;
 
     virtual void sendMessageToEmbedder(const String&) = 0;
diff --git a/Source/core/inspector/InspectorFrontendHost.cpp b/Source/core/inspector/InspectorFrontendHost.cpp
index fc99f88..e8fa1aa 100644
--- a/Source/core/inspector/InspectorFrontendHost.cpp
+++ b/Source/core/inspector/InspectorFrontendHost.cpp
@@ -144,12 +144,6 @@
     return m_frontendPage->mainFrame()->pageZoomFactor();
 }
 
-void InspectorFrontendHost::inspectedURLChanged(const String& newURL)
-{
-    if (m_client)
-        m_client->inspectedURLChanged(newURL);
-}
-
 void InspectorFrontendHost::setInjectedScriptForOrigin(const String& origin, const String& script)
 {
     m_frontendPage->inspectorController().setInjectedScriptForOrigin(origin, script);
diff --git a/Source/core/inspector/InspectorFrontendHost.h b/Source/core/inspector/InspectorFrontendHost.h
index a6c7908..22fe210 100644
--- a/Source/core/inspector/InspectorFrontendHost.h
+++ b/Source/core/inspector/InspectorFrontendHost.h
@@ -54,7 +54,6 @@
 
     void setZoomFactor(float);
     float zoomFactor();
-    void inspectedURLChanged(const String&);
 
     void setInjectedScriptForOrigin(const String& origin, const String& script);
 
diff --git a/Source/core/inspector/InspectorFrontendHost.idl b/Source/core/inspector/InspectorFrontendHost.idl
index 7f883fd..058608a 100644
--- a/Source/core/inspector/InspectorFrontendHost.idl
+++ b/Source/core/inspector/InspectorFrontendHost.idl
@@ -36,7 +36,6 @@
     // FIXME: setZoomFactor is here only for old frontends. Remove in M38.
     void setZoomFactor(float zoom);
     float zoomFactor();
-    void inspectedURLChanged(DOMString newURL);
 
     void setInjectedScriptForOrigin(DOMString origin, DOMString script);
 
diff --git a/Source/core/inspector/InspectorInspectorAgent.cpp b/Source/core/inspector/InspectorInspectorAgent.cpp
index 12aedd2..15eb17c 100644
--- a/Source/core/inspector/InspectorInspectorAgent.cpp
+++ b/Source/core/inspector/InspectorInspectorAgent.cpp
@@ -66,7 +66,7 @@
     m_instrumentingAgents->setInspectorInspectorAgent(0);
 }
 
-void InspectorInspectorAgent::didClearWindowObjectInMainWorld(LocalFrame* frame)
+void InspectorInspectorAgent::didClearDocumentOfWindowObject(LocalFrame* frame)
 {
     if (m_injectedScriptForOrigin.isEmpty())
         return;
diff --git a/Source/core/inspector/InspectorInspectorAgent.h b/Source/core/inspector/InspectorInspectorAgent.h
index 05c7452..adfff18 100644
--- a/Source/core/inspector/InspectorInspectorAgent.h
+++ b/Source/core/inspector/InspectorInspectorAgent.h
@@ -67,7 +67,7 @@
     virtual void setFrontend(InspectorFrontend*) OVERRIDE;
     virtual void clearFrontend() OVERRIDE;
 
-    void didClearWindowObjectInMainWorld(LocalFrame*);
+    void didClearDocumentOfWindowObject(LocalFrame*);
 
     void domContentLoadedEventFired(LocalFrame*);
 
diff --git a/Source/core/inspector/InspectorInstrumentation.idl b/Source/core/inspector/InspectorInstrumentation.idl
index fd05f13..52f01b2 100644
--- a/Source/core/inspector/InspectorInstrumentation.idl
+++ b/Source/core/inspector/InspectorInstrumentation.idl
@@ -68,7 +68,7 @@
 #include "core/dom/PseudoElement.h"
 
     [Page, Inspector, PageDebugger, PageRuntime]
-    void didClearWindowObjectInMainWorld([Keep] LocalFrame*);
+    void didClearDocumentOfWindowObject([Keep] LocalFrame*);
 
     [DOMDebugger, Inline=FastReturn]
     void willInsertDOMNode([Keep] Node* parent);
diff --git a/Source/core/inspector/InspectorLayerTreeAgent.cpp b/Source/core/inspector/InspectorLayerTreeAgent.cpp
index 5caa521..40d0d35 100644
--- a/Source/core/inspector/InspectorLayerTreeAgent.cpp
+++ b/Source/core/inspector/InspectorLayerTreeAgent.cpp
@@ -35,7 +35,7 @@
 
 #include "core/frame/LocalFrame.h"
 #include "core/inspector/IdentifiersFactory.h"
-#include "core/inspector/InspectorDOMAgent.h"
+#include "core/inspector/InspectorNodeIds.h"
 #include "core/inspector/InspectorState.h"
 #include "core/inspector/InstrumentingAgents.h"
 #include "core/loader/DocumentLoader.h"
@@ -51,10 +51,6 @@
 #include "public/platform/WebLayer.h"
 #include "wtf/text/Base64.h"
 
-namespace {
-const char LayerTreeAgentObjectGroup[] = "layerTreeAgent";
-}
-
 namespace WebCore {
 
 unsigned InspectorLayerTreeAgent::s_lastSnapshotId;
@@ -94,7 +90,7 @@
     return scrollRects->length() ? scrollRects.release() : nullptr;
 }
 
-static PassRefPtr<TypeBuilder::LayerTree::Layer> buildObjectForLayer(GraphicsLayer* graphicsLayer, BackendNodeId nodeId)
+static PassRefPtr<TypeBuilder::LayerTree::Layer> buildObjectForLayer(GraphicsLayer* graphicsLayer, int nodeId)
 {
     blink::WebLayer* webLayer = graphicsLayer->platformLayer();
     RefPtr<TypeBuilder::LayerTree::Layer> layerObject = TypeBuilder::LayerTree::Layer::create()
@@ -134,11 +130,10 @@
     return layerObject;
 }
 
-InspectorLayerTreeAgent::InspectorLayerTreeAgent(InspectorDOMAgent* domAgent, Page* page)
+InspectorLayerTreeAgent::InspectorLayerTreeAgent(Page* page)
     : InspectorBaseAgent<InspectorLayerTreeAgent>("LayerTree")
     , m_frontend(0)
     , m_page(page)
-    , m_domAgent(domAgent)
 {
 }
 
@@ -179,12 +174,11 @@
     m_instrumentingAgents->setInspectorLayerTreeAgent(0);
     m_snapshotById.clear();
     ErrorString unused;
-    m_domAgent->releaseBackendNodeIds(&unused, LayerTreeAgentObjectGroup);
 }
 
 void InspectorLayerTreeAgent::layerTreeDidChange()
 {
-    m_frontend->layerTreeDidChange(buildLayerTree(LayerTreeAgentObjectGroup));
+    m_frontend->layerTreeDidChange(buildLayerTree());
 }
 
 void InspectorLayerTreeAgent::didPaint(RenderObject*, const GraphicsLayer* graphicsLayer, GraphicsContext*, const LayoutRect& rect)
@@ -201,7 +195,7 @@
     m_frontend->layerPainted(idForLayer(graphicsLayer), domRect.release());
 }
 
-PassRefPtr<TypeBuilder::Array<TypeBuilder::LayerTree::Layer> > InspectorLayerTreeAgent::buildLayerTree(const String& nodeGroup)
+PassRefPtr<TypeBuilder::Array<TypeBuilder::LayerTree::Layer> > InspectorLayerTreeAgent::buildLayerTree()
 {
     RenderLayerCompositor* compositor = renderLayerCompositor();
     if (!compositor || !compositor->inCompositingMode())
@@ -209,27 +203,27 @@
 
     LayerIdToNodeIdMap layerIdToNodeIdMap;
     RefPtr<TypeBuilder::Array<TypeBuilder::LayerTree::Layer> > layers = TypeBuilder::Array<TypeBuilder::LayerTree::Layer>::create();
-    buildLayerIdToNodeIdMap(compositor->rootRenderLayer(), nodeGroup, layerIdToNodeIdMap);
+    buildLayerIdToNodeIdMap(compositor->rootRenderLayer(), layerIdToNodeIdMap);
     gatherGraphicsLayers(compositor->rootGraphicsLayer(), layerIdToNodeIdMap, layers);
     return layers.release();
 }
 
-void InspectorLayerTreeAgent::buildLayerIdToNodeIdMap(RenderLayer* root, const String& nodeGroup, LayerIdToNodeIdMap& layerIdToNodeIdMap)
+void InspectorLayerTreeAgent::buildLayerIdToNodeIdMap(RenderLayer* root, LayerIdToNodeIdMap& layerIdToNodeIdMap)
 {
     if (root->hasCompositedLayerMapping()) {
         if (Node* node = root->renderer()->generatingNode()) {
             GraphicsLayer* graphicsLayer = root->compositedLayerMapping()->childForSuperlayers();
-            layerIdToNodeIdMap.set(graphicsLayer->platformLayer()->id(), idForNode(node, nodeGroup));
+            layerIdToNodeIdMap.set(graphicsLayer->platformLayer()->id(), idForNode(node));
         }
     }
     for (RenderLayer* child = root->firstChild(); child; child = child->nextSibling())
-        buildLayerIdToNodeIdMap(child, nodeGroup, layerIdToNodeIdMap);
+        buildLayerIdToNodeIdMap(child, layerIdToNodeIdMap);
     if (!root->renderer()->isRenderIFrame())
         return;
     FrameView* childFrameView = toFrameView(toRenderWidget(root->renderer())->widget());
     if (RenderView* childRenderView = childFrameView->renderView()) {
         if (RenderLayerCompositor* childCompositor = childRenderView->compositor())
-            buildLayerIdToNodeIdMap(childCompositor->rootRenderLayer(), nodeGroup, layerIdToNodeIdMap);
+            buildLayerIdToNodeIdMap(childCompositor->rootRenderLayer(), layerIdToNodeIdMap);
     }
 }
 
@@ -245,9 +239,9 @@
         gatherGraphicsLayers(root->children()[i], layerIdToNodeIdMap, layers);
 }
 
-int InspectorLayerTreeAgent::idForNode(Node* node, const String& nodeGroup)
+int InspectorLayerTreeAgent::idForNode(Node* node)
 {
-    return m_domAgent->backendNodeIdForNode(node, nodeGroup);
+    return InspectorNodeIds::idForNode(node);
 }
 
 RenderLayerCompositor* InspectorLayerTreeAgent::renderLayerCompositor()
@@ -388,6 +382,14 @@
     }
 }
 
+void InspectorLayerTreeAgent::snapshotCommandLog(ErrorString* errorString, const String& snapshotId, RefPtr<TypeBuilder::Array<JSONObject> >& commandLog)
+{
+    const GraphicsContextSnapshot* snapshot = snapshotById(errorString, snapshotId);
+    if (!snapshot)
+        return;
+    commandLog = TypeBuilder::Array<JSONObject>::runtimeCast(snapshot->snapshotCommandLog());
+}
+
 void InspectorLayerTreeAgent::willAddPageOverlay(const GraphicsLayer* layer)
 {
     m_pageOverlayLayerIds.append(layer->platformLayer()->id());
diff --git a/Source/core/inspector/InspectorLayerTreeAgent.h b/Source/core/inspector/InspectorLayerTreeAgent.h
index c23116b..ecb08b1 100644
--- a/Source/core/inspector/InspectorLayerTreeAgent.h
+++ b/Source/core/inspector/InspectorLayerTreeAgent.h
@@ -43,7 +43,6 @@
 namespace WebCore {
 
 class GraphicsContextSnapshot;
-class InspectorDOMAgent;
 class InstrumentingAgents;
 class Page;
 class RenderLayerCompositor;
@@ -52,9 +51,9 @@
 
 class InspectorLayerTreeAgent FINAL : public InspectorBaseAgent<InspectorLayerTreeAgent>, public InspectorBackendDispatcher::LayerTreeCommandHandler {
 public:
-    static PassOwnPtr<InspectorLayerTreeAgent> create(InspectorDOMAgent* domAgent, Page* page)
+    static PassOwnPtr<InspectorLayerTreeAgent> create(Page* page)
     {
-        return adoptPtr(new InspectorLayerTreeAgent(domAgent, page));
+        return adoptPtr(new InspectorLayerTreeAgent(page));
     }
     virtual ~InspectorLayerTreeAgent();
 
@@ -79,27 +78,27 @@
     virtual void releaseSnapshot(ErrorString*, const String& snapshotId) OVERRIDE;
     virtual void replaySnapshot(ErrorString*, const String& snapshotId, const int* fromStep, const int* toStep, String* dataURL) OVERRIDE;
     virtual void profileSnapshot(ErrorString*, const String& snapshotId, const int* minRepeatCount, const double* minDuration, RefPtr<TypeBuilder::Array<TypeBuilder::Array<double> > >&) OVERRIDE;
+    virtual void snapshotCommandLog(ErrorString*, const String& snapshotId, RefPtr<TypeBuilder::Array<JSONObject> >&) OVERRIDE;
 
     // Called by other agents.
-    PassRefPtr<TypeBuilder::Array<TypeBuilder::LayerTree::Layer> > buildLayerTree(const String& nodeGroup);
+    PassRefPtr<TypeBuilder::Array<TypeBuilder::LayerTree::Layer> > buildLayerTree();
 
 private:
     static unsigned s_lastSnapshotId;
 
-    InspectorLayerTreeAgent(InspectorDOMAgent*, Page*);
+    explicit InspectorLayerTreeAgent(Page*);
 
     RenderLayerCompositor* renderLayerCompositor();
     GraphicsLayer* layerById(ErrorString*, const String& layerId);
     const GraphicsContextSnapshot* snapshotById(ErrorString*, const String& snapshotId);
 
     typedef HashMap<int, int> LayerIdToNodeIdMap;
-    void buildLayerIdToNodeIdMap(RenderLayer*, const String& nodeGroup, LayerIdToNodeIdMap&);
+    void buildLayerIdToNodeIdMap(RenderLayer*, LayerIdToNodeIdMap&);
     void gatherGraphicsLayers(GraphicsLayer*, HashMap<int, int>& layerIdToNodeIdMap, RefPtr<TypeBuilder::Array<TypeBuilder::LayerTree::Layer> >&);
-    int idForNode(Node*, const String& nodeGroup);
+    int idForNode(Node*);
 
     InspectorFrontend::LayerTree* m_frontend;
     Page* m_page;
-    InspectorDOMAgent* m_domAgent;
     Vector<int, 2> m_pageOverlayLayerIds;
 
     typedef HashMap<String, RefPtr<GraphicsContextSnapshot> > SnapshotById;
diff --git a/Source/core/inspector/InspectorNodeIds.cpp b/Source/core/inspector/InspectorNodeIds.cpp
index 33ec463..81bb9e7 100644
--- a/Source/core/inspector/InspectorNodeIds.cpp
+++ b/Source/core/inspector/InspectorNodeIds.cpp
@@ -27,4 +27,9 @@
     return result;
 }
 
+Node* InspectorNodeIds::nodeForId(int id)
+{
+    return nodeIds().node(id);
+}
+
 }
diff --git a/Source/core/inspector/InspectorNodeIds.h b/Source/core/inspector/InspectorNodeIds.h
index 1f24d98..50d3623 100644
--- a/Source/core/inspector/InspectorNodeIds.h
+++ b/Source/core/inspector/InspectorNodeIds.h
@@ -12,6 +12,7 @@
 class InspectorNodeIds {
 public:
     static int idForNode(Node*);
+    static Node* nodeForId(int);
 };
 
 } // namespace WebCore
diff --git a/Source/core/inspector/InspectorOverlay.cpp b/Source/core/inspector/InspectorOverlay.cpp
index 522204b..419167e 100644
--- a/Source/core/inspector/InspectorOverlay.cpp
+++ b/Source/core/inspector/InspectorOverlay.cpp
@@ -59,6 +59,14 @@
 
 namespace {
 
+struct PathApplyInfo {
+    FrameView* rootView;
+    FrameView* view;
+    TypeBuilder::Array<JSONValue>* array;
+    RenderObject* renderer;
+    const ShapeOutsideInfo* shapeOutsideInfo;
+};
+
 class InspectorOverlayChromeClient FINAL: public EmptyChromeClient {
 public:
     InspectorOverlayChromeClient(ChromeClient& client, InspectorOverlay* overlay)
@@ -483,7 +491,105 @@
     return result.release();
 }
 
-static void setElementInfo(RefPtr<JSONObject>& highlightObject, Node* node)
+// CSS shapes
+static void appendPathCommandAndPoints(PathApplyInfo* info, const String& command, const FloatPoint points[], unsigned length)
+{
+    FloatPoint point;
+    info->array->addItem(JSONString::create(command));
+    for (unsigned i = 0; i < length; i++) {
+        point = info->shapeOutsideInfo->shapeToRendererPoint(points[i]);
+        point = info->view->contentsToRootView(roundedIntPoint(info->renderer->localToAbsolute(point))) + info->rootView->scrollOffset();
+        info->array->addItem(JSONBasicValue::create(point.x()));
+        info->array->addItem(JSONBasicValue::create(point.y()));
+    }
+}
+
+static void appendPathSegment(void* info, const PathElement* pathElement)
+{
+    PathApplyInfo* pathApplyInfo = static_cast<PathApplyInfo*>(info);
+    FloatPoint point;
+    switch (pathElement->type) {
+    // The points member will contain 1 value.
+    case PathElementMoveToPoint:
+        appendPathCommandAndPoints(pathApplyInfo, "M", pathElement->points, 1);
+        break;
+    // The points member will contain 1 value.
+    case PathElementAddLineToPoint:
+        appendPathCommandAndPoints(pathApplyInfo, "L", pathElement->points, 1);
+        break;
+    // The points member will contain 3 values.
+    case PathElementAddCurveToPoint:
+        appendPathCommandAndPoints(pathApplyInfo, "C", pathElement->points, 3);
+        break;
+    // The points member will contain 2 values.
+    case PathElementAddQuadCurveToPoint:
+        appendPathCommandAndPoints(pathApplyInfo, "Q", pathElement->points, 2);
+        break;
+    // The points member will contain no values.
+    case PathElementCloseSubpath:
+        appendPathCommandAndPoints(pathApplyInfo, "Z", 0, 0);
+        break;
+    }
+}
+
+static RefPtr<TypeBuilder::Array<double> > buildArrayForQuadTypeBuilder(const FloatQuad& quad)
+{
+    RefPtr<TypeBuilder::Array<double> > array = TypeBuilder::Array<double>::create();
+    array->addItem(quad.p1().x());
+    array->addItem(quad.p1().y());
+    array->addItem(quad.p2().x());
+    array->addItem(quad.p2().y());
+    array->addItem(quad.p3().x());
+    array->addItem(quad.p3().y());
+    array->addItem(quad.p4().x());
+    array->addItem(quad.p4().y());
+    return array.release();
+}
+
+PassRefPtr<TypeBuilder::DOM::ShapeOutsideInfo> InspectorOverlay::buildObjectForShapeOutside(Node* node)
+{
+    RenderObject* renderer = node->renderer();
+    if (!renderer || !renderer->isBox() || !toRenderBox(renderer)->shapeOutsideInfo())
+        return nullptr;
+
+    LocalFrame* containingFrame = node->document().frame();
+    RenderBox* renderBox = toRenderBox(renderer);
+    const ShapeOutsideInfo* shapeOutsideInfo = renderBox->shapeOutsideInfo();
+
+    LayoutRect shapeBounds = shapeOutsideInfo->computedShapePhysicalBoundingBox();
+    FloatQuad shapeQuad = renderBox->localToAbsoluteQuad(FloatRect(shapeBounds));
+    FrameView* mainView = containingFrame->page()->mainFrame()->view();
+    FrameView* containingView = containingFrame->view();
+    contentsQuadToPage(mainView, containingView, shapeQuad);
+
+    Shape::DisplayPaths paths;
+    shapeOutsideInfo->computedShape().buildDisplayPaths(paths);
+    RefPtr<TypeBuilder::Array<JSONValue> > shapePath = TypeBuilder::Array<JSONValue>::create();
+    RefPtr<TypeBuilder::Array<JSONValue> > marginShapePath = TypeBuilder::Array<JSONValue>::create();
+
+    if (paths.shape.length()) {
+        PathApplyInfo info;
+        info.rootView = mainView;
+        info.view = containingView;
+        info.array = shapePath.get();
+        info.renderer = renderBox;
+        info.shapeOutsideInfo = shapeOutsideInfo;
+        paths.shape.apply(&info, &appendPathSegment);
+
+        if (paths.marginShape.length()) {
+            info.array = marginShapePath.get();
+            paths.marginShape.apply(&info, &appendPathSegment);
+        }
+    }
+    RefPtr<TypeBuilder::DOM::ShapeOutsideInfo> shapeTypeBuilder = TypeBuilder::DOM::ShapeOutsideInfo::create()
+        .setBounds(buildArrayForQuadTypeBuilder(shapeQuad))
+        .setShape(shapePath)
+        .setMarginShape(marginShapePath);
+
+    return shapeTypeBuilder.release();
+}
+
+static void setElementInfo(RefPtr<JSONObject>& highlightObject, RefPtr<JSONObject>& shapeObject, Node* node)
 {
     RefPtr<JSONObject> elementInfo = JSONObject::create();
     Element* element = toElement(node);
@@ -525,6 +631,8 @@
     RenderBoxModelObject* modelObject = renderer->isBoxModelObject() ? toRenderBoxModelObject(renderer) : 0;
     elementInfo->setString("nodeWidth", String::number(modelObject ? adjustForAbsoluteZoom(modelObject->pixelSnappedOffsetWidth(), modelObject) : boundingBox.width()));
     elementInfo->setString("nodeHeight", String::number(modelObject ? adjustForAbsoluteZoom(modelObject->pixelSnappedOffsetHeight(), modelObject) : boundingBox.height()));
+    if (renderer->isBox() && shapeObject)
+        elementInfo->setObject("shapeOutsideInfo", shapeObject.release());
     highlightObject->setObject("elementInfo", elementInfo.release());
 }
 
@@ -543,8 +651,10 @@
     RefPtr<JSONObject> highlightObject = buildObjectForHighlight(highlight);
 
     Node* node = m_highlightNode.get();
+    RefPtr<TypeBuilder::DOM::ShapeOutsideInfo> shapeObject = buildObjectForShapeOutside(node);
+    RefPtr<JSONObject> shapeObjectJSON = shapeObject ? shapeObject->asObject() : nullptr;
     if (node->isElementNode() && !m_omitTooltip && m_nodeHighlightConfig.showInfo && node->renderer() && node->document().frame())
-        setElementInfo(highlightObject, node);
+        setElementInfo(highlightObject, shapeObjectJSON, node);
     evaluateInOverlay("drawNodeHighlight", highlightObject);
 }
 
diff --git a/Source/core/inspector/InspectorOverlay.h b/Source/core/inspector/InspectorOverlay.h
index 01baa67..579fcf6 100644
--- a/Source/core/inspector/InspectorOverlay.h
+++ b/Source/core/inspector/InspectorOverlay.h
@@ -29,6 +29,7 @@
 #ifndef InspectorOverlay_h
 #define InspectorOverlay_h
 
+#include "InspectorTypeBuilder.h"
 #include "platform/Timer.h"
 #include "platform/geometry/FloatQuad.h"
 #include "platform/geometry/LayoutRect.h"
@@ -47,6 +48,7 @@
 class GraphicsContext;
 class InspectorClient;
 class InspectorOverlayHost;
+class JSONObject;
 class JSONValue;
 class Node;
 class Page;
@@ -135,6 +137,7 @@
 
     Node* highlightedNode() const;
     bool getBoxModel(Node*, Vector<FloatQuad>*);
+    PassRefPtr<TypeBuilder::DOM::ShapeOutsideInfo> buildObjectForShapeOutside(Node*);
 
     void freePage();
 
diff --git a/Source/core/inspector/InspectorOverlayPage.html b/Source/core/inspector/InspectorOverlayPage.html
index d368395..882502a 100644
--- a/Source/core/inspector/InspectorOverlayPage.html
+++ b/Source/core/inspector/InspectorOverlayPage.html
@@ -156,6 +156,9 @@
 const darkGridColor = "rgba(0,0,0,0.7)";
 const transparentColor = "rgba(0, 0, 0, 0)";
 const gridBackgroundColor = "rgba(255, 255, 255, 0.8)";
+// CSS shapes
+const shapeHighlightColor = "rgba(96, 82, 127, 0.8)";
+const shapeMarginHighlightColor = "rgba(96, 82, 127, 0.6)";
 
 function drawPausedInDebuggerMessage(message)
 {
@@ -543,6 +546,54 @@
 
     context.restore();
 }
+// CSS shapes 
+function drawPath(commands, fillColor)
+{
+    context.save();
+    context.beginPath();
+
+    var commandsIndex = 0;
+    var commandsLength = commands.length;
+    while (commandsIndex < commandsLength) {
+        switch (commands[commandsIndex++]) {
+        case "M":
+            context.moveTo(commands[commandsIndex++], commands[commandsIndex++]);
+            break;
+        case "L":
+            context.lineTo(commands[commandsIndex++], commands[commandsIndex++]);
+            break;
+        case "C":
+            context.bezierCurveTo(commands[commandsIndex++], commands[commandsIndex++], commands[commandsIndex++],
+                                  commands[commandsIndex++], commands[commandsIndex++], commands[commandsIndex++]);
+            break;
+        case "Q":
+            context.quadraticCurveTo(commands[commandsIndex++], commands[commandsIndex++], commands[commandsIndex++],
+                                     commands[commandsIndex++]);
+            break;
+        case "Z":
+            context.closePath();
+            break;
+        }
+    }
+    context.closePath();
+    context.fillStyle = fillColor;
+    context.fill();
+
+    context.restore();
+}
+
+function drawShapeHighlight(shapeInfo)
+{
+    if (shapeInfo.marginShape)
+        drawPath(shapeInfo.marginShape, shapeMarginHighlightColor);
+    else
+        drawOutlinedQuad(shapeInfo.bounds, shapeHighlightColor, shapeHighlightColor);
+
+    if (shapeInfo.shape)
+        drawPath(shapeInfo.shape, shapeHighlightColor);
+   else
+        drawOutlinedQuad(shapeInfo.bounds, shapeHighlightColor, shapeHighlightColor);
+}
 
 function drawNodeHighlight(highlight)
 {
@@ -615,6 +666,8 @@
         _drawGrid(rulerAtRight, rulerAtBottom);
         _drawRulers(highlight, rulerAtRight, rulerAtBottom);
     }
+    if (highlight.elementInfo && highlight.elementInfo.shapeOutsideInfo)
+        drawShapeHighlight(highlight.elementInfo.shapeOutsideInfo);
     _drawElementTitle(highlight);
 
     context.restore();
diff --git a/Source/core/inspector/InspectorPageAgent.cpp b/Source/core/inspector/InspectorPageAgent.cpp
index 9b23374..f7389da 100644
--- a/Source/core/inspector/InspectorPageAgent.cpp
+++ b/Source/core/inspector/InspectorPageAgent.cpp
@@ -829,7 +829,7 @@
     }
 }
 
-void InspectorPageAgent::didClearWindowObjectInMainWorld(LocalFrame* frame)
+void InspectorPageAgent::didClearDocumentOfWindowObject(LocalFrame* frame)
 {
     if (frame == m_page->mainFrame())
         m_injectedScriptManager->discardInjectedScripts();
diff --git a/Source/core/inspector/InspectorPageAgent.h b/Source/core/inspector/InspectorPageAgent.h
index 2ab1107..5d340d3 100644
--- a/Source/core/inspector/InspectorPageAgent.h
+++ b/Source/core/inspector/InspectorPageAgent.h
@@ -118,7 +118,7 @@
     virtual void setShowViewportSizeOnResize(ErrorString*, bool show, const bool* showGrid) OVERRIDE;
 
     // InspectorInstrumentation API
-    void didClearWindowObjectInMainWorld(LocalFrame*);
+    void didClearDocumentOfWindowObject(LocalFrame*);
     void domContentLoadedEventFired(LocalFrame*);
     void loadEventFired(LocalFrame*);
     void didCommitLoad(LocalFrame*, DocumentLoader*);
diff --git a/Source/core/inspector/InspectorStyleSheet.cpp b/Source/core/inspector/InspectorStyleSheet.cpp
index 69cd7ca..79720de 100644
--- a/Source/core/inspector/InspectorStyleSheet.cpp
+++ b/Source/core/inspector/InspectorStyleSheet.cpp
@@ -503,12 +503,12 @@
     return nullptr;
 }
 
-PassRefPtr<InspectorStyle> InspectorStyle::create(const InspectorCSSId& styleId, PassRefPtr<CSSStyleDeclaration> style, InspectorStyleSheetBase* parentStyleSheet)
+PassRefPtr<InspectorStyle> InspectorStyle::create(const InspectorCSSId& styleId, PassRefPtrWillBeRawPtr<CSSStyleDeclaration> style, InspectorStyleSheetBase* parentStyleSheet)
 {
     return adoptRef(new InspectorStyle(styleId, style, parentStyleSheet));
 }
 
-InspectorStyle::InspectorStyle(const InspectorCSSId& styleId, PassRefPtr<CSSStyleDeclaration> style, InspectorStyleSheetBase* parentStyleSheet)
+InspectorStyle::InspectorStyle(const InspectorCSSId& styleId, PassRefPtrWillBeRawPtr<CSSStyleDeclaration> style, InspectorStyleSheetBase* parentStyleSheet)
     : m_styleId(styleId)
     , m_style(style)
     , m_parentStyleSheet(parentStyleSheet)
diff --git a/Source/core/inspector/InspectorStyleSheet.h b/Source/core/inspector/InspectorStyleSheet.h
index 7e3907a..63b343a 100644
--- a/Source/core/inspector/InspectorStyleSheet.h
+++ b/Source/core/inspector/InspectorStyleSheet.h
@@ -113,7 +113,7 @@
 
 class InspectorStyle FINAL : public RefCounted<InspectorStyle> {
 public:
-    static PassRefPtr<InspectorStyle> create(const InspectorCSSId&, PassRefPtr<CSSStyleDeclaration>, InspectorStyleSheetBase* parentStyleSheet);
+    static PassRefPtr<InspectorStyle> create(const InspectorCSSId&, PassRefPtrWillBeRawPtr<CSSStyleDeclaration>, InspectorStyleSheetBase* parentStyleSheet);
 
     CSSStyleDeclaration* cssStyle() const { return m_style.get(); }
     PassRefPtr<TypeBuilder::CSS::CSSStyle> buildObjectForStyle() const;
@@ -122,7 +122,7 @@
     bool styleText(String* result) const;
 
 private:
-    InspectorStyle(const InspectorCSSId&, PassRefPtr<CSSStyleDeclaration>, InspectorStyleSheetBase* parentStyleSheet);
+    InspectorStyle(const InspectorCSSId&, PassRefPtrWillBeRawPtr<CSSStyleDeclaration>, InspectorStyleSheetBase* parentStyleSheet);
 
     bool verifyPropertyText(const String& propertyText, bool canOmitSemicolon);
     void populateAllProperties(WillBeHeapVector<InspectorStyleProperty>& result) const;
@@ -134,7 +134,7 @@
     inline Document* ownerDocument() const;
 
     InspectorCSSId m_styleId;
-    RefPtr<CSSStyleDeclaration> m_style;
+    RefPtrWillBePersistent<CSSStyleDeclaration> m_style;
     InspectorStyleSheetBase* m_parentStyleSheet;
     mutable std::pair<String, String> m_format;
     mutable bool m_formatAcquired;
diff --git a/Source/core/inspector/InspectorTimelineAgent.cpp b/Source/core/inspector/InspectorTimelineAgent.cpp
index a3840d7..5af270a 100644
--- a/Source/core/inspector/InspectorTimelineAgent.cpp
+++ b/Source/core/inspector/InspectorTimelineAgent.cpp
@@ -40,9 +40,9 @@
 #include "core/inspector/IdentifiersFactory.h"
 #include "core/inspector/InspectorClient.h"
 #include "core/inspector/InspectorCounters.h"
-#include "core/inspector/InspectorDOMAgent.h"
 #include "core/inspector/InspectorInstrumentation.h"
 #include "core/inspector/InspectorLayerTreeAgent.h"
+#include "core/inspector/InspectorNodeIds.h"
 #include "core/inspector/InspectorOverlay.h"
 #include "core/inspector/InspectorPageAgent.h"
 #include "core/inspector/InspectorState.h"
@@ -139,10 +139,6 @@
 static const char EmbedderCallback[] = "EmbedderCallback";
 }
 
-namespace {
-const char BackendNodeIdGroup[] = "timeline";
-}
-
 using TypeBuilder::Timeline::TimelineEvent;
 
 struct TimelineRecordEntry {
@@ -276,7 +272,6 @@
     RefPtr<TypeBuilder::Array<TimelineEvent> > events;
     stop(&error, events);
     disable(&error);
-    releaseNodeIds();
     m_frontend = 0;
 }
 
@@ -318,7 +313,6 @@
         return;
     }
 
-    releaseNodeIds();
     if (maxCallStackDepth && *maxCallStackDepth >= 0)
         m_maxCallStackDepth = *maxCallStackDepth;
     else
@@ -513,7 +507,7 @@
 void InspectorTimelineAgent::layerTreeDidChange()
 {
     ASSERT(!m_pendingLayerTreeData);
-    m_pendingLayerTreeData = m_layerTreeAgent->buildLayerTree(BackendNodeIdGroup);
+    m_pendingLayerTreeData = m_layerTreeAgent->buildLayerTree();
 }
 
 void InspectorTimelineAgent::willUpdateLayerTree()
@@ -1152,11 +1146,10 @@
     }
 }
 
-InspectorTimelineAgent::InspectorTimelineAgent(InspectorPageAgent* pageAgent, InspectorDOMAgent* domAgent, InspectorLayerTreeAgent* layerTreeAgent,
+InspectorTimelineAgent::InspectorTimelineAgent(InspectorPageAgent* pageAgent, InspectorLayerTreeAgent* layerTreeAgent,
     InspectorOverlay* overlay, InspectorType type, InspectorClient* client)
     : InspectorBaseAgent<InspectorTimelineAgent>("Timeline")
     , m_pageAgent(pageAgent)
-    , m_domAgent(domAgent)
     , m_layerTreeAgent(layerTreeAgent)
     , m_frontend(0)
     , m_client(client)
@@ -1243,19 +1236,12 @@
 
 long long InspectorTimelineAgent::nodeId(Node* node)
 {
-    return m_domAgent && node ? m_domAgent->backendNodeIdForNode(node, BackendNodeIdGroup) : 0;
+    return node ? InspectorNodeIds::idForNode(node)  : 0;
 }
 
 long long InspectorTimelineAgent::nodeId(RenderObject* renderer)
 {
-    return nodeId(renderer->generatingNode());
-}
-
-void InspectorTimelineAgent::releaseNodeIds()
-{
-    ErrorString unused;
-    if (m_domAgent)
-        m_domAgent->releaseBackendNodeIds(&unused, BackendNodeIdGroup);
+    return InspectorNodeIds::idForNode(renderer->generatingNode());
 }
 
 double InspectorTimelineAgent::timestamp()
diff --git a/Source/core/inspector/InspectorTimelineAgent.h b/Source/core/inspector/InspectorTimelineAgent.h
index 5c57e6a..1c53755 100644
--- a/Source/core/inspector/InspectorTimelineAgent.h
+++ b/Source/core/inspector/InspectorTimelineAgent.h
@@ -65,7 +65,6 @@
 class GraphicsContext;
 class GraphicsLayer;
 class InspectorClient;
-class InspectorDOMAgent;
 class InspectorFrontend;
 class InspectorOverlay;
 class InspectorPageAgent;
@@ -115,10 +114,10 @@
         uint64_t limitGPUMemoryBytes;
     };
 
-    static PassOwnPtr<InspectorTimelineAgent> create(InspectorPageAgent* pageAgent, InspectorDOMAgent* domAgent, InspectorLayerTreeAgent* layerTreeAgent,
+    static PassOwnPtr<InspectorTimelineAgent> create(InspectorPageAgent* pageAgent, InspectorLayerTreeAgent* layerTreeAgent,
         InspectorOverlay* overlay, InspectorType type, InspectorClient* client)
     {
-        return adoptPtr(new InspectorTimelineAgent(pageAgent, domAgent, layerTreeAgent, overlay, type, client));
+        return adoptPtr(new InspectorTimelineAgent(pageAgent, layerTreeAgent, overlay, type, client));
     }
 
     virtual ~InspectorTimelineAgent();
@@ -232,7 +231,7 @@
 
     friend class TimelineRecordStack;
 
-    InspectorTimelineAgent(InspectorPageAgent*, InspectorDOMAgent*, InspectorLayerTreeAgent*, InspectorOverlay*, InspectorType, InspectorClient*);
+    InspectorTimelineAgent(InspectorPageAgent*, InspectorLayerTreeAgent*, InspectorOverlay*, InspectorType, InspectorClient*);
 
     // Trace event handlers
     void onBeginImplSideFrame(const TraceEventDispatcher::TraceEvent&);
@@ -277,7 +276,6 @@
     void localToPageQuad(const RenderObject& renderer, const LayoutRect&, FloatQuad*);
     long long nodeId(Node*);
     long long nodeId(RenderObject*);
-    void releaseNodeIds();
 
     double timestamp();
 
@@ -289,7 +287,6 @@
     void setLiveEvents(const String&);
 
     InspectorPageAgent* m_pageAgent;
-    InspectorDOMAgent* m_domAgent;
     InspectorLayerTreeAgent* m_layerTreeAgent;
     InspectorFrontend::Timeline* m_frontend;
     InspectorClient* m_client;
diff --git a/Source/core/inspector/InspectorTraceEvents.cpp b/Source/core/inspector/InspectorTraceEvents.cpp
index 8e442d0..09309e0 100644
--- a/Source/core/inspector/InspectorTraceEvents.cpp
+++ b/Source/core/inspector/InspectorTraceEvents.cpp
@@ -5,11 +5,14 @@
 #include "config.h"
 #include "core/inspector/InspectorTraceEvents.h"
 
+#include "bindings/v8/ScriptCallStackFactory.h"
+#include "bindings/v8/ScriptGCEvent.h"
 #include "bindings/v8/ScriptSourceCode.h"
 #include "core/frame/FrameView.h"
 #include "core/frame/LocalFrame.h"
 #include "core/inspector/IdentifiersFactory.h"
 #include "core/inspector/InspectorNodeIds.h"
+#include "core/inspector/ScriptCallStack.h"
 #include "core/page/Page.h"
 #include "core/rendering/RenderObject.h"
 #include "core/xml/XMLHttpRequest.h"
@@ -24,11 +27,29 @@
 
 namespace WebCore {
 
-static String toHexString(void* p)
+namespace {
+
+class JSCallStack : public TraceEvent::ConvertableToTraceFormat  {
+public:
+    explicit JSCallStack(PassRefPtr<ScriptCallStack> callstack) : m_callstack(callstack) { }
+    virtual String asTraceFormat() const
+    {
+        if (!m_callstack)
+            return "[]";
+        return m_callstack->buildInspectorArray()->toJSONString();
+    }
+
+private:
+    RefPtr<ScriptCallStack> m_callstack;
+};
+
+String toHexString(void* p)
 {
     return String::format("0x%" PRIx64, static_cast<uint64>(reinterpret_cast<intptr_t>(p)));
 }
 
+}
+
 PassRefPtr<TraceEvent::ConvertableToTraceFormat> InspectorLayoutEvent::beginData(FrameView* frameView)
 {
     bool isPartial;
@@ -274,4 +295,28 @@
     return TracedValue::fromJSONValue(data);
 }
 
+static size_t usedHeapSize()
+{
+    HeapInfo info;
+    ScriptGCEvent::getHeapSize(info);
+    return info.usedJSHeapSize;
+}
+
+PassRefPtr<TraceEvent::ConvertableToTraceFormat> InspectorUpdateCountersEvent::data()
+{
+    RefPtr<JSONObject> data = JSONObject::create();
+    if (isMainThread()) {
+        data->setNumber("documents", InspectorCounters::counterValue(InspectorCounters::DocumentCounter));
+        data->setNumber("nodes", InspectorCounters::counterValue(InspectorCounters::NodeCounter));
+        data->setNumber("jsEventListeners", InspectorCounters::counterValue(InspectorCounters::JSEventListenerCounter));
+    }
+    data->setNumber("jsHeapSizeUsed", static_cast<double>(usedHeapSize()));
+    return TracedValue::fromJSONValue(data);
+}
+
+PassRefPtr<TraceEvent::ConvertableToTraceFormat> InspectorCallStackEvent::currentCallStack()
+{
+    return adoptRef(new JSCallStack(createScriptCallStack(ScriptCallStack::maxCallStackSizeToCapture, true)));
+}
+
 }
diff --git a/Source/core/inspector/InspectorTraceEvents.h b/Source/core/inspector/InspectorTraceEvents.h
index 5d111a3..205ba9f 100644
--- a/Source/core/inspector/InspectorTraceEvents.h
+++ b/Source/core/inspector/InspectorTraceEvents.h
@@ -6,6 +6,7 @@
 #define InspectorTraceEvents_h
 
 #include "platform/EventTracer.h"
+#include "platform/TraceEvent.h"
 #include "wtf/Forward.h"
 
 namespace WebCore {
@@ -22,6 +23,7 @@
 class ResourceRequest;
 class ResourceResponse;
 class ScriptSourceCode;
+class ScriptCallStack;
 class XMLHttpRequest;
 
 class InspectorLayoutEvent {
@@ -120,6 +122,16 @@
     static PassRefPtr<TraceEvent::ConvertableToTraceFormat> data(ExecutionContext*, int scriptId, const String& scriptName, int scriptLine);
 };
 
+class InspectorUpdateCountersEvent {
+public:
+    static PassRefPtr<TraceEvent::ConvertableToTraceFormat> data();
+};
+
+class InspectorCallStackEvent {
+public:
+    static PassRefPtr<TraceEvent::ConvertableToTraceFormat> currentCallStack();
+};
+
 } // namespace WebCore
 
 
diff --git a/Source/core/inspector/InspectorTracingAgent.cpp b/Source/core/inspector/InspectorTracingAgent.cpp
index cb81ec8..9e2ee3d 100644
--- a/Source/core/inspector/InspectorTracingAgent.cpp
+++ b/Source/core/inspector/InspectorTracingAgent.cpp
@@ -23,9 +23,10 @@
 const char devtoolsMetadataEventCategory[] = TRACE_DISABLED_BY_DEFAULT("devtools.timeline");
 }
 
-InspectorTracingAgent::InspectorTracingAgent()
+InspectorTracingAgent::InspectorTracingAgent(InspectorClient* client)
     : InspectorBaseAgent<InspectorTracingAgent>("Tracing")
     , m_layerTreeId(0)
+    , m_client(client)
 {
 }
 
@@ -34,17 +35,12 @@
     emitMetadataEvents();
 }
 
-void InspectorTracingAgent::start(ErrorString*, const String&, const String&, const double*, String* outSessionId)
+void InspectorTracingAgent::start(ErrorString*, const String& categoryFilter, const String&, const double*, String* outSessionId)
 {
-    innerStart();
-    *outSessionId = sessionId();
-}
-
-void InspectorTracingAgent::innerStart()
-{
-    String sessionId = IdentifiersFactory::createIdentifier();
-    m_state->setString(TracingAgentState::sessionId, sessionId);
+    m_state->setString(TracingAgentState::sessionId, IdentifiersFactory::createIdentifier());
+    m_client->enableTracing(categoryFilter);
     emitMetadataEvents();
+    *outSessionId = sessionId();
 }
 
 String InspectorTracingAgent::sessionId()
diff --git a/Source/core/inspector/InspectorTracingAgent.h b/Source/core/inspector/InspectorTracingAgent.h
index 937cb2a..3b33277 100644
--- a/Source/core/inspector/InspectorTracingAgent.h
+++ b/Source/core/inspector/InspectorTracingAgent.h
@@ -21,28 +21,28 @@
     , public InspectorBackendDispatcher::TracingCommandHandler {
     WTF_MAKE_NONCOPYABLE(InspectorTracingAgent);
 public:
-    static PassOwnPtr<InspectorTracingAgent> create()
+    static PassOwnPtr<InspectorTracingAgent> create(InspectorClient* client)
     {
-        return adoptPtr(new InspectorTracingAgent());
+        return adoptPtr(new InspectorTracingAgent(client));
     }
 
     // Base agent methods.
     virtual void restore() OVERRIDE;
 
     // Protocol method implementations.
-    virtual void start(ErrorString*, const String&, const String&, const double*, String* sessionId) OVERRIDE;
+    virtual void start(ErrorString*, const String& categoryFilter, const String&, const double*, String* sessionId) OVERRIDE;
 
     // Methods for other agents to use.
     void setLayerTreeId(int);
 
 private:
-    InspectorTracingAgent();
+    explicit InspectorTracingAgent(InspectorClient*);
 
-    void innerStart();
     void emitMetadataEvents();
     String sessionId();
 
     int m_layerTreeId;
+    InspectorClient* m_client;
 };
 
 }
diff --git a/Source/core/inspector/JavaScriptCallFrame.cpp b/Source/core/inspector/JavaScriptCallFrame.cpp
index c7d464e..1704ac8 100644
--- a/Source/core/inspector/JavaScriptCallFrame.cpp
+++ b/Source/core/inspector/JavaScriptCallFrame.cpp
@@ -156,9 +156,9 @@
 {
     v8::Handle<v8::Object> callFrame = m_callFrame.newLocal(m_isolate);
     v8::Handle<v8::Function> restartFunction = v8::Handle<v8::Function>::Cast(callFrame->Get(v8AtomicString(m_isolate, "restart")));
-    v8::Debug::SetLiveEditEnabled(true, m_isolate);
+    v8::Debug::SetLiveEditEnabled(m_isolate, true);
     v8::Handle<v8::Value> result = restartFunction->Call(callFrame, 0, 0);
-    v8::Debug::SetLiveEditEnabled(false, m_isolate);
+    v8::Debug::SetLiveEditEnabled(m_isolate, false);
     return result;
 }
 
diff --git a/Source/core/inspector/PageDebuggerAgent.cpp b/Source/core/inspector/PageDebuggerAgent.cpp
index 4140c74..e5b889a 100644
--- a/Source/core/inspector/PageDebuggerAgent.cpp
+++ b/Source/core/inspector/PageDebuggerAgent.cpp
@@ -128,7 +128,7 @@
     m_overlay->setPausedInDebuggerMessage(message);
 }
 
-void PageDebuggerAgent::didClearWindowObjectInMainWorld(LocalFrame* frame)
+void PageDebuggerAgent::didClearDocumentOfWindowObject(LocalFrame* frame)
 {
     if (frame != m_pageAgent->mainFrame())
         return;
diff --git a/Source/core/inspector/PageDebuggerAgent.h b/Source/core/inspector/PageDebuggerAgent.h
index d585493..97f2553 100644
--- a/Source/core/inspector/PageDebuggerAgent.h
+++ b/Source/core/inspector/PageDebuggerAgent.h
@@ -53,7 +53,7 @@
     static PassOwnPtr<PageDebuggerAgent> create(PageScriptDebugServer*, InspectorPageAgent*, InjectedScriptManager*, InspectorOverlay*);
     virtual ~PageDebuggerAgent();
 
-    void didClearWindowObjectInMainWorld(LocalFrame*);
+    void didClearDocumentOfWindowObject(LocalFrame*);
     String preprocessEventListener(LocalFrame*, const String& source, const String& url, const String& functionName);
     PassOwnPtr<ScriptSourceCode> preprocess(LocalFrame*, const ScriptSourceCode&);
     void didCommitLoad(LocalFrame*, DocumentLoader*);
diff --git a/Source/core/inspector/PageRuntimeAgent.cpp b/Source/core/inspector/PageRuntimeAgent.cpp
index 38eb78a..435cfb8 100644
--- a/Source/core/inspector/PageRuntimeAgent.cpp
+++ b/Source/core/inspector/PageRuntimeAgent.cpp
@@ -77,7 +77,7 @@
         reportExecutionContextCreation();
 }
 
-void PageRuntimeAgent::didClearWindowObjectInMainWorld(LocalFrame* frame)
+void PageRuntimeAgent::didClearDocumentOfWindowObject(LocalFrame* frame)
 {
     m_mainWorldContextCreated = true;
 
diff --git a/Source/core/inspector/PageRuntimeAgent.h b/Source/core/inspector/PageRuntimeAgent.h
index 388d0af..06d3a0f 100644
--- a/Source/core/inspector/PageRuntimeAgent.h
+++ b/Source/core/inspector/PageRuntimeAgent.h
@@ -51,7 +51,7 @@
     virtual void init() OVERRIDE;
     virtual void enable(ErrorString*) OVERRIDE;
 
-    void didClearWindowObjectInMainWorld(LocalFrame*);
+    void didClearDocumentOfWindowObject(LocalFrame*);
     void didCreateIsolatedContext(LocalFrame*, ScriptState*, SecurityOrigin*);
     void frameWindowDiscarded(DOMWindow*);
 
diff --git a/Source/core/inspector/WorkerInspectorController.cpp b/Source/core/inspector/WorkerInspectorController.cpp
index 9f0e9d8..c5aef2e 100644
--- a/Source/core/inspector/WorkerInspectorController.cpp
+++ b/Source/core/inspector/WorkerInspectorController.cpp
@@ -98,7 +98,7 @@
 {
     m_agents.append(WorkerRuntimeAgent::create(m_injectedScriptManager.get(), m_debugServer.get(), workerGlobalScope));
 
-    OwnPtr<InspectorTimelineAgent> timelineAgent = InspectorTimelineAgent::create(0, 0, 0, 0, InspectorTimelineAgent::WorkerInspector, 0);
+    OwnPtr<InspectorTimelineAgent> timelineAgent = InspectorTimelineAgent::create(0, 0, 0, InspectorTimelineAgent::WorkerInspector, 0);
     m_agents.append(WorkerDebuggerAgent::create(m_debugServer.get(), workerGlobalScope, m_injectedScriptManager.get()));
 
     m_agents.append(InspectorProfilerAgent::create(m_injectedScriptManager.get(), 0));
diff --git a/Source/core/inspector_instrumentation_sources.target.darwin-arm.mk b/Source/core/inspector_instrumentation_sources.target.darwin-arm.mk
index e8d30ee..3ff6a28 100644
--- a/Source/core/inspector_instrumentation_sources.target.darwin-arm.mk
+++ b/Source/core/inspector_instrumentation_sources.target.darwin-arm.mk
@@ -16,6 +16,7 @@
 
 ### Rules for action "generateInspectorInstrumentation":
 $(gyp_shared_intermediate_dir)/blink/InspectorCanvasInstrumentationInl.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/InspectorCanvasInstrumentationInl.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/InspectorCanvasInstrumentationInl.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InspectorCanvasInstrumentationInl.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InspectorCanvasInstrumentationInl.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/inspector_instrumentation_sources.target.darwin-arm64.mk b/Source/core/inspector_instrumentation_sources.target.darwin-arm64.mk
index e8d30ee..3ff6a28 100644
--- a/Source/core/inspector_instrumentation_sources.target.darwin-arm64.mk
+++ b/Source/core/inspector_instrumentation_sources.target.darwin-arm64.mk
@@ -16,6 +16,7 @@
 
 ### Rules for action "generateInspectorInstrumentation":
 $(gyp_shared_intermediate_dir)/blink/InspectorCanvasInstrumentationInl.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/InspectorCanvasInstrumentationInl.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/InspectorCanvasInstrumentationInl.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InspectorCanvasInstrumentationInl.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InspectorCanvasInstrumentationInl.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/inspector_instrumentation_sources.target.darwin-mips.mk b/Source/core/inspector_instrumentation_sources.target.darwin-mips.mk
index e8d30ee..3ff6a28 100644
--- a/Source/core/inspector_instrumentation_sources.target.darwin-mips.mk
+++ b/Source/core/inspector_instrumentation_sources.target.darwin-mips.mk
@@ -16,6 +16,7 @@
 
 ### Rules for action "generateInspectorInstrumentation":
 $(gyp_shared_intermediate_dir)/blink/InspectorCanvasInstrumentationInl.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/InspectorCanvasInstrumentationInl.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/InspectorCanvasInstrumentationInl.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InspectorCanvasInstrumentationInl.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InspectorCanvasInstrumentationInl.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/inspector_instrumentation_sources.target.darwin-x86.mk b/Source/core/inspector_instrumentation_sources.target.darwin-x86.mk
index e8d30ee..3ff6a28 100644
--- a/Source/core/inspector_instrumentation_sources.target.darwin-x86.mk
+++ b/Source/core/inspector_instrumentation_sources.target.darwin-x86.mk
@@ -16,6 +16,7 @@
 
 ### Rules for action "generateInspectorInstrumentation":
 $(gyp_shared_intermediate_dir)/blink/InspectorCanvasInstrumentationInl.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/InspectorCanvasInstrumentationInl.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/InspectorCanvasInstrumentationInl.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InspectorCanvasInstrumentationInl.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InspectorCanvasInstrumentationInl.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/inspector_instrumentation_sources.target.darwin-x86_64.mk b/Source/core/inspector_instrumentation_sources.target.darwin-x86_64.mk
index e8d30ee..3ff6a28 100644
--- a/Source/core/inspector_instrumentation_sources.target.darwin-x86_64.mk
+++ b/Source/core/inspector_instrumentation_sources.target.darwin-x86_64.mk
@@ -16,6 +16,7 @@
 
 ### Rules for action "generateInspectorInstrumentation":
 $(gyp_shared_intermediate_dir)/blink/InspectorCanvasInstrumentationInl.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/InspectorCanvasInstrumentationInl.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/InspectorCanvasInstrumentationInl.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InspectorCanvasInstrumentationInl.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InspectorCanvasInstrumentationInl.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/inspector_instrumentation_sources.target.linux-arm.mk b/Source/core/inspector_instrumentation_sources.target.linux-arm.mk
index e8d30ee..3ff6a28 100644
--- a/Source/core/inspector_instrumentation_sources.target.linux-arm.mk
+++ b/Source/core/inspector_instrumentation_sources.target.linux-arm.mk
@@ -16,6 +16,7 @@
 
 ### Rules for action "generateInspectorInstrumentation":
 $(gyp_shared_intermediate_dir)/blink/InspectorCanvasInstrumentationInl.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/InspectorCanvasInstrumentationInl.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/InspectorCanvasInstrumentationInl.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InspectorCanvasInstrumentationInl.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InspectorCanvasInstrumentationInl.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/inspector_instrumentation_sources.target.linux-arm64.mk b/Source/core/inspector_instrumentation_sources.target.linux-arm64.mk
index e8d30ee..3ff6a28 100644
--- a/Source/core/inspector_instrumentation_sources.target.linux-arm64.mk
+++ b/Source/core/inspector_instrumentation_sources.target.linux-arm64.mk
@@ -16,6 +16,7 @@
 
 ### Rules for action "generateInspectorInstrumentation":
 $(gyp_shared_intermediate_dir)/blink/InspectorCanvasInstrumentationInl.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/InspectorCanvasInstrumentationInl.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/InspectorCanvasInstrumentationInl.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InspectorCanvasInstrumentationInl.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InspectorCanvasInstrumentationInl.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/inspector_instrumentation_sources.target.linux-mips.mk b/Source/core/inspector_instrumentation_sources.target.linux-mips.mk
index e8d30ee..3ff6a28 100644
--- a/Source/core/inspector_instrumentation_sources.target.linux-mips.mk
+++ b/Source/core/inspector_instrumentation_sources.target.linux-mips.mk
@@ -16,6 +16,7 @@
 
 ### Rules for action "generateInspectorInstrumentation":
 $(gyp_shared_intermediate_dir)/blink/InspectorCanvasInstrumentationInl.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/InspectorCanvasInstrumentationInl.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/InspectorCanvasInstrumentationInl.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InspectorCanvasInstrumentationInl.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InspectorCanvasInstrumentationInl.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/inspector_instrumentation_sources.target.linux-x86.mk b/Source/core/inspector_instrumentation_sources.target.linux-x86.mk
index e8d30ee..3ff6a28 100644
--- a/Source/core/inspector_instrumentation_sources.target.linux-x86.mk
+++ b/Source/core/inspector_instrumentation_sources.target.linux-x86.mk
@@ -16,6 +16,7 @@
 
 ### Rules for action "generateInspectorInstrumentation":
 $(gyp_shared_intermediate_dir)/blink/InspectorCanvasInstrumentationInl.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/InspectorCanvasInstrumentationInl.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/InspectorCanvasInstrumentationInl.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InspectorCanvasInstrumentationInl.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InspectorCanvasInstrumentationInl.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/inspector_instrumentation_sources.target.linux-x86_64.mk b/Source/core/inspector_instrumentation_sources.target.linux-x86_64.mk
index e8d30ee..3ff6a28 100644
--- a/Source/core/inspector_instrumentation_sources.target.linux-x86_64.mk
+++ b/Source/core/inspector_instrumentation_sources.target.linux-x86_64.mk
@@ -16,6 +16,7 @@
 
 ### Rules for action "generateInspectorInstrumentation":
 $(gyp_shared_intermediate_dir)/blink/InspectorCanvasInstrumentationInl.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/InspectorCanvasInstrumentationInl.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/InspectorCanvasInstrumentationInl.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InspectorCanvasInstrumentationInl.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InspectorCanvasInstrumentationInl.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/inspector_overlay_page.target.darwin-arm.mk b/Source/core/inspector_overlay_page.target.darwin-arm.mk
index e423700..7884fb9 100644
--- a/Source/core/inspector_overlay_page.target.darwin-arm.mk
+++ b/Source/core/inspector_overlay_page.target.darwin-arm.mk
@@ -16,6 +16,7 @@
 
 ### Rules for action "ConvertFileToHeaderWithCharacterArray":
 $(gyp_shared_intermediate_dir)/blink/InspectorOverlayPage.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/InspectorOverlayPage.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/InspectorOverlayPage.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InspectorOverlayPage.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InspectorOverlayPage.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/inspector_overlay_page.target.darwin-arm64.mk b/Source/core/inspector_overlay_page.target.darwin-arm64.mk
index e423700..7884fb9 100644
--- a/Source/core/inspector_overlay_page.target.darwin-arm64.mk
+++ b/Source/core/inspector_overlay_page.target.darwin-arm64.mk
@@ -16,6 +16,7 @@
 
 ### Rules for action "ConvertFileToHeaderWithCharacterArray":
 $(gyp_shared_intermediate_dir)/blink/InspectorOverlayPage.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/InspectorOverlayPage.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/InspectorOverlayPage.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InspectorOverlayPage.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InspectorOverlayPage.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/inspector_overlay_page.target.darwin-mips.mk b/Source/core/inspector_overlay_page.target.darwin-mips.mk
index e423700..7884fb9 100644
--- a/Source/core/inspector_overlay_page.target.darwin-mips.mk
+++ b/Source/core/inspector_overlay_page.target.darwin-mips.mk
@@ -16,6 +16,7 @@
 
 ### Rules for action "ConvertFileToHeaderWithCharacterArray":
 $(gyp_shared_intermediate_dir)/blink/InspectorOverlayPage.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/InspectorOverlayPage.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/InspectorOverlayPage.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InspectorOverlayPage.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InspectorOverlayPage.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/inspector_overlay_page.target.darwin-x86.mk b/Source/core/inspector_overlay_page.target.darwin-x86.mk
index e423700..7884fb9 100644
--- a/Source/core/inspector_overlay_page.target.darwin-x86.mk
+++ b/Source/core/inspector_overlay_page.target.darwin-x86.mk
@@ -16,6 +16,7 @@
 
 ### Rules for action "ConvertFileToHeaderWithCharacterArray":
 $(gyp_shared_intermediate_dir)/blink/InspectorOverlayPage.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/InspectorOverlayPage.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/InspectorOverlayPage.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InspectorOverlayPage.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InspectorOverlayPage.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/inspector_overlay_page.target.darwin-x86_64.mk b/Source/core/inspector_overlay_page.target.darwin-x86_64.mk
index e423700..7884fb9 100644
--- a/Source/core/inspector_overlay_page.target.darwin-x86_64.mk
+++ b/Source/core/inspector_overlay_page.target.darwin-x86_64.mk
@@ -16,6 +16,7 @@
 
 ### Rules for action "ConvertFileToHeaderWithCharacterArray":
 $(gyp_shared_intermediate_dir)/blink/InspectorOverlayPage.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/InspectorOverlayPage.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/InspectorOverlayPage.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InspectorOverlayPage.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InspectorOverlayPage.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/inspector_overlay_page.target.linux-arm.mk b/Source/core/inspector_overlay_page.target.linux-arm.mk
index e423700..7884fb9 100644
--- a/Source/core/inspector_overlay_page.target.linux-arm.mk
+++ b/Source/core/inspector_overlay_page.target.linux-arm.mk
@@ -16,6 +16,7 @@
 
 ### Rules for action "ConvertFileToHeaderWithCharacterArray":
 $(gyp_shared_intermediate_dir)/blink/InspectorOverlayPage.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/InspectorOverlayPage.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/InspectorOverlayPage.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InspectorOverlayPage.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InspectorOverlayPage.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/inspector_overlay_page.target.linux-arm64.mk b/Source/core/inspector_overlay_page.target.linux-arm64.mk
index e423700..7884fb9 100644
--- a/Source/core/inspector_overlay_page.target.linux-arm64.mk
+++ b/Source/core/inspector_overlay_page.target.linux-arm64.mk
@@ -16,6 +16,7 @@
 
 ### Rules for action "ConvertFileToHeaderWithCharacterArray":
 $(gyp_shared_intermediate_dir)/blink/InspectorOverlayPage.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/InspectorOverlayPage.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/InspectorOverlayPage.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InspectorOverlayPage.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InspectorOverlayPage.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/inspector_overlay_page.target.linux-mips.mk b/Source/core/inspector_overlay_page.target.linux-mips.mk
index e423700..7884fb9 100644
--- a/Source/core/inspector_overlay_page.target.linux-mips.mk
+++ b/Source/core/inspector_overlay_page.target.linux-mips.mk
@@ -16,6 +16,7 @@
 
 ### Rules for action "ConvertFileToHeaderWithCharacterArray":
 $(gyp_shared_intermediate_dir)/blink/InspectorOverlayPage.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/InspectorOverlayPage.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/InspectorOverlayPage.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InspectorOverlayPage.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InspectorOverlayPage.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/inspector_overlay_page.target.linux-x86.mk b/Source/core/inspector_overlay_page.target.linux-x86.mk
index e423700..7884fb9 100644
--- a/Source/core/inspector_overlay_page.target.linux-x86.mk
+++ b/Source/core/inspector_overlay_page.target.linux-x86.mk
@@ -16,6 +16,7 @@
 
 ### Rules for action "ConvertFileToHeaderWithCharacterArray":
 $(gyp_shared_intermediate_dir)/blink/InspectorOverlayPage.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/InspectorOverlayPage.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/InspectorOverlayPage.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InspectorOverlayPage.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InspectorOverlayPage.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/inspector_overlay_page.target.linux-x86_64.mk b/Source/core/inspector_overlay_page.target.linux-x86_64.mk
index e423700..7884fb9 100644
--- a/Source/core/inspector_overlay_page.target.linux-x86_64.mk
+++ b/Source/core/inspector_overlay_page.target.linux-x86_64.mk
@@ -16,6 +16,7 @@
 
 ### Rules for action "ConvertFileToHeaderWithCharacterArray":
 $(gyp_shared_intermediate_dir)/blink/InspectorOverlayPage.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/InspectorOverlayPage.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/InspectorOverlayPage.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InspectorOverlayPage.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InspectorOverlayPage.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/inspector_protocol_sources.target.darwin-arm.mk b/Source/core/inspector_protocol_sources.target.darwin-arm.mk
index 210529a..f5ba29c 100644
--- a/Source/core/inspector_protocol_sources.target.darwin-arm.mk
+++ b/Source/core/inspector_protocol_sources.target.darwin-arm.mk
@@ -17,6 +17,7 @@
 
 ### Rules for action "generateInspectorProtocolBackendSources":
 $(gyp_shared_intermediate_dir)/blink/InspectorBackendDispatcher.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/InspectorBackendDispatcher.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/InspectorBackendDispatcher.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InspectorBackendDispatcher.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InspectorBackendDispatcher.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/inspector_protocol_sources.target.darwin-arm64.mk b/Source/core/inspector_protocol_sources.target.darwin-arm64.mk
index 210529a..f5ba29c 100644
--- a/Source/core/inspector_protocol_sources.target.darwin-arm64.mk
+++ b/Source/core/inspector_protocol_sources.target.darwin-arm64.mk
@@ -17,6 +17,7 @@
 
 ### Rules for action "generateInspectorProtocolBackendSources":
 $(gyp_shared_intermediate_dir)/blink/InspectorBackendDispatcher.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/InspectorBackendDispatcher.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/InspectorBackendDispatcher.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InspectorBackendDispatcher.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InspectorBackendDispatcher.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/inspector_protocol_sources.target.darwin-mips.mk b/Source/core/inspector_protocol_sources.target.darwin-mips.mk
index 210529a..f5ba29c 100644
--- a/Source/core/inspector_protocol_sources.target.darwin-mips.mk
+++ b/Source/core/inspector_protocol_sources.target.darwin-mips.mk
@@ -17,6 +17,7 @@
 
 ### Rules for action "generateInspectorProtocolBackendSources":
 $(gyp_shared_intermediate_dir)/blink/InspectorBackendDispatcher.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/InspectorBackendDispatcher.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/InspectorBackendDispatcher.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InspectorBackendDispatcher.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InspectorBackendDispatcher.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/inspector_protocol_sources.target.darwin-x86.mk b/Source/core/inspector_protocol_sources.target.darwin-x86.mk
index 210529a..f5ba29c 100644
--- a/Source/core/inspector_protocol_sources.target.darwin-x86.mk
+++ b/Source/core/inspector_protocol_sources.target.darwin-x86.mk
@@ -17,6 +17,7 @@
 
 ### Rules for action "generateInspectorProtocolBackendSources":
 $(gyp_shared_intermediate_dir)/blink/InspectorBackendDispatcher.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/InspectorBackendDispatcher.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/InspectorBackendDispatcher.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InspectorBackendDispatcher.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InspectorBackendDispatcher.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/inspector_protocol_sources.target.darwin-x86_64.mk b/Source/core/inspector_protocol_sources.target.darwin-x86_64.mk
index 210529a..f5ba29c 100644
--- a/Source/core/inspector_protocol_sources.target.darwin-x86_64.mk
+++ b/Source/core/inspector_protocol_sources.target.darwin-x86_64.mk
@@ -17,6 +17,7 @@
 
 ### Rules for action "generateInspectorProtocolBackendSources":
 $(gyp_shared_intermediate_dir)/blink/InspectorBackendDispatcher.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/InspectorBackendDispatcher.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/InspectorBackendDispatcher.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InspectorBackendDispatcher.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InspectorBackendDispatcher.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/inspector_protocol_sources.target.linux-arm.mk b/Source/core/inspector_protocol_sources.target.linux-arm.mk
index 210529a..f5ba29c 100644
--- a/Source/core/inspector_protocol_sources.target.linux-arm.mk
+++ b/Source/core/inspector_protocol_sources.target.linux-arm.mk
@@ -17,6 +17,7 @@
 
 ### Rules for action "generateInspectorProtocolBackendSources":
 $(gyp_shared_intermediate_dir)/blink/InspectorBackendDispatcher.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/InspectorBackendDispatcher.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/InspectorBackendDispatcher.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InspectorBackendDispatcher.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InspectorBackendDispatcher.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/inspector_protocol_sources.target.linux-arm64.mk b/Source/core/inspector_protocol_sources.target.linux-arm64.mk
index 210529a..f5ba29c 100644
--- a/Source/core/inspector_protocol_sources.target.linux-arm64.mk
+++ b/Source/core/inspector_protocol_sources.target.linux-arm64.mk
@@ -17,6 +17,7 @@
 
 ### Rules for action "generateInspectorProtocolBackendSources":
 $(gyp_shared_intermediate_dir)/blink/InspectorBackendDispatcher.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/InspectorBackendDispatcher.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/InspectorBackendDispatcher.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InspectorBackendDispatcher.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InspectorBackendDispatcher.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/inspector_protocol_sources.target.linux-mips.mk b/Source/core/inspector_protocol_sources.target.linux-mips.mk
index 210529a..f5ba29c 100644
--- a/Source/core/inspector_protocol_sources.target.linux-mips.mk
+++ b/Source/core/inspector_protocol_sources.target.linux-mips.mk
@@ -17,6 +17,7 @@
 
 ### Rules for action "generateInspectorProtocolBackendSources":
 $(gyp_shared_intermediate_dir)/blink/InspectorBackendDispatcher.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/InspectorBackendDispatcher.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/InspectorBackendDispatcher.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InspectorBackendDispatcher.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InspectorBackendDispatcher.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/inspector_protocol_sources.target.linux-x86.mk b/Source/core/inspector_protocol_sources.target.linux-x86.mk
index 210529a..f5ba29c 100644
--- a/Source/core/inspector_protocol_sources.target.linux-x86.mk
+++ b/Source/core/inspector_protocol_sources.target.linux-x86.mk
@@ -17,6 +17,7 @@
 
 ### Rules for action "generateInspectorProtocolBackendSources":
 $(gyp_shared_intermediate_dir)/blink/InspectorBackendDispatcher.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/InspectorBackendDispatcher.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/InspectorBackendDispatcher.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InspectorBackendDispatcher.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InspectorBackendDispatcher.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/inspector_protocol_sources.target.linux-x86_64.mk b/Source/core/inspector_protocol_sources.target.linux-x86_64.mk
index 210529a..f5ba29c 100644
--- a/Source/core/inspector_protocol_sources.target.linux-x86_64.mk
+++ b/Source/core/inspector_protocol_sources.target.linux-x86_64.mk
@@ -17,6 +17,7 @@
 
 ### Rules for action "generateInspectorProtocolBackendSources":
 $(gyp_shared_intermediate_dir)/blink/InspectorBackendDispatcher.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/InspectorBackendDispatcher.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/InspectorBackendDispatcher.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InspectorBackendDispatcher.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InspectorBackendDispatcher.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/loader/DocumentLoader.h b/Source/core/loader/DocumentLoader.h
index 5822954..713d3d1 100644
--- a/Source/core/loader/DocumentLoader.h
+++ b/Source/core/loader/DocumentLoader.h
@@ -177,7 +177,7 @@
         bool shouldContinueForResponse() const;
 
         LocalFrame* m_frame;
-        RefPtr<ResourceFetcher> m_fetcher;
+        RefPtrWillBePersistent<ResourceFetcher> m_fetcher;
 
         ResourcePtr<RawResource> m_mainResource;
 
diff --git a/Source/core/loader/DocumentThreadableLoader.h b/Source/core/loader/DocumentThreadableLoader.h
index abadac9..2168407 100644
--- a/Source/core/loader/DocumentThreadableLoader.h
+++ b/Source/core/loader/DocumentThreadableLoader.h
@@ -41,7 +41,6 @@
 #include "wtf/Forward.h"
 #include "wtf/OwnPtr.h"
 #include "wtf/PassRefPtr.h"
-#include "wtf/RefCounted.h"
 #include "wtf/text/WTFString.h"
 
 namespace WebCore {
@@ -52,7 +51,7 @@
 class SecurityOrigin;
 class ThreadableLoaderClient;
 
-class DocumentThreadableLoader FINAL : public RefCounted<DocumentThreadableLoader>, public ThreadableLoader, private ResourceOwner<RawResource>  {
+class DocumentThreadableLoader FINAL : public ThreadableLoader, private ResourceOwner<RawResource>  {
     WTF_MAKE_FAST_ALLOCATED;
     public:
         static void loadResourceSynchronously(Document&, const ResourceRequest&, ThreadableLoaderClient&, const ThreadableLoaderOptions&);
@@ -62,13 +61,6 @@
         virtual void cancel() OVERRIDE;
         void setDefersLoading(bool);
 
-        using RefCounted<DocumentThreadableLoader>::ref;
-        using RefCounted<DocumentThreadableLoader>::deref;
-
-    protected:
-        virtual void refThreadableLoader() OVERRIDE { ref(); }
-        virtual void derefThreadableLoader() OVERRIDE { deref(); }
-
     private:
         enum BlockingBehavior {
             LoadSynchronously,
diff --git a/Source/core/loader/EmptyClients.h b/Source/core/loader/EmptyClients.h
index b21b0b8..22cf77f 100644
--- a/Source/core/loader/EmptyClients.h
+++ b/Source/core/loader/EmptyClients.h
@@ -239,7 +239,7 @@
 
     virtual ObjectContentType objectContentType(const KURL&, const String&, bool) OVERRIDE { return ObjectContentType(); }
 
-    virtual void dispatchDidClearWindowObjectInWorld(DOMWrapperWorld&) OVERRIDE { }
+    virtual void dispatchDidClearWindowObjectInMainWorld() OVERRIDE { }
     virtual void documentElementAvailable() OVERRIDE { }
 
     virtual void didCreateScriptContext(v8::Handle<v8::Context>, int extensionGroup, int worldId) OVERRIDE { }
diff --git a/Source/core/loader/FrameFetchContext.cpp b/Source/core/loader/FrameFetchContext.cpp
index 2761524..e0fc315 100644
--- a/Source/core/loader/FrameFetchContext.cpp
+++ b/Source/core/loader/FrameFetchContext.cpp
@@ -151,6 +151,7 @@
     m_frame->loader().applyUserAgent(request);
     m_frame->loader().client()->dispatchWillSendRequest(loader, identifier, request, redirectResponse);
     TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "ResourceSendRequest", "data", InspectorSendRequestEvent::data(identifier, m_frame, request));
+    TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline.stack"), "CallStack", "stack", InspectorCallStackEvent::currentCallStack());
     // FIXME(361045): remove InspectorInstrumentation calls once DevTools Timeline migrates to tracing.
     InspectorInstrumentation::willSendRequest(m_frame, identifier, ensureLoader(loader), request, redirectResponse, initiatorInfo);
 }
diff --git a/Source/core/loader/FrameLoader.cpp b/Source/core/loader/FrameLoader.cpp
index 770c73a..d602d08 100644
--- a/Source/core/loader/FrameLoader.cpp
+++ b/Source/core/loader/FrameLoader.cpp
@@ -41,6 +41,7 @@
 #include "bindings/v8/SerializedScriptValue.h"
 #include "core/dom/Document.h"
 #include "core/dom/Element.h"
+#include "core/dom/ViewportDescription.h"
 #include "core/editing/Editor.h"
 #include "core/editing/UndoStack.h"
 #include "core/events/Event.h"
@@ -257,10 +258,15 @@
 {
     if (m_provisionalItem)
         m_currentItem = m_provisionalItem.release();
-    if (!m_currentItem || historyCommitType == StandardCommit)
+
+    if (!m_currentItem || historyCommitType == StandardCommit) {
         m_currentItem = HistoryItem::create();
-    else if (!isPushOrReplaceState && m_documentLoader->url() != m_currentItem->url())
-        m_currentItem->generateNewSequenceNumbers();
+    } else if (!isPushOrReplaceState && m_documentLoader->url() != m_currentItem->url()) {
+        m_currentItem->generateNewItemSequenceNumber();
+        if (!equalIgnoringFragmentIdentifier(m_documentLoader->url(), m_currentItem->url()))
+            m_currentItem->generateNewDocumentSequenceNumber();
+    }
+
     m_currentItem->setURL(m_documentLoader->urlForHistory());
     m_currentItem->setDocumentState(m_frame->document()->formElementsState());
     m_currentItem->setTarget(m_frame->tree().uniqueName());
@@ -301,7 +307,7 @@
 
     InspectorInstrumentation::didCommitLoad(m_frame, m_documentLoader.get());
     m_frame->page()->didCommitLoad(m_frame);
-    dispatchDidClearWindowObjectsInAllWorlds();
+    dispatchDidClearDocumentOfWindowObject();
 }
 
 static void didFailContentSecurityPolicyCheck(FrameLoader* loader)
@@ -329,7 +335,7 @@
         m_frame->domWindow()->statePopped(m_provisionalItem->stateObject());
 
     if (dispatch)
-        dispatchDidClearWindowObjectsInAllWorlds();
+        dispatchDidClearDocumentOfWindowObject();
 
     m_frame->document()->initContentSecurityPolicy(m_documentLoader ? ContentSecurityPolicyResponseHeaders(m_documentLoader->response()) : ContentSecurityPolicyResponseHeaders());
 
@@ -621,7 +627,7 @@
 
 FrameLoadType FrameLoader::determineFrameLoadType(const FrameLoadRequest& request)
 {
-    if (m_frame->tree().parent() && !m_stateMachine.startedFirstRealLoad())
+    if (m_frame->tree().parent() && !m_stateMachine.committedFirstRealDocumentLoad())
         return FrameLoadTypeInitialInChildFrame;
     if (!m_frame->tree().parent() && !m_frame->page()->backForward().backForwardListCount())
         return FrameLoadTypeStandard;
@@ -959,10 +965,15 @@
     m_frame->domWindow()->finishedLoading();
 
     const ResourceError& error = m_documentLoader->mainDocumentError();
-    if (!error.isNull())
+    if (!error.isNull()) {
         m_client->dispatchDidFailLoad(error);
-    else
+    } else {
+        // Report mobile vs. desktop page statistics. This will only report on Android.
+        if (m_frame->isMainFrame())
+            m_frame->document()->viewportDescription().reportMobilePageStats(m_frame);
+
         m_client->dispatchDidFinishLoad();
+    }
     m_loadType = FrameLoadTypeStandard;
     return true;
 }
@@ -1086,10 +1097,15 @@
     // back to FrameLoaderClient via V8WindowShell.
     m_frame->script().clearForClose();
 
-    // After this, we must no longer talk to the client since this clears
-    // its owning reference back to our owning LocalFrame.
-    m_client->detachedFromParent();
-    m_client = 0;
+    // m_client should never be null because that means we somehow re-entered
+    // the frame detach code... but it is sometimes.
+    // FIXME: Understand why this is happening so we can document this insanity.
+    if (m_client) {
+        // After this, we must no longer talk to the client since this clears
+        // its owning reference back to our owning LocalFrame.
+        m_client->detachedFromParent();
+        m_client = 0;
+    }
 }
 
 void FrameLoader::addHTTPOriginIfNeeded(ResourceRequest& request, const AtomicString& origin)
@@ -1211,9 +1227,6 @@
 
     const ResourceRequest& request = action.resourceRequest();
 
-    if (!m_stateMachine.startedFirstRealLoad())
-        m_stateMachine.advanceTo(FrameLoaderStateMachine::StartedFirstRealLoad);
-
     // The current load should replace the history item if it is the first real
     // load of the frame.
     bool replacesCurrentHistoryItem = false;
@@ -1364,27 +1377,28 @@
     m_client->documentElementAvailable();
 }
 
-void FrameLoader::dispatchDidClearWindowObjectsInAllWorlds()
+void FrameLoader::dispatchDidClearDocumentOfWindowObject()
 {
     if (!m_frame->script().canExecuteScripts(NotAboutToExecuteScript))
         return;
 
     if (Page* page = m_frame->page())
-        page->inspectorController().didClearWindowObjectInMainWorld(m_frame);
-    InspectorInstrumentation::didClearWindowObjectInMainWorld(m_frame);
+        page->inspectorController().didClearDocumentOfWindowObject(m_frame);
+    InspectorInstrumentation::didClearDocumentOfWindowObject(m_frame);
 
-    Vector<RefPtr<DOMWrapperWorld> > worlds;
-    DOMWrapperWorld::allWorldsInMainThread(worlds);
-    for (size_t i = 0; i < worlds.size(); ++i)
-        m_client->dispatchDidClearWindowObjectInWorld(*worlds[i]);
+    // We just cleared the document, not the entire window object, but for the
+    // embedder that's close enough.
+    m_client->dispatchDidClearWindowObjectInMainWorld();
 }
 
-void FrameLoader::dispatchDidClearWindowObjectInWorld(DOMWrapperWorld& world)
+void FrameLoader::dispatchDidClearWindowObjectInMainWorld()
 {
-    if (!m_frame->script().canExecuteScripts(NotAboutToExecuteScript) || !m_frame->script().existingWindowShell(world))
+    if (!m_frame->script().canExecuteScripts(NotAboutToExecuteScript))
         return;
 
-    m_client->dispatchDidClearWindowObjectInWorld(world);
+    // FIXME: Why isn't the inspector notified of this?
+
+    m_client->dispatchDidClearWindowObjectInMainWorld();
 }
 
 SandboxFlags FrameLoader::effectiveSandboxFlags() const
diff --git a/Source/core/loader/FrameLoader.h b/Source/core/loader/FrameLoader.h
index d51ef68..04c3487 100644
--- a/Source/core/loader/FrameLoader.h
+++ b/Source/core/loader/FrameLoader.h
@@ -146,8 +146,8 @@
 
     String userAgent(const KURL&) const;
 
-    void dispatchDidClearWindowObjectInWorld(DOMWrapperWorld&);
-    void dispatchDidClearWindowObjectsInAllWorlds();
+    void dispatchDidClearWindowObjectInMainWorld();
+    void dispatchDidClearDocumentOfWindowObject();
     void dispatchDocumentElementAvailable();
 
     // The following sandbox flags will be forced, regardless of changes to
diff --git a/Source/core/loader/FrameLoaderClient.h b/Source/core/loader/FrameLoaderClient.h
index 9ddf80a..2372927 100644
--- a/Source/core/loader/FrameLoaderClient.h
+++ b/Source/core/loader/FrameLoaderClient.h
@@ -172,7 +172,7 @@
 
         virtual ObjectContentType objectContentType(const KURL&, const String& mimeType, bool shouldPreferPlugInsForImages) = 0;
 
-        virtual void dispatchDidClearWindowObjectInWorld(DOMWrapperWorld&) = 0;
+        virtual void dispatchDidClearWindowObjectInMainWorld() = 0;
         virtual void documentElementAvailable() = 0;
 
         virtual void didCreateScriptContext(v8::Handle<v8::Context>, int extensionGroup, int worldId) = 0;
@@ -229,6 +229,8 @@
 
         virtual void didStopAllLoaders() { }
 
+        virtual void dispatchDidChangeManifest() { }
+
         virtual bool isFrameLoaderClientImpl() const { return false; }
     };
 
diff --git a/Source/core/loader/FrameLoaderStateMachine.cpp b/Source/core/loader/FrameLoaderStateMachine.cpp
index 61db0ef..ebad28b 100644
--- a/Source/core/loader/FrameLoaderStateMachine.cpp
+++ b/Source/core/loader/FrameLoaderStateMachine.cpp
@@ -39,11 +39,6 @@
 {
 }
 
-bool FrameLoaderStateMachine::startedFirstRealLoad() const
-{
-    return m_state >= StartedFirstRealLoad;
-}
-
 bool FrameLoaderStateMachine::committedFirstRealDocumentLoad() const
 {
     return m_state >= CommittedFirstRealLoad;
diff --git a/Source/core/loader/FrameLoaderStateMachine.h b/Source/core/loader/FrameLoaderStateMachine.h
index aa349a5..ee249fe 100644
--- a/Source/core/loader/FrameLoaderStateMachine.h
+++ b/Source/core/loader/FrameLoaderStateMachine.h
@@ -46,12 +46,10 @@
     enum State {
         CreatingInitialEmptyDocument,
         DisplayingInitialEmptyDocument,
-        StartedFirstRealLoad,
         CommittedFirstRealLoad,
         CommittedMultipleRealLoads
     };
 
-    bool startedFirstRealLoad() const;
     bool committedFirstRealDocumentLoad() const;
     bool creatingInitialEmptyDocument() const;
     bool isDisplayingInitialEmptyDocument() const;
diff --git a/Source/core/loader/HistoryItem.cpp b/Source/core/loader/HistoryItem.cpp
index e8e09d1..11a0e2b 100644
--- a/Source/core/loader/HistoryItem.cpp
+++ b/Source/core/loader/HistoryItem.cpp
@@ -53,9 +53,13 @@
 {
 }
 
-void HistoryItem::generateNewSequenceNumbers()
+void HistoryItem::generateNewItemSequenceNumber()
 {
     m_itemSequenceNumber = generateSequenceNumber();
+}
+
+void HistoryItem::generateNewDocumentSequenceNumber()
+{
     m_documentSequenceNumber = generateSequenceNumber();
 }
 
@@ -160,21 +164,6 @@
     m_stateObject = object;
 }
 
-void HistoryItem::deprecatedAddChildItem(PassRefPtr<HistoryItem> child)
-{
-    m_children.append(child);
-}
-
-const HistoryItemVector& HistoryItem::deprecatedChildren() const
-{
-    return m_children;
-}
-
-void HistoryItem::deprecatedClearChildren()
-{
-    m_children.clear();
-}
-
 const AtomicString& HistoryItem::formContentType() const
 {
     return m_formContentType;
diff --git a/Source/core/loader/HistoryItem.h b/Source/core/loader/HistoryItem.h
index ad4b8a3..7a8733e 100644
--- a/Source/core/loader/HistoryItem.h
+++ b/Source/core/loader/HistoryItem.h
@@ -52,7 +52,8 @@
 
     // Used when the frame this item represents was navigated to a different
     // url but a new item wasn't created.
-    void generateNewSequenceNumbers();
+    void generateNewItemSequenceNumber();
+    void generateNewDocumentSequenceNumber();
 
     const String& urlString() const;
     KURL url() const;
@@ -94,13 +95,6 @@
     void setFormData(PassRefPtr<FormData>);
     void setFormContentType(const AtomicString&);
 
-    // HistoryItem's concept of children is deprecated and can be removed once chromium's
-    // HistoryItem serialization/deserialization code knows about HistoryController's
-    // representation of the histroy tree.
-    void deprecatedAddChildItem(PassRefPtr<HistoryItem>);
-    const HistoryItemVector& deprecatedChildren() const;
-    void deprecatedClearChildren();
-
     bool isCurrentDocument(Document*) const;
 
 private:
@@ -113,9 +107,7 @@
     IntPoint m_scrollPoint;
     float m_pageScaleFactor;
     Vector<String> m_documentStateVector;
-    RefPtr<DocumentState> m_documentState;
-
-    HistoryItemVector m_children;
+    RefPtrWillBePersistent<DocumentState> m_documentState;
 
     // If two HistoryItems have the same item sequence number, then they are
     // clones of one another. Traversing history from one such HistoryItem to
diff --git a/Source/core/loader/ImageLoader.h b/Source/core/loader/ImageLoader.h
index 3a0e672..2476d79 100644
--- a/Source/core/loader/ImageLoader.h
+++ b/Source/core/loader/ImageLoader.h
@@ -39,7 +39,7 @@
     // Determines whether the observed ImageResource should have higher priority in the decoded resources cache.
     virtual bool requestsHighLiveResourceCachePriority() { return false; }
 
-    virtual void trace(Visitor*) = 0;
+    virtual void trace(Visitor*) { }
 
 protected:
     ImageLoaderClient() { }
diff --git a/Source/core/loader/NavigationPolicy.h b/Source/core/loader/NavigationPolicy.h
index 63af6aa..7e44862 100644
--- a/Source/core/loader/NavigationPolicy.h
+++ b/Source/core/loader/NavigationPolicy.h
@@ -36,6 +36,7 @@
 enum NavigationPolicy {
     NavigationPolicyIgnore,
     NavigationPolicyDownload,
+    NavigationPolicyDownloadTo,
     NavigationPolicyCurrentTab,
     NavigationPolicyNewBackgroundTab,
     NavigationPolicyNewForegroundTab,
diff --git a/Source/core/loader/PingLoader.cpp b/Source/core/loader/PingLoader.cpp
index 26894a1..82cb0a8 100644
--- a/Source/core/loader/PingLoader.cpp
+++ b/Source/core/loader/PingLoader.cpp
@@ -139,6 +139,7 @@
     m_loader->loadAsynchronously(wrappedRequest, this);
 
     TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "ResourceSendRequest", "data", InspectorSendRequestEvent::data(m_identifier, frame, request));
+    TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline.stack"), "CallStack", "stack", InspectorCallStackEvent::currentCallStack());
     // FIXME(361045): remove InspectorInstrumentation calls once DevTools Timeline migrates to tracing.
     InspectorInstrumentation::willSendRequest(frame, m_identifier, frame->loader().documentLoader(), request, ResourceResponse(), initiatorInfo);
 
diff --git a/Source/core/loader/ThreadableLoader.h b/Source/core/loader/ThreadableLoader.h
index 4f88e1e..f562551 100644
--- a/Source/core/loader/ThreadableLoader.h
+++ b/Source/core/loader/ThreadableLoader.h
@@ -34,6 +34,7 @@
 #include "core/fetch/ResourceLoaderOptions.h"
 #include "wtf/Noncopyable.h"
 #include "wtf/PassRefPtr.h"
+#include "wtf/RefCounted.h"
 #include "wtf/RefPtr.h"
 
 namespace WebCore {
@@ -77,21 +78,18 @@
 
     // Useful for doing loader operations from any thread (not threadsafe,
     // just able to run on threads other than the main thread).
-    class ThreadableLoader {
+    class ThreadableLoader : public RefCounted<ThreadableLoader> {
         WTF_MAKE_NONCOPYABLE(ThreadableLoader);
     public:
         static void loadResourceSynchronously(ExecutionContext&, const ResourceRequest&, ThreadableLoaderClient&, const ThreadableLoaderOptions&);
         static PassRefPtr<ThreadableLoader> create(ExecutionContext&, ThreadableLoaderClient*, const ResourceRequest&, const ThreadableLoaderOptions&);
 
         virtual void cancel() = 0;
-        void ref() { refThreadableLoader(); }
-        void deref() { derefThreadableLoader(); }
+
+        virtual ~ThreadableLoader() { }
 
     protected:
         ThreadableLoader() { }
-        virtual ~ThreadableLoader() { }
-        virtual void refThreadableLoader() = 0;
-        virtual void derefThreadableLoader() = 0;
     };
 
 } // namespace WebCore
diff --git a/Source/core/loader/WorkerThreadableLoader.h b/Source/core/loader/WorkerThreadableLoader.h
index 8a9ba9c..847d826 100644
--- a/Source/core/loader/WorkerThreadableLoader.h
+++ b/Source/core/loader/WorkerThreadableLoader.h
@@ -37,7 +37,6 @@
 #include "platform/heap/Handle.h"
 #include "wtf/PassOwnPtr.h"
 #include "wtf/PassRefPtr.h"
-#include "wtf/RefCounted.h"
 #include "wtf/RefPtr.h"
 #include "wtf/Threading.h"
 #include "wtf/text/WTFString.h"
@@ -51,7 +50,7 @@
     struct CrossThreadResourceResponseData;
     struct CrossThreadResourceRequestData;
 
-    class WorkerThreadableLoader FINAL : public RefCounted<WorkerThreadableLoader>, public ThreadableLoader {
+    class WorkerThreadableLoader FINAL : public ThreadableLoader {
         WTF_MAKE_FAST_ALLOCATED;
     public:
         static void loadResourceSynchronously(WorkerGlobalScope&, const ResourceRequest&, ThreadableLoaderClient&, const ThreadableLoaderOptions&);
@@ -66,13 +65,6 @@
 
         bool done() const { return m_workerClientWrapper->done(); }
 
-        using RefCounted<WorkerThreadableLoader>::ref;
-        using RefCounted<WorkerThreadableLoader>::deref;
-
-    protected:
-        virtual void refThreadableLoader() OVERRIDE { ref(); }
-        virtual void derefThreadableLoader() OVERRIDE { deref(); }
-
     private:
         // Creates a loader on the main thread and bridges communication between
         // the main thread and the worker context's thread where WorkerThreadableLoader runs.
diff --git a/Source/core/make_core_generated.target.darwin-arm.mk b/Source/core/make_core_generated.target.darwin-arm.mk
index d37313d..24b552f 100644
--- a/Source/core/make_core_generated.target.darwin-arm.mk
+++ b/Source/core/make_core_generated.target.darwin-arm.mk
@@ -19,6 +19,7 @@
 
 ### Rules for action "generateXMLViewerCSS":
 $(gyp_shared_intermediate_dir)/blink/XMLViewerCSS.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/XMLViewerCSS.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/XMLViewerCSS.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XMLViewerCSS.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XMLViewerCSS.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -29,6 +30,7 @@
 
 ### Rules for action "generateXMLViewerJS":
 $(gyp_shared_intermediate_dir)/blink/XMLViewerJS.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/XMLViewerJS.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/XMLViewerJS.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XMLViewerJS.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XMLViewerJS.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -39,6 +41,7 @@
 
 ### Rules for action "HTMLEntityTable":
 $(gyp_shared_intermediate_dir)/blink/HTMLEntityTable.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/HTMLEntityTable.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/HTMLEntityTable.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLEntityTable.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLEntityTable.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -49,59 +52,65 @@
 
 ### Rules for action "CSSPropertyNames":
 $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/hasher.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_css_property_names.py $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSPropertyNames.in $(LOCAL_PATH)/third_party/WebKit/Source/core/css/SVGCSSPropertyNames.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_CSSPropertyNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_css_property_names.py css/CSSPropertyNames.in css/SVGCSSPropertyNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --gperf gperf --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_css_property_names.py css/CSSPropertyNames.in css/SVGCSSPropertyNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --gperf gperf --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_MEDIA_CAPTURE=1\" \"WTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1\" \"ENABLE_WEB_AUDIO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.h: $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp ;
 
 ### Rules for action "MediaFeatureNames":
 $(gyp_shared_intermediate_dir)/blink/MediaFeatureNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/MediaFeatureNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/MediaFeatureNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MediaFeatureNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MediaFeatureNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/MediaFeatureNames.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/hasher.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_names.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeNames.cpp.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeNames.h.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_media_feature_names.py $(LOCAL_PATH)/third_party/WebKit/Source/core/css/MediaFeatureNames.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_MediaFeatureNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_media_feature_names.py css/MediaFeatureNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_media_feature_names.py css/MediaFeatureNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_MEDIA_CAPTURE=1\" \"WTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1\" \"ENABLE_WEB_AUDIO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/MediaFeatureNames.h: $(gyp_shared_intermediate_dir)/blink/MediaFeatureNames.cpp ;
 
 ### Rules for action "MediaFeatures":
 $(gyp_shared_intermediate_dir)/blink/MediaFeatures.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/MediaFeatures.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/MediaFeatures.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MediaFeatures.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MediaFeatures.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/MediaFeatures.h: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/hasher.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_media_features.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MediaFeatures.h.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/MediaFeatureNames.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_MediaFeatures ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_media_features.py css/MediaFeatureNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_media_features.py css/MediaFeatureNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_MEDIA_CAPTURE=1\" \"WTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1\" \"ENABLE_WEB_AUDIO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 
 ### Rules for action "MediaTypeNames":
 $(gyp_shared_intermediate_dir)/blink/MediaTypeNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/MediaTypeNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/MediaTypeNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MediaTypeNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MediaTypeNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/MediaTypeNames.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/hasher.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_names.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeNames.cpp.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeNames.h.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/MediaTypeNames.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_MediaTypeNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_names.py css/MediaTypeNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_names.py css/MediaTypeNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_MEDIA_CAPTURE=1\" \"WTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1\" \"ENABLE_WEB_AUDIO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/MediaTypeNames.h: $(gyp_shared_intermediate_dir)/blink/MediaTypeNames.cpp ;
 
 ### Rules for action "MediaQueryTokenizerCodepoints":
 $(gyp_shared_intermediate_dir)/blink/MediaQueryTokenizerCodepoints.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/MediaQueryTokenizerCodepoints.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/MediaQueryTokenizerCodepoints.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MediaQueryTokenizerCodepoints.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MediaQueryTokenizerCodepoints.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/MediaQueryTokenizerCodepoints.cpp: $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_mediaquery_tokenizer_codepoints.py $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_MediaQueryTokenizerCodepoints ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_mediaquery_tokenizer_codepoints.py --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_mediaquery_tokenizer_codepoints.py --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_MEDIA_CAPTURE=1\" \"WTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1\" \"ENABLE_WEB_AUDIO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 
 ### Rules for action "StylePropertyShorthand":
 $(gyp_shared_intermediate_dir)/blink/StylePropertyShorthand.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/StylePropertyShorthand.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/StylePropertyShorthand.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/StylePropertyShorthand.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/StylePropertyShorthand.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -113,6 +122,7 @@
 
 ### Rules for action "StyleBuilder":
 $(gyp_shared_intermediate_dir)/blink/StyleBuilder.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/StyleBuilder.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/StyleBuilder.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/StyleBuilder.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/StyleBuilder.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -125,17 +135,19 @@
 
 ### Rules for action "CSSValueKeywords":
 $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/hasher.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_css_value_keywords.py $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSValueKeywords.in $(LOCAL_PATH)/third_party/WebKit/Source/core/css/SVGCSSValueKeywords.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_CSSValueKeywords ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_css_value_keywords.py css/CSSValueKeywords.in css/SVGCSSValueKeywords.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --gperf gperf --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_css_value_keywords.py css/CSSValueKeywords.in css/SVGCSSValueKeywords.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --gperf gperf --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_MEDIA_CAPTURE=1\" \"WTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1\" \"ENABLE_WEB_AUDIO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.h: $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp ;
 
 ### Rules for action "HTMLElementFactory":
 $(gyp_shared_intermediate_dir)/blink/HTMLElementFactory.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/HTMLElementFactory.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/HTMLElementFactory.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLElementFactory.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLElementFactory.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -151,6 +163,7 @@
 
 ### Rules for action "HTMLElementTypeHelpers":
 $(gyp_shared_intermediate_dir)/blink/HTMLElementTypeHelpers.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/HTMLElementTypeHelpers.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/HTMLElementTypeHelpers.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLElementTypeHelpers.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLElementTypeHelpers.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -161,6 +174,7 @@
 
 ### Rules for action "SVGNames":
 $(gyp_shared_intermediate_dir)/blink/SVGElementFactory.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/SVGElementFactory.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/SVGElementFactory.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/SVGElementFactory.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/SVGElementFactory.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -176,6 +190,7 @@
 
 ### Rules for action "SVGElementTypeHelpers":
 $(gyp_shared_intermediate_dir)/blink/SVGElementTypeHelpers.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/SVGElementTypeHelpers.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/SVGElementTypeHelpers.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/SVGElementTypeHelpers.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/SVGElementTypeHelpers.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -186,6 +201,7 @@
 
 ### Rules for action "EventFactory":
 $(gyp_shared_intermediate_dir)/blink/Event.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/Event.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/Event.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/Event.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/Event.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -198,6 +214,7 @@
 
 ### Rules for action "EventNames":
 $(gyp_shared_intermediate_dir)/blink/EventNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/EventNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/EventNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -209,6 +226,7 @@
 
 ### Rules for action "EventTargetFactory":
 $(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -220,6 +238,7 @@
 
 ### Rules for action "EventTargetNames":
 $(gyp_shared_intermediate_dir)/blink/EventTargetNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/EventTargetNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/EventTargetNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventTargetNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventTargetNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -231,28 +250,31 @@
 
 ### Rules for action "MathMLNames":
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/hasher.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_qualified_names.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeQualifiedNames.cpp.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeQualifiedNames.h.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/parser/MathMLTagNames.in $(LOCAL_PATH)/third_party/WebKit/Source/core/html/parser/MathMLAttributeNames.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_MathMLNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_qualified_names.py html/parser/MathMLTagNames.in html/parser/MathMLAttributeNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_qualified_names.py html/parser/MathMLTagNames.in html/parser/MathMLAttributeNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_MEDIA_CAPTURE=1\" \"WTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1\" \"ENABLE_WEB_AUDIO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.h: $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp ;
 
 ### Rules for action "UserAgentStyleSheets":
 $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h: $(LOCAL_PATH)/third_party/WebKit/Source/core/css/make-css-file-arrays.pl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/preprocessor.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/css/html.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/quirks.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/view-source.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeChromium.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeChromiumAndroid.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeChromiumLinux.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeChromiumSkia.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeMac.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeWin.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeWinQuirks.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/svg.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/mathml.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/mediaControls.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/mediaControlsAndroid.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/fullscreen.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/xhtmlmp.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/viewportAndroid.css $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_UserAgentStyleSheets ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/action_useragentstylesheets.py "$(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h" "$(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheetsData.cpp" css/html.css css/quirks.css css/view-source.css css/themeChromium.css css/themeChromiumAndroid.css css/themeChromiumLinux.css css/themeChromiumSkia.css css/themeMac.css css/themeWin.css css/themeWinQuirks.css css/svg.css css/mathml.css css/mediaControls.css css/mediaControlsAndroid.css css/fullscreen.css css/xhtmlmp.css css/viewportAndroid.css -- css/make-css-file-arrays.pl ../build/scripts/preprocessor.pm -- --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\"" --preprocessor "/usr/bin/gcc -E -P -x c++" --perl perl
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/action_useragentstylesheets.py "$(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h" "$(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheetsData.cpp" css/html.css css/quirks.css css/view-source.css css/themeChromium.css css/themeChromiumAndroid.css css/themeChromiumLinux.css css/themeChromiumSkia.css css/themeMac.css css/themeWin.css css/themeWinQuirks.css css/svg.css css/mathml.css css/mediaControls.css css/mediaControlsAndroid.css css/fullscreen.css css/xhtmlmp.css css/viewportAndroid.css -- css/make-css-file-arrays.pl ../build/scripts/preprocessor.pm -- --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_MEDIA_CAPTURE=1\" \"WTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1\" \"ENABLE_WEB_AUDIO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\"" --preprocessor "/usr/bin/gcc -E -P -x c++" --perl perl
 
 $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheetsData.cpp: $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h ;
 
 ### Rules for action "FetchInitiatorTypeNames":
 $(gyp_shared_intermediate_dir)/blink/FetchInitiatorTypeNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/FetchInitiatorTypeNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/FetchInitiatorTypeNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/FetchInitiatorTypeNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/FetchInitiatorTypeNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -264,6 +286,7 @@
 
 ### Rules for action "EventTypeNames":
 $(gyp_shared_intermediate_dir)/blink/EventTypeNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/EventTypeNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/EventTypeNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventTypeNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventTypeNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -275,6 +298,7 @@
 
 ### Rules for action "HTMLTokenizerNames":
 $(gyp_shared_intermediate_dir)/blink/HTMLTokenizerNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/HTMLTokenizerNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/HTMLTokenizerNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLTokenizerNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLTokenizerNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -286,6 +310,7 @@
 
 ### Rules for action "InputTypeNames":
 $(gyp_shared_intermediate_dir)/blink/InputTypeNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/InputTypeNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/InputTypeNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InputTypeNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InputTypeNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -297,6 +322,7 @@
 
 ### Rules for action "XLinkNames":
 $(gyp_shared_intermediate_dir)/blink/XLinkNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/XLinkNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/XLinkNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XLinkNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XLinkNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -308,6 +334,7 @@
 
 ### Rules for action "XMLNSNames":
 $(gyp_shared_intermediate_dir)/blink/XMLNSNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/XMLNSNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/XMLNSNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XMLNSNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XMLNSNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -319,6 +346,7 @@
 
 ### Rules for action "XMLNames":
 $(gyp_shared_intermediate_dir)/blink/XMLNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/XMLNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/XMLNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XMLNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XMLNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -330,6 +358,7 @@
 
 ### Rules for action "MakeTokenMatcher":
 $(gyp_shared_intermediate_dir)/blink/CSSTokenizer.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/CSSTokenizer.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/CSSTokenizer.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/CSSTokenizer.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/CSSTokenizer.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -340,6 +369,7 @@
 
 ### Rules for action "MakeParser":
 $(gyp_shared_intermediate_dir)/blink/BisonCSSParser.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/BisonCSSParser.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/BisonCSSParser.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/BisonCSSParser.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/BisonCSSParser.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -350,6 +380,7 @@
 
 ### Rules for action "MakeTokenMatcherForViewport":
 $(gyp_shared_intermediate_dir)/blink/HTMLMetaElement.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/HTMLMetaElement.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/HTMLMetaElement.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLMetaElement.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLMetaElement.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -360,6 +391,7 @@
 
 ### Rules for action "HTMLElementLookupTrie":
 $(gyp_shared_intermediate_dir)/blink/HTMLElementLookupTrie.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/HTMLElementLookupTrie.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/HTMLElementLookupTrie.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLElementLookupTrie.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLElementLookupTrie.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -374,6 +406,7 @@
 ### Generated for rule "third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_bison":
 # "{'action': ['python', '../build/scripts/rule_bison.py', '$(RULE_SOURCES)', '$(gyp_shared_intermediate_dir)/blink', 'bison'], 'rule_name': 'bison', 'rule_sources': ['css/CSSGrammar.y', 'xml/XPathGrammar.y'], 'extension': 'y', 'outputs': ['$(gyp_shared_intermediate_dir)/blink/%(INPUT_ROOT)s.cpp', '$(gyp_shared_intermediate_dir)/blink/%(INPUT_ROOT)s.h']}":
 $(gyp_shared_intermediate_dir)/blink/CSSGrammar.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/CSSGrammar.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/CSSGrammar.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/CSSGrammar.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/CSSGrammar.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -383,6 +416,7 @@
 $(gyp_shared_intermediate_dir)/blink/CSSGrammar.h: $(gyp_shared_intermediate_dir)/blink/CSSGrammar.cpp ;
 
 $(gyp_shared_intermediate_dir)/blink/XPathGrammar.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/XPathGrammar.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/XPathGrammar.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XPathGrammar.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XPathGrammar.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -486,7 +520,6 @@
 	-pipe \
 	-fPIC \
 	-fno-tree-sra \
-	-fuse-ld=gold \
 	-Wno-psabi \
 	-ffunction-sections \
 	-funwind-tables \
@@ -573,7 +606,6 @@
 	-pipe \
 	-fPIC \
 	-fno-tree-sra \
-	-fuse-ld=gold \
 	-Wno-psabi \
 	-ffunction-sections \
 	-funwind-tables \
diff --git a/Source/core/make_core_generated.target.darwin-arm64.mk b/Source/core/make_core_generated.target.darwin-arm64.mk
index 4c3af11..69b90b8 100644
--- a/Source/core/make_core_generated.target.darwin-arm64.mk
+++ b/Source/core/make_core_generated.target.darwin-arm64.mk
@@ -19,6 +19,7 @@
 
 ### Rules for action "generateXMLViewerCSS":
 $(gyp_shared_intermediate_dir)/blink/XMLViewerCSS.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/XMLViewerCSS.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/XMLViewerCSS.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XMLViewerCSS.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XMLViewerCSS.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -29,6 +30,7 @@
 
 ### Rules for action "generateXMLViewerJS":
 $(gyp_shared_intermediate_dir)/blink/XMLViewerJS.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/XMLViewerJS.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/XMLViewerJS.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XMLViewerJS.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XMLViewerJS.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -39,6 +41,7 @@
 
 ### Rules for action "HTMLEntityTable":
 $(gyp_shared_intermediate_dir)/blink/HTMLEntityTable.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/HTMLEntityTable.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/HTMLEntityTable.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLEntityTable.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLEntityTable.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -49,59 +52,65 @@
 
 ### Rules for action "CSSPropertyNames":
 $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/hasher.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_css_property_names.py $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSPropertyNames.in $(LOCAL_PATH)/third_party/WebKit/Source/core/css/SVGCSSPropertyNames.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_CSSPropertyNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_css_property_names.py css/CSSPropertyNames.in css/SVGCSSPropertyNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --gperf gperf --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_css_property_names.py css/CSSPropertyNames.in css/SVGCSSPropertyNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --gperf gperf --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.h: $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp ;
 
 ### Rules for action "MediaFeatureNames":
 $(gyp_shared_intermediate_dir)/blink/MediaFeatureNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/MediaFeatureNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/MediaFeatureNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MediaFeatureNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MediaFeatureNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/MediaFeatureNames.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/hasher.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_names.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeNames.cpp.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeNames.h.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_media_feature_names.py $(LOCAL_PATH)/third_party/WebKit/Source/core/css/MediaFeatureNames.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_MediaFeatureNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_media_feature_names.py css/MediaFeatureNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_media_feature_names.py css/MediaFeatureNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/MediaFeatureNames.h: $(gyp_shared_intermediate_dir)/blink/MediaFeatureNames.cpp ;
 
 ### Rules for action "MediaFeatures":
 $(gyp_shared_intermediate_dir)/blink/MediaFeatures.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/MediaFeatures.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/MediaFeatures.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MediaFeatures.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MediaFeatures.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/MediaFeatures.h: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/hasher.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_media_features.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MediaFeatures.h.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/MediaFeatureNames.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_MediaFeatures ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_media_features.py css/MediaFeatureNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_media_features.py css/MediaFeatureNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 
 ### Rules for action "MediaTypeNames":
 $(gyp_shared_intermediate_dir)/blink/MediaTypeNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/MediaTypeNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/MediaTypeNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MediaTypeNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MediaTypeNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/MediaTypeNames.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/hasher.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_names.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeNames.cpp.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeNames.h.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/MediaTypeNames.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_MediaTypeNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_names.py css/MediaTypeNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_names.py css/MediaTypeNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/MediaTypeNames.h: $(gyp_shared_intermediate_dir)/blink/MediaTypeNames.cpp ;
 
 ### Rules for action "MediaQueryTokenizerCodepoints":
 $(gyp_shared_intermediate_dir)/blink/MediaQueryTokenizerCodepoints.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/MediaQueryTokenizerCodepoints.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/MediaQueryTokenizerCodepoints.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MediaQueryTokenizerCodepoints.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MediaQueryTokenizerCodepoints.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/MediaQueryTokenizerCodepoints.cpp: $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_mediaquery_tokenizer_codepoints.py $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_MediaQueryTokenizerCodepoints ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_mediaquery_tokenizer_codepoints.py --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_mediaquery_tokenizer_codepoints.py --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 
 ### Rules for action "StylePropertyShorthand":
 $(gyp_shared_intermediate_dir)/blink/StylePropertyShorthand.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/StylePropertyShorthand.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/StylePropertyShorthand.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/StylePropertyShorthand.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/StylePropertyShorthand.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -113,6 +122,7 @@
 
 ### Rules for action "StyleBuilder":
 $(gyp_shared_intermediate_dir)/blink/StyleBuilder.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/StyleBuilder.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/StyleBuilder.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/StyleBuilder.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/StyleBuilder.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -125,17 +135,19 @@
 
 ### Rules for action "CSSValueKeywords":
 $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/hasher.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_css_value_keywords.py $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSValueKeywords.in $(LOCAL_PATH)/third_party/WebKit/Source/core/css/SVGCSSValueKeywords.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_CSSValueKeywords ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_css_value_keywords.py css/CSSValueKeywords.in css/SVGCSSValueKeywords.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --gperf gperf --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_css_value_keywords.py css/CSSValueKeywords.in css/SVGCSSValueKeywords.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --gperf gperf --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.h: $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp ;
 
 ### Rules for action "HTMLElementFactory":
 $(gyp_shared_intermediate_dir)/blink/HTMLElementFactory.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/HTMLElementFactory.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/HTMLElementFactory.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLElementFactory.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLElementFactory.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -151,6 +163,7 @@
 
 ### Rules for action "HTMLElementTypeHelpers":
 $(gyp_shared_intermediate_dir)/blink/HTMLElementTypeHelpers.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/HTMLElementTypeHelpers.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/HTMLElementTypeHelpers.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLElementTypeHelpers.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLElementTypeHelpers.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -161,6 +174,7 @@
 
 ### Rules for action "SVGNames":
 $(gyp_shared_intermediate_dir)/blink/SVGElementFactory.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/SVGElementFactory.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/SVGElementFactory.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/SVGElementFactory.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/SVGElementFactory.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -176,6 +190,7 @@
 
 ### Rules for action "SVGElementTypeHelpers":
 $(gyp_shared_intermediate_dir)/blink/SVGElementTypeHelpers.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/SVGElementTypeHelpers.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/SVGElementTypeHelpers.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/SVGElementTypeHelpers.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/SVGElementTypeHelpers.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -186,6 +201,7 @@
 
 ### Rules for action "EventFactory":
 $(gyp_shared_intermediate_dir)/blink/Event.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/Event.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/Event.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/Event.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/Event.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -198,6 +214,7 @@
 
 ### Rules for action "EventNames":
 $(gyp_shared_intermediate_dir)/blink/EventNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/EventNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/EventNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -209,6 +226,7 @@
 
 ### Rules for action "EventTargetFactory":
 $(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -220,6 +238,7 @@
 
 ### Rules for action "EventTargetNames":
 $(gyp_shared_intermediate_dir)/blink/EventTargetNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/EventTargetNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/EventTargetNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventTargetNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventTargetNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -231,28 +250,31 @@
 
 ### Rules for action "MathMLNames":
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/hasher.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_qualified_names.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeQualifiedNames.cpp.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeQualifiedNames.h.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/parser/MathMLTagNames.in $(LOCAL_PATH)/third_party/WebKit/Source/core/html/parser/MathMLAttributeNames.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_MathMLNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_qualified_names.py html/parser/MathMLTagNames.in html/parser/MathMLAttributeNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_qualified_names.py html/parser/MathMLTagNames.in html/parser/MathMLAttributeNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.h: $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp ;
 
 ### Rules for action "UserAgentStyleSheets":
 $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h: $(LOCAL_PATH)/third_party/WebKit/Source/core/css/make-css-file-arrays.pl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/preprocessor.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/css/html.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/quirks.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/view-source.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeChromium.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeChromiumAndroid.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeChromiumLinux.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeChromiumSkia.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeMac.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeWin.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeWinQuirks.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/svg.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/mathml.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/mediaControls.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/mediaControlsAndroid.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/fullscreen.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/xhtmlmp.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/viewportAndroid.css $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_UserAgentStyleSheets ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/action_useragentstylesheets.py "$(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h" "$(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheetsData.cpp" css/html.css css/quirks.css css/view-source.css css/themeChromium.css css/themeChromiumAndroid.css css/themeChromiumLinux.css css/themeChromiumSkia.css css/themeMac.css css/themeWin.css css/themeWinQuirks.css css/svg.css css/mathml.css css/mediaControls.css css/mediaControlsAndroid.css css/fullscreen.css css/xhtmlmp.css css/viewportAndroid.css -- css/make-css-file-arrays.pl ../build/scripts/preprocessor.pm -- --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\"" --preprocessor "/usr/bin/gcc -E -P -x c++" --perl perl
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/action_useragentstylesheets.py "$(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h" "$(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheetsData.cpp" css/html.css css/quirks.css css/view-source.css css/themeChromium.css css/themeChromiumAndroid.css css/themeChromiumLinux.css css/themeChromiumSkia.css css/themeMac.css css/themeWin.css css/themeWinQuirks.css css/svg.css css/mathml.css css/mediaControls.css css/mediaControlsAndroid.css css/fullscreen.css css/xhtmlmp.css css/viewportAndroid.css -- css/make-css-file-arrays.pl ../build/scripts/preprocessor.pm -- --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\"" --preprocessor "/usr/bin/gcc -E -P -x c++" --perl perl
 
 $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheetsData.cpp: $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h ;
 
 ### Rules for action "FetchInitiatorTypeNames":
 $(gyp_shared_intermediate_dir)/blink/FetchInitiatorTypeNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/FetchInitiatorTypeNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/FetchInitiatorTypeNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/FetchInitiatorTypeNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/FetchInitiatorTypeNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -264,6 +286,7 @@
 
 ### Rules for action "EventTypeNames":
 $(gyp_shared_intermediate_dir)/blink/EventTypeNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/EventTypeNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/EventTypeNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventTypeNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventTypeNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -275,6 +298,7 @@
 
 ### Rules for action "HTMLTokenizerNames":
 $(gyp_shared_intermediate_dir)/blink/HTMLTokenizerNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/HTMLTokenizerNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/HTMLTokenizerNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLTokenizerNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLTokenizerNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -286,6 +310,7 @@
 
 ### Rules for action "InputTypeNames":
 $(gyp_shared_intermediate_dir)/blink/InputTypeNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/InputTypeNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/InputTypeNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InputTypeNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InputTypeNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -297,6 +322,7 @@
 
 ### Rules for action "XLinkNames":
 $(gyp_shared_intermediate_dir)/blink/XLinkNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/XLinkNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/XLinkNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XLinkNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XLinkNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -308,6 +334,7 @@
 
 ### Rules for action "XMLNSNames":
 $(gyp_shared_intermediate_dir)/blink/XMLNSNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/XMLNSNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/XMLNSNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XMLNSNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XMLNSNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -319,6 +346,7 @@
 
 ### Rules for action "XMLNames":
 $(gyp_shared_intermediate_dir)/blink/XMLNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/XMLNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/XMLNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XMLNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XMLNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -330,6 +358,7 @@
 
 ### Rules for action "MakeTokenMatcher":
 $(gyp_shared_intermediate_dir)/blink/CSSTokenizer.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/CSSTokenizer.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/CSSTokenizer.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/CSSTokenizer.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/CSSTokenizer.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -340,6 +369,7 @@
 
 ### Rules for action "MakeParser":
 $(gyp_shared_intermediate_dir)/blink/BisonCSSParser.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/BisonCSSParser.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/BisonCSSParser.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/BisonCSSParser.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/BisonCSSParser.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -350,6 +380,7 @@
 
 ### Rules for action "MakeTokenMatcherForViewport":
 $(gyp_shared_intermediate_dir)/blink/HTMLMetaElement.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/HTMLMetaElement.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/HTMLMetaElement.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLMetaElement.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLMetaElement.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -360,6 +391,7 @@
 
 ### Rules for action "HTMLElementLookupTrie":
 $(gyp_shared_intermediate_dir)/blink/HTMLElementLookupTrie.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/HTMLElementLookupTrie.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/HTMLElementLookupTrie.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLElementLookupTrie.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLElementLookupTrie.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -374,6 +406,7 @@
 ### Generated for rule "third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_bison":
 # "{'action': ['python', '../build/scripts/rule_bison.py', '$(RULE_SOURCES)', '$(gyp_shared_intermediate_dir)/blink', 'bison'], 'rule_name': 'bison', 'rule_sources': ['css/CSSGrammar.y', 'xml/XPathGrammar.y'], 'extension': 'y', 'outputs': ['$(gyp_shared_intermediate_dir)/blink/%(INPUT_ROOT)s.cpp', '$(gyp_shared_intermediate_dir)/blink/%(INPUT_ROOT)s.h']}":
 $(gyp_shared_intermediate_dir)/blink/CSSGrammar.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/CSSGrammar.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/CSSGrammar.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/CSSGrammar.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/CSSGrammar.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -383,6 +416,7 @@
 $(gyp_shared_intermediate_dir)/blink/CSSGrammar.h: $(gyp_shared_intermediate_dir)/blink/CSSGrammar.cpp ;
 
 $(gyp_shared_intermediate_dir)/blink/XPathGrammar.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/XPathGrammar.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/XPathGrammar.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XPathGrammar.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XPathGrammar.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/make_core_generated.target.darwin-mips.mk b/Source/core/make_core_generated.target.darwin-mips.mk
index 4d3ff8f..373137f 100644
--- a/Source/core/make_core_generated.target.darwin-mips.mk
+++ b/Source/core/make_core_generated.target.darwin-mips.mk
@@ -19,6 +19,7 @@
 
 ### Rules for action "generateXMLViewerCSS":
 $(gyp_shared_intermediate_dir)/blink/XMLViewerCSS.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/XMLViewerCSS.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/XMLViewerCSS.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XMLViewerCSS.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XMLViewerCSS.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -29,6 +30,7 @@
 
 ### Rules for action "generateXMLViewerJS":
 $(gyp_shared_intermediate_dir)/blink/XMLViewerJS.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/XMLViewerJS.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/XMLViewerJS.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XMLViewerJS.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XMLViewerJS.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -39,6 +41,7 @@
 
 ### Rules for action "HTMLEntityTable":
 $(gyp_shared_intermediate_dir)/blink/HTMLEntityTable.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/HTMLEntityTable.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/HTMLEntityTable.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLEntityTable.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLEntityTable.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -49,59 +52,65 @@
 
 ### Rules for action "CSSPropertyNames":
 $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/hasher.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_css_property_names.py $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSPropertyNames.in $(LOCAL_PATH)/third_party/WebKit/Source/core/css/SVGCSSPropertyNames.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_CSSPropertyNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_css_property_names.py css/CSSPropertyNames.in css/SVGCSSPropertyNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --gperf gperf --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_css_property_names.py css/CSSPropertyNames.in css/SVGCSSPropertyNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --gperf gperf --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.h: $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp ;
 
 ### Rules for action "MediaFeatureNames":
 $(gyp_shared_intermediate_dir)/blink/MediaFeatureNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/MediaFeatureNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/MediaFeatureNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MediaFeatureNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MediaFeatureNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/MediaFeatureNames.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/hasher.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_names.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeNames.cpp.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeNames.h.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_media_feature_names.py $(LOCAL_PATH)/third_party/WebKit/Source/core/css/MediaFeatureNames.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_MediaFeatureNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_media_feature_names.py css/MediaFeatureNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_media_feature_names.py css/MediaFeatureNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/MediaFeatureNames.h: $(gyp_shared_intermediate_dir)/blink/MediaFeatureNames.cpp ;
 
 ### Rules for action "MediaFeatures":
 $(gyp_shared_intermediate_dir)/blink/MediaFeatures.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/MediaFeatures.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/MediaFeatures.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MediaFeatures.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MediaFeatures.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/MediaFeatures.h: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/hasher.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_media_features.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MediaFeatures.h.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/MediaFeatureNames.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_MediaFeatures ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_media_features.py css/MediaFeatureNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_media_features.py css/MediaFeatureNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 
 ### Rules for action "MediaTypeNames":
 $(gyp_shared_intermediate_dir)/blink/MediaTypeNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/MediaTypeNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/MediaTypeNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MediaTypeNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MediaTypeNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/MediaTypeNames.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/hasher.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_names.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeNames.cpp.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeNames.h.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/MediaTypeNames.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_MediaTypeNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_names.py css/MediaTypeNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_names.py css/MediaTypeNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/MediaTypeNames.h: $(gyp_shared_intermediate_dir)/blink/MediaTypeNames.cpp ;
 
 ### Rules for action "MediaQueryTokenizerCodepoints":
 $(gyp_shared_intermediate_dir)/blink/MediaQueryTokenizerCodepoints.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/MediaQueryTokenizerCodepoints.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/MediaQueryTokenizerCodepoints.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MediaQueryTokenizerCodepoints.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MediaQueryTokenizerCodepoints.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/MediaQueryTokenizerCodepoints.cpp: $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_mediaquery_tokenizer_codepoints.py $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_MediaQueryTokenizerCodepoints ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_mediaquery_tokenizer_codepoints.py --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_mediaquery_tokenizer_codepoints.py --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 
 ### Rules for action "StylePropertyShorthand":
 $(gyp_shared_intermediate_dir)/blink/StylePropertyShorthand.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/StylePropertyShorthand.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/StylePropertyShorthand.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/StylePropertyShorthand.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/StylePropertyShorthand.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -113,6 +122,7 @@
 
 ### Rules for action "StyleBuilder":
 $(gyp_shared_intermediate_dir)/blink/StyleBuilder.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/StyleBuilder.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/StyleBuilder.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/StyleBuilder.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/StyleBuilder.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -125,17 +135,19 @@
 
 ### Rules for action "CSSValueKeywords":
 $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/hasher.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_css_value_keywords.py $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSValueKeywords.in $(LOCAL_PATH)/third_party/WebKit/Source/core/css/SVGCSSValueKeywords.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_CSSValueKeywords ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_css_value_keywords.py css/CSSValueKeywords.in css/SVGCSSValueKeywords.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --gperf gperf --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_css_value_keywords.py css/CSSValueKeywords.in css/SVGCSSValueKeywords.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --gperf gperf --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.h: $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp ;
 
 ### Rules for action "HTMLElementFactory":
 $(gyp_shared_intermediate_dir)/blink/HTMLElementFactory.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/HTMLElementFactory.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/HTMLElementFactory.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLElementFactory.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLElementFactory.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -151,6 +163,7 @@
 
 ### Rules for action "HTMLElementTypeHelpers":
 $(gyp_shared_intermediate_dir)/blink/HTMLElementTypeHelpers.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/HTMLElementTypeHelpers.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/HTMLElementTypeHelpers.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLElementTypeHelpers.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLElementTypeHelpers.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -161,6 +174,7 @@
 
 ### Rules for action "SVGNames":
 $(gyp_shared_intermediate_dir)/blink/SVGElementFactory.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/SVGElementFactory.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/SVGElementFactory.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/SVGElementFactory.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/SVGElementFactory.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -176,6 +190,7 @@
 
 ### Rules for action "SVGElementTypeHelpers":
 $(gyp_shared_intermediate_dir)/blink/SVGElementTypeHelpers.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/SVGElementTypeHelpers.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/SVGElementTypeHelpers.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/SVGElementTypeHelpers.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/SVGElementTypeHelpers.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -186,6 +201,7 @@
 
 ### Rules for action "EventFactory":
 $(gyp_shared_intermediate_dir)/blink/Event.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/Event.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/Event.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/Event.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/Event.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -198,6 +214,7 @@
 
 ### Rules for action "EventNames":
 $(gyp_shared_intermediate_dir)/blink/EventNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/EventNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/EventNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -209,6 +226,7 @@
 
 ### Rules for action "EventTargetFactory":
 $(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -220,6 +238,7 @@
 
 ### Rules for action "EventTargetNames":
 $(gyp_shared_intermediate_dir)/blink/EventTargetNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/EventTargetNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/EventTargetNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventTargetNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventTargetNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -231,28 +250,31 @@
 
 ### Rules for action "MathMLNames":
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/hasher.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_qualified_names.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeQualifiedNames.cpp.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeQualifiedNames.h.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/parser/MathMLTagNames.in $(LOCAL_PATH)/third_party/WebKit/Source/core/html/parser/MathMLAttributeNames.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_MathMLNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_qualified_names.py html/parser/MathMLTagNames.in html/parser/MathMLAttributeNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_qualified_names.py html/parser/MathMLTagNames.in html/parser/MathMLAttributeNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.h: $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp ;
 
 ### Rules for action "UserAgentStyleSheets":
 $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h: $(LOCAL_PATH)/third_party/WebKit/Source/core/css/make-css-file-arrays.pl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/preprocessor.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/css/html.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/quirks.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/view-source.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeChromium.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeChromiumAndroid.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeChromiumLinux.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeChromiumSkia.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeMac.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeWin.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeWinQuirks.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/svg.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/mathml.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/mediaControls.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/mediaControlsAndroid.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/fullscreen.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/xhtmlmp.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/viewportAndroid.css $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_UserAgentStyleSheets ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/action_useragentstylesheets.py "$(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h" "$(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheetsData.cpp" css/html.css css/quirks.css css/view-source.css css/themeChromium.css css/themeChromiumAndroid.css css/themeChromiumLinux.css css/themeChromiumSkia.css css/themeMac.css css/themeWin.css css/themeWinQuirks.css css/svg.css css/mathml.css css/mediaControls.css css/mediaControlsAndroid.css css/fullscreen.css css/xhtmlmp.css css/viewportAndroid.css -- css/make-css-file-arrays.pl ../build/scripts/preprocessor.pm -- --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\"" --preprocessor "/usr/bin/gcc -E -P -x c++" --perl perl
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/action_useragentstylesheets.py "$(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h" "$(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheetsData.cpp" css/html.css css/quirks.css css/view-source.css css/themeChromium.css css/themeChromiumAndroid.css css/themeChromiumLinux.css css/themeChromiumSkia.css css/themeMac.css css/themeWin.css css/themeWinQuirks.css css/svg.css css/mathml.css css/mediaControls.css css/mediaControlsAndroid.css css/fullscreen.css css/xhtmlmp.css css/viewportAndroid.css -- css/make-css-file-arrays.pl ../build/scripts/preprocessor.pm -- --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\"" --preprocessor "/usr/bin/gcc -E -P -x c++" --perl perl
 
 $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheetsData.cpp: $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h ;
 
 ### Rules for action "FetchInitiatorTypeNames":
 $(gyp_shared_intermediate_dir)/blink/FetchInitiatorTypeNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/FetchInitiatorTypeNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/FetchInitiatorTypeNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/FetchInitiatorTypeNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/FetchInitiatorTypeNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -264,6 +286,7 @@
 
 ### Rules for action "EventTypeNames":
 $(gyp_shared_intermediate_dir)/blink/EventTypeNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/EventTypeNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/EventTypeNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventTypeNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventTypeNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -275,6 +298,7 @@
 
 ### Rules for action "HTMLTokenizerNames":
 $(gyp_shared_intermediate_dir)/blink/HTMLTokenizerNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/HTMLTokenizerNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/HTMLTokenizerNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLTokenizerNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLTokenizerNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -286,6 +310,7 @@
 
 ### Rules for action "InputTypeNames":
 $(gyp_shared_intermediate_dir)/blink/InputTypeNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/InputTypeNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/InputTypeNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InputTypeNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InputTypeNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -297,6 +322,7 @@
 
 ### Rules for action "XLinkNames":
 $(gyp_shared_intermediate_dir)/blink/XLinkNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/XLinkNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/XLinkNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XLinkNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XLinkNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -308,6 +334,7 @@
 
 ### Rules for action "XMLNSNames":
 $(gyp_shared_intermediate_dir)/blink/XMLNSNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/XMLNSNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/XMLNSNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XMLNSNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XMLNSNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -319,6 +346,7 @@
 
 ### Rules for action "XMLNames":
 $(gyp_shared_intermediate_dir)/blink/XMLNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/XMLNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/XMLNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XMLNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XMLNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -330,6 +358,7 @@
 
 ### Rules for action "MakeTokenMatcher":
 $(gyp_shared_intermediate_dir)/blink/CSSTokenizer.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/CSSTokenizer.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/CSSTokenizer.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/CSSTokenizer.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/CSSTokenizer.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -340,6 +369,7 @@
 
 ### Rules for action "MakeParser":
 $(gyp_shared_intermediate_dir)/blink/BisonCSSParser.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/BisonCSSParser.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/BisonCSSParser.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/BisonCSSParser.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/BisonCSSParser.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -350,6 +380,7 @@
 
 ### Rules for action "MakeTokenMatcherForViewport":
 $(gyp_shared_intermediate_dir)/blink/HTMLMetaElement.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/HTMLMetaElement.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/HTMLMetaElement.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLMetaElement.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLMetaElement.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -360,6 +391,7 @@
 
 ### Rules for action "HTMLElementLookupTrie":
 $(gyp_shared_intermediate_dir)/blink/HTMLElementLookupTrie.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/HTMLElementLookupTrie.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/HTMLElementLookupTrie.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLElementLookupTrie.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLElementLookupTrie.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -374,6 +406,7 @@
 ### Generated for rule "third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_bison":
 # "{'action': ['python', '../build/scripts/rule_bison.py', '$(RULE_SOURCES)', '$(gyp_shared_intermediate_dir)/blink', 'bison'], 'rule_name': 'bison', 'rule_sources': ['css/CSSGrammar.y', 'xml/XPathGrammar.y'], 'extension': 'y', 'outputs': ['$(gyp_shared_intermediate_dir)/blink/%(INPUT_ROOT)s.cpp', '$(gyp_shared_intermediate_dir)/blink/%(INPUT_ROOT)s.h']}":
 $(gyp_shared_intermediate_dir)/blink/CSSGrammar.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/CSSGrammar.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/CSSGrammar.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/CSSGrammar.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/CSSGrammar.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -383,6 +416,7 @@
 $(gyp_shared_intermediate_dir)/blink/CSSGrammar.h: $(gyp_shared_intermediate_dir)/blink/CSSGrammar.cpp ;
 
 $(gyp_shared_intermediate_dir)/blink/XPathGrammar.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/XPathGrammar.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/XPathGrammar.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XPathGrammar.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XPathGrammar.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/make_core_generated.target.darwin-x86.mk b/Source/core/make_core_generated.target.darwin-x86.mk
index c12ddf8..824aa83 100644
--- a/Source/core/make_core_generated.target.darwin-x86.mk
+++ b/Source/core/make_core_generated.target.darwin-x86.mk
@@ -19,6 +19,7 @@
 
 ### Rules for action "generateXMLViewerCSS":
 $(gyp_shared_intermediate_dir)/blink/XMLViewerCSS.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/XMLViewerCSS.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/XMLViewerCSS.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XMLViewerCSS.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XMLViewerCSS.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -29,6 +30,7 @@
 
 ### Rules for action "generateXMLViewerJS":
 $(gyp_shared_intermediate_dir)/blink/XMLViewerJS.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/XMLViewerJS.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/XMLViewerJS.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XMLViewerJS.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XMLViewerJS.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -39,6 +41,7 @@
 
 ### Rules for action "HTMLEntityTable":
 $(gyp_shared_intermediate_dir)/blink/HTMLEntityTable.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/HTMLEntityTable.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/HTMLEntityTable.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLEntityTable.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLEntityTable.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -49,59 +52,65 @@
 
 ### Rules for action "CSSPropertyNames":
 $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/hasher.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_css_property_names.py $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSPropertyNames.in $(LOCAL_PATH)/third_party/WebKit/Source/core/css/SVGCSSPropertyNames.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_CSSPropertyNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_css_property_names.py css/CSSPropertyNames.in css/SVGCSSPropertyNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --gperf gperf --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_css_property_names.py css/CSSPropertyNames.in css/SVGCSSPropertyNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --gperf gperf --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_MEDIA_CAPTURE=1\" \"WTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1\" \"ENABLE_WEB_AUDIO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.h: $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp ;
 
 ### Rules for action "MediaFeatureNames":
 $(gyp_shared_intermediate_dir)/blink/MediaFeatureNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/MediaFeatureNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/MediaFeatureNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MediaFeatureNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MediaFeatureNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/MediaFeatureNames.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/hasher.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_names.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeNames.cpp.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeNames.h.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_media_feature_names.py $(LOCAL_PATH)/third_party/WebKit/Source/core/css/MediaFeatureNames.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_MediaFeatureNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_media_feature_names.py css/MediaFeatureNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_media_feature_names.py css/MediaFeatureNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_MEDIA_CAPTURE=1\" \"WTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1\" \"ENABLE_WEB_AUDIO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/MediaFeatureNames.h: $(gyp_shared_intermediate_dir)/blink/MediaFeatureNames.cpp ;
 
 ### Rules for action "MediaFeatures":
 $(gyp_shared_intermediate_dir)/blink/MediaFeatures.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/MediaFeatures.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/MediaFeatures.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MediaFeatures.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MediaFeatures.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/MediaFeatures.h: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/hasher.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_media_features.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MediaFeatures.h.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/MediaFeatureNames.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_MediaFeatures ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_media_features.py css/MediaFeatureNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_media_features.py css/MediaFeatureNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_MEDIA_CAPTURE=1\" \"WTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1\" \"ENABLE_WEB_AUDIO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 
 ### Rules for action "MediaTypeNames":
 $(gyp_shared_intermediate_dir)/blink/MediaTypeNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/MediaTypeNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/MediaTypeNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MediaTypeNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MediaTypeNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/MediaTypeNames.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/hasher.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_names.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeNames.cpp.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeNames.h.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/MediaTypeNames.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_MediaTypeNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_names.py css/MediaTypeNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_names.py css/MediaTypeNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_MEDIA_CAPTURE=1\" \"WTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1\" \"ENABLE_WEB_AUDIO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/MediaTypeNames.h: $(gyp_shared_intermediate_dir)/blink/MediaTypeNames.cpp ;
 
 ### Rules for action "MediaQueryTokenizerCodepoints":
 $(gyp_shared_intermediate_dir)/blink/MediaQueryTokenizerCodepoints.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/MediaQueryTokenizerCodepoints.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/MediaQueryTokenizerCodepoints.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MediaQueryTokenizerCodepoints.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MediaQueryTokenizerCodepoints.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/MediaQueryTokenizerCodepoints.cpp: $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_mediaquery_tokenizer_codepoints.py $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_MediaQueryTokenizerCodepoints ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_mediaquery_tokenizer_codepoints.py --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_mediaquery_tokenizer_codepoints.py --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_MEDIA_CAPTURE=1\" \"WTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1\" \"ENABLE_WEB_AUDIO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 
 ### Rules for action "StylePropertyShorthand":
 $(gyp_shared_intermediate_dir)/blink/StylePropertyShorthand.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/StylePropertyShorthand.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/StylePropertyShorthand.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/StylePropertyShorthand.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/StylePropertyShorthand.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -113,6 +122,7 @@
 
 ### Rules for action "StyleBuilder":
 $(gyp_shared_intermediate_dir)/blink/StyleBuilder.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/StyleBuilder.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/StyleBuilder.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/StyleBuilder.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/StyleBuilder.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -125,17 +135,19 @@
 
 ### Rules for action "CSSValueKeywords":
 $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/hasher.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_css_value_keywords.py $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSValueKeywords.in $(LOCAL_PATH)/third_party/WebKit/Source/core/css/SVGCSSValueKeywords.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_CSSValueKeywords ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_css_value_keywords.py css/CSSValueKeywords.in css/SVGCSSValueKeywords.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --gperf gperf --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_css_value_keywords.py css/CSSValueKeywords.in css/SVGCSSValueKeywords.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --gperf gperf --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_MEDIA_CAPTURE=1\" \"WTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1\" \"ENABLE_WEB_AUDIO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.h: $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp ;
 
 ### Rules for action "HTMLElementFactory":
 $(gyp_shared_intermediate_dir)/blink/HTMLElementFactory.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/HTMLElementFactory.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/HTMLElementFactory.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLElementFactory.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLElementFactory.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -151,6 +163,7 @@
 
 ### Rules for action "HTMLElementTypeHelpers":
 $(gyp_shared_intermediate_dir)/blink/HTMLElementTypeHelpers.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/HTMLElementTypeHelpers.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/HTMLElementTypeHelpers.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLElementTypeHelpers.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLElementTypeHelpers.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -161,6 +174,7 @@
 
 ### Rules for action "SVGNames":
 $(gyp_shared_intermediate_dir)/blink/SVGElementFactory.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/SVGElementFactory.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/SVGElementFactory.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/SVGElementFactory.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/SVGElementFactory.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -176,6 +190,7 @@
 
 ### Rules for action "SVGElementTypeHelpers":
 $(gyp_shared_intermediate_dir)/blink/SVGElementTypeHelpers.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/SVGElementTypeHelpers.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/SVGElementTypeHelpers.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/SVGElementTypeHelpers.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/SVGElementTypeHelpers.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -186,6 +201,7 @@
 
 ### Rules for action "EventFactory":
 $(gyp_shared_intermediate_dir)/blink/Event.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/Event.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/Event.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/Event.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/Event.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -198,6 +214,7 @@
 
 ### Rules for action "EventNames":
 $(gyp_shared_intermediate_dir)/blink/EventNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/EventNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/EventNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -209,6 +226,7 @@
 
 ### Rules for action "EventTargetFactory":
 $(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -220,6 +238,7 @@
 
 ### Rules for action "EventTargetNames":
 $(gyp_shared_intermediate_dir)/blink/EventTargetNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/EventTargetNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/EventTargetNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventTargetNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventTargetNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -231,28 +250,31 @@
 
 ### Rules for action "MathMLNames":
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/hasher.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_qualified_names.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeQualifiedNames.cpp.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeQualifiedNames.h.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/parser/MathMLTagNames.in $(LOCAL_PATH)/third_party/WebKit/Source/core/html/parser/MathMLAttributeNames.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_MathMLNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_qualified_names.py html/parser/MathMLTagNames.in html/parser/MathMLAttributeNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_qualified_names.py html/parser/MathMLTagNames.in html/parser/MathMLAttributeNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_MEDIA_CAPTURE=1\" \"WTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1\" \"ENABLE_WEB_AUDIO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.h: $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp ;
 
 ### Rules for action "UserAgentStyleSheets":
 $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h: $(LOCAL_PATH)/third_party/WebKit/Source/core/css/make-css-file-arrays.pl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/preprocessor.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/css/html.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/quirks.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/view-source.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeChromium.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeChromiumAndroid.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeChromiumLinux.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeChromiumSkia.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeMac.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeWin.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeWinQuirks.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/svg.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/mathml.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/mediaControls.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/mediaControlsAndroid.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/fullscreen.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/xhtmlmp.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/viewportAndroid.css $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_UserAgentStyleSheets ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/action_useragentstylesheets.py "$(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h" "$(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheetsData.cpp" css/html.css css/quirks.css css/view-source.css css/themeChromium.css css/themeChromiumAndroid.css css/themeChromiumLinux.css css/themeChromiumSkia.css css/themeMac.css css/themeWin.css css/themeWinQuirks.css css/svg.css css/mathml.css css/mediaControls.css css/mediaControlsAndroid.css css/fullscreen.css css/xhtmlmp.css css/viewportAndroid.css -- css/make-css-file-arrays.pl ../build/scripts/preprocessor.pm -- --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\"" --preprocessor "/usr/bin/gcc -E -P -x c++" --perl perl
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/action_useragentstylesheets.py "$(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h" "$(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheetsData.cpp" css/html.css css/quirks.css css/view-source.css css/themeChromium.css css/themeChromiumAndroid.css css/themeChromiumLinux.css css/themeChromiumSkia.css css/themeMac.css css/themeWin.css css/themeWinQuirks.css css/svg.css css/mathml.css css/mediaControls.css css/mediaControlsAndroid.css css/fullscreen.css css/xhtmlmp.css css/viewportAndroid.css -- css/make-css-file-arrays.pl ../build/scripts/preprocessor.pm -- --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_MEDIA_CAPTURE=1\" \"WTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1\" \"ENABLE_WEB_AUDIO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\"" --preprocessor "/usr/bin/gcc -E -P -x c++" --perl perl
 
 $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheetsData.cpp: $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h ;
 
 ### Rules for action "FetchInitiatorTypeNames":
 $(gyp_shared_intermediate_dir)/blink/FetchInitiatorTypeNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/FetchInitiatorTypeNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/FetchInitiatorTypeNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/FetchInitiatorTypeNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/FetchInitiatorTypeNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -264,6 +286,7 @@
 
 ### Rules for action "EventTypeNames":
 $(gyp_shared_intermediate_dir)/blink/EventTypeNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/EventTypeNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/EventTypeNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventTypeNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventTypeNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -275,6 +298,7 @@
 
 ### Rules for action "HTMLTokenizerNames":
 $(gyp_shared_intermediate_dir)/blink/HTMLTokenizerNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/HTMLTokenizerNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/HTMLTokenizerNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLTokenizerNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLTokenizerNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -286,6 +310,7 @@
 
 ### Rules for action "InputTypeNames":
 $(gyp_shared_intermediate_dir)/blink/InputTypeNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/InputTypeNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/InputTypeNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InputTypeNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InputTypeNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -297,6 +322,7 @@
 
 ### Rules for action "XLinkNames":
 $(gyp_shared_intermediate_dir)/blink/XLinkNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/XLinkNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/XLinkNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XLinkNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XLinkNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -308,6 +334,7 @@
 
 ### Rules for action "XMLNSNames":
 $(gyp_shared_intermediate_dir)/blink/XMLNSNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/XMLNSNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/XMLNSNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XMLNSNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XMLNSNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -319,6 +346,7 @@
 
 ### Rules for action "XMLNames":
 $(gyp_shared_intermediate_dir)/blink/XMLNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/XMLNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/XMLNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XMLNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XMLNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -330,6 +358,7 @@
 
 ### Rules for action "MakeTokenMatcher":
 $(gyp_shared_intermediate_dir)/blink/CSSTokenizer.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/CSSTokenizer.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/CSSTokenizer.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/CSSTokenizer.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/CSSTokenizer.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -340,6 +369,7 @@
 
 ### Rules for action "MakeParser":
 $(gyp_shared_intermediate_dir)/blink/BisonCSSParser.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/BisonCSSParser.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/BisonCSSParser.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/BisonCSSParser.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/BisonCSSParser.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -350,6 +380,7 @@
 
 ### Rules for action "MakeTokenMatcherForViewport":
 $(gyp_shared_intermediate_dir)/blink/HTMLMetaElement.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/HTMLMetaElement.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/HTMLMetaElement.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLMetaElement.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLMetaElement.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -360,6 +391,7 @@
 
 ### Rules for action "HTMLElementLookupTrie":
 $(gyp_shared_intermediate_dir)/blink/HTMLElementLookupTrie.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/HTMLElementLookupTrie.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/HTMLElementLookupTrie.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLElementLookupTrie.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLElementLookupTrie.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -374,6 +406,7 @@
 ### Generated for rule "third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_bison":
 # "{'action': ['python', '../build/scripts/rule_bison.py', '$(RULE_SOURCES)', '$(gyp_shared_intermediate_dir)/blink', 'bison'], 'rule_name': 'bison', 'rule_sources': ['css/CSSGrammar.y', 'xml/XPathGrammar.y'], 'extension': 'y', 'outputs': ['$(gyp_shared_intermediate_dir)/blink/%(INPUT_ROOT)s.cpp', '$(gyp_shared_intermediate_dir)/blink/%(INPUT_ROOT)s.h']}":
 $(gyp_shared_intermediate_dir)/blink/CSSGrammar.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/CSSGrammar.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/CSSGrammar.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/CSSGrammar.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/CSSGrammar.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -383,6 +416,7 @@
 $(gyp_shared_intermediate_dir)/blink/CSSGrammar.h: $(gyp_shared_intermediate_dir)/blink/CSSGrammar.cpp ;
 
 $(gyp_shared_intermediate_dir)/blink/XPathGrammar.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/XPathGrammar.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/XPathGrammar.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XPathGrammar.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XPathGrammar.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -488,7 +522,6 @@
 	-mfpmath=sse \
 	-mmmx \
 	-m32 \
-	-fuse-ld=gold \
 	-ffunction-sections \
 	-funwind-tables \
 	-g \
@@ -575,7 +608,6 @@
 	-mfpmath=sse \
 	-mmmx \
 	-m32 \
-	-fuse-ld=gold \
 	-ffunction-sections \
 	-funwind-tables \
 	-g \
diff --git a/Source/core/make_core_generated.target.darwin-x86_64.mk b/Source/core/make_core_generated.target.darwin-x86_64.mk
index c543ba2..ab272d5 100644
--- a/Source/core/make_core_generated.target.darwin-x86_64.mk
+++ b/Source/core/make_core_generated.target.darwin-x86_64.mk
@@ -19,6 +19,7 @@
 
 ### Rules for action "generateXMLViewerCSS":
 $(gyp_shared_intermediate_dir)/blink/XMLViewerCSS.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/XMLViewerCSS.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/XMLViewerCSS.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XMLViewerCSS.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XMLViewerCSS.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -29,6 +30,7 @@
 
 ### Rules for action "generateXMLViewerJS":
 $(gyp_shared_intermediate_dir)/blink/XMLViewerJS.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/XMLViewerJS.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/XMLViewerJS.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XMLViewerJS.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XMLViewerJS.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -39,6 +41,7 @@
 
 ### Rules for action "HTMLEntityTable":
 $(gyp_shared_intermediate_dir)/blink/HTMLEntityTable.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/HTMLEntityTable.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/HTMLEntityTable.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLEntityTable.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLEntityTable.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -49,59 +52,65 @@
 
 ### Rules for action "CSSPropertyNames":
 $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/hasher.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_css_property_names.py $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSPropertyNames.in $(LOCAL_PATH)/third_party/WebKit/Source/core/css/SVGCSSPropertyNames.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_CSSPropertyNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_css_property_names.py css/CSSPropertyNames.in css/SVGCSSPropertyNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --gperf gperf --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_css_property_names.py css/CSSPropertyNames.in css/SVGCSSPropertyNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --gperf gperf --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_MEDIA_CAPTURE=1\" \"WTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1\" \"ENABLE_WEB_AUDIO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.h: $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp ;
 
 ### Rules for action "MediaFeatureNames":
 $(gyp_shared_intermediate_dir)/blink/MediaFeatureNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/MediaFeatureNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/MediaFeatureNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MediaFeatureNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MediaFeatureNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/MediaFeatureNames.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/hasher.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_names.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeNames.cpp.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeNames.h.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_media_feature_names.py $(LOCAL_PATH)/third_party/WebKit/Source/core/css/MediaFeatureNames.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_MediaFeatureNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_media_feature_names.py css/MediaFeatureNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_media_feature_names.py css/MediaFeatureNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_MEDIA_CAPTURE=1\" \"WTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1\" \"ENABLE_WEB_AUDIO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/MediaFeatureNames.h: $(gyp_shared_intermediate_dir)/blink/MediaFeatureNames.cpp ;
 
 ### Rules for action "MediaFeatures":
 $(gyp_shared_intermediate_dir)/blink/MediaFeatures.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/MediaFeatures.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/MediaFeatures.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MediaFeatures.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MediaFeatures.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/MediaFeatures.h: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/hasher.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_media_features.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MediaFeatures.h.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/MediaFeatureNames.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_MediaFeatures ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_media_features.py css/MediaFeatureNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_media_features.py css/MediaFeatureNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_MEDIA_CAPTURE=1\" \"WTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1\" \"ENABLE_WEB_AUDIO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 
 ### Rules for action "MediaTypeNames":
 $(gyp_shared_intermediate_dir)/blink/MediaTypeNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/MediaTypeNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/MediaTypeNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MediaTypeNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MediaTypeNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/MediaTypeNames.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/hasher.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_names.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeNames.cpp.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeNames.h.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/MediaTypeNames.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_MediaTypeNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_names.py css/MediaTypeNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_names.py css/MediaTypeNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_MEDIA_CAPTURE=1\" \"WTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1\" \"ENABLE_WEB_AUDIO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/MediaTypeNames.h: $(gyp_shared_intermediate_dir)/blink/MediaTypeNames.cpp ;
 
 ### Rules for action "MediaQueryTokenizerCodepoints":
 $(gyp_shared_intermediate_dir)/blink/MediaQueryTokenizerCodepoints.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/MediaQueryTokenizerCodepoints.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/MediaQueryTokenizerCodepoints.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MediaQueryTokenizerCodepoints.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MediaQueryTokenizerCodepoints.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/MediaQueryTokenizerCodepoints.cpp: $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_mediaquery_tokenizer_codepoints.py $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_MediaQueryTokenizerCodepoints ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_mediaquery_tokenizer_codepoints.py --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_mediaquery_tokenizer_codepoints.py --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_MEDIA_CAPTURE=1\" \"WTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1\" \"ENABLE_WEB_AUDIO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 
 ### Rules for action "StylePropertyShorthand":
 $(gyp_shared_intermediate_dir)/blink/StylePropertyShorthand.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/StylePropertyShorthand.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/StylePropertyShorthand.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/StylePropertyShorthand.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/StylePropertyShorthand.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -113,6 +122,7 @@
 
 ### Rules for action "StyleBuilder":
 $(gyp_shared_intermediate_dir)/blink/StyleBuilder.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/StyleBuilder.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/StyleBuilder.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/StyleBuilder.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/StyleBuilder.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -125,17 +135,19 @@
 
 ### Rules for action "CSSValueKeywords":
 $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/hasher.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_css_value_keywords.py $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSValueKeywords.in $(LOCAL_PATH)/third_party/WebKit/Source/core/css/SVGCSSValueKeywords.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_CSSValueKeywords ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_css_value_keywords.py css/CSSValueKeywords.in css/SVGCSSValueKeywords.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --gperf gperf --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_css_value_keywords.py css/CSSValueKeywords.in css/SVGCSSValueKeywords.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --gperf gperf --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_MEDIA_CAPTURE=1\" \"WTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1\" \"ENABLE_WEB_AUDIO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.h: $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp ;
 
 ### Rules for action "HTMLElementFactory":
 $(gyp_shared_intermediate_dir)/blink/HTMLElementFactory.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/HTMLElementFactory.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/HTMLElementFactory.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLElementFactory.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLElementFactory.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -151,6 +163,7 @@
 
 ### Rules for action "HTMLElementTypeHelpers":
 $(gyp_shared_intermediate_dir)/blink/HTMLElementTypeHelpers.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/HTMLElementTypeHelpers.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/HTMLElementTypeHelpers.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLElementTypeHelpers.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLElementTypeHelpers.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -161,6 +174,7 @@
 
 ### Rules for action "SVGNames":
 $(gyp_shared_intermediate_dir)/blink/SVGElementFactory.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/SVGElementFactory.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/SVGElementFactory.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/SVGElementFactory.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/SVGElementFactory.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -176,6 +190,7 @@
 
 ### Rules for action "SVGElementTypeHelpers":
 $(gyp_shared_intermediate_dir)/blink/SVGElementTypeHelpers.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/SVGElementTypeHelpers.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/SVGElementTypeHelpers.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/SVGElementTypeHelpers.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/SVGElementTypeHelpers.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -186,6 +201,7 @@
 
 ### Rules for action "EventFactory":
 $(gyp_shared_intermediate_dir)/blink/Event.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/Event.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/Event.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/Event.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/Event.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -198,6 +214,7 @@
 
 ### Rules for action "EventNames":
 $(gyp_shared_intermediate_dir)/blink/EventNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/EventNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/EventNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -209,6 +226,7 @@
 
 ### Rules for action "EventTargetFactory":
 $(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -220,6 +238,7 @@
 
 ### Rules for action "EventTargetNames":
 $(gyp_shared_intermediate_dir)/blink/EventTargetNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/EventTargetNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/EventTargetNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventTargetNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventTargetNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -231,28 +250,31 @@
 
 ### Rules for action "MathMLNames":
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/hasher.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_qualified_names.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeQualifiedNames.cpp.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeQualifiedNames.h.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/parser/MathMLTagNames.in $(LOCAL_PATH)/third_party/WebKit/Source/core/html/parser/MathMLAttributeNames.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_MathMLNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_qualified_names.py html/parser/MathMLTagNames.in html/parser/MathMLAttributeNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_qualified_names.py html/parser/MathMLTagNames.in html/parser/MathMLAttributeNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_MEDIA_CAPTURE=1\" \"WTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1\" \"ENABLE_WEB_AUDIO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.h: $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp ;
 
 ### Rules for action "UserAgentStyleSheets":
 $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h: $(LOCAL_PATH)/third_party/WebKit/Source/core/css/make-css-file-arrays.pl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/preprocessor.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/css/html.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/quirks.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/view-source.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeChromium.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeChromiumAndroid.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeChromiumLinux.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeChromiumSkia.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeMac.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeWin.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeWinQuirks.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/svg.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/mathml.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/mediaControls.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/mediaControlsAndroid.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/fullscreen.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/xhtmlmp.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/viewportAndroid.css $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_UserAgentStyleSheets ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/action_useragentstylesheets.py "$(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h" "$(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheetsData.cpp" css/html.css css/quirks.css css/view-source.css css/themeChromium.css css/themeChromiumAndroid.css css/themeChromiumLinux.css css/themeChromiumSkia.css css/themeMac.css css/themeWin.css css/themeWinQuirks.css css/svg.css css/mathml.css css/mediaControls.css css/mediaControlsAndroid.css css/fullscreen.css css/xhtmlmp.css css/viewportAndroid.css -- css/make-css-file-arrays.pl ../build/scripts/preprocessor.pm -- --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\"" --preprocessor "/usr/bin/gcc -E -P -x c++" --perl perl
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/action_useragentstylesheets.py "$(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h" "$(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheetsData.cpp" css/html.css css/quirks.css css/view-source.css css/themeChromium.css css/themeChromiumAndroid.css css/themeChromiumLinux.css css/themeChromiumSkia.css css/themeMac.css css/themeWin.css css/themeWinQuirks.css css/svg.css css/mathml.css css/mediaControls.css css/mediaControlsAndroid.css css/fullscreen.css css/xhtmlmp.css css/viewportAndroid.css -- css/make-css-file-arrays.pl ../build/scripts/preprocessor.pm -- --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_MEDIA_CAPTURE=1\" \"WTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1\" \"ENABLE_WEB_AUDIO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\"" --preprocessor "/usr/bin/gcc -E -P -x c++" --perl perl
 
 $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheetsData.cpp: $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h ;
 
 ### Rules for action "FetchInitiatorTypeNames":
 $(gyp_shared_intermediate_dir)/blink/FetchInitiatorTypeNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/FetchInitiatorTypeNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/FetchInitiatorTypeNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/FetchInitiatorTypeNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/FetchInitiatorTypeNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -264,6 +286,7 @@
 
 ### Rules for action "EventTypeNames":
 $(gyp_shared_intermediate_dir)/blink/EventTypeNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/EventTypeNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/EventTypeNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventTypeNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventTypeNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -275,6 +298,7 @@
 
 ### Rules for action "HTMLTokenizerNames":
 $(gyp_shared_intermediate_dir)/blink/HTMLTokenizerNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/HTMLTokenizerNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/HTMLTokenizerNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLTokenizerNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLTokenizerNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -286,6 +310,7 @@
 
 ### Rules for action "InputTypeNames":
 $(gyp_shared_intermediate_dir)/blink/InputTypeNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/InputTypeNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/InputTypeNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InputTypeNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InputTypeNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -297,6 +322,7 @@
 
 ### Rules for action "XLinkNames":
 $(gyp_shared_intermediate_dir)/blink/XLinkNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/XLinkNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/XLinkNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XLinkNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XLinkNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -308,6 +334,7 @@
 
 ### Rules for action "XMLNSNames":
 $(gyp_shared_intermediate_dir)/blink/XMLNSNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/XMLNSNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/XMLNSNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XMLNSNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XMLNSNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -319,6 +346,7 @@
 
 ### Rules for action "XMLNames":
 $(gyp_shared_intermediate_dir)/blink/XMLNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/XMLNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/XMLNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XMLNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XMLNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -330,6 +358,7 @@
 
 ### Rules for action "MakeTokenMatcher":
 $(gyp_shared_intermediate_dir)/blink/CSSTokenizer.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/CSSTokenizer.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/CSSTokenizer.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/CSSTokenizer.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/CSSTokenizer.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -340,6 +369,7 @@
 
 ### Rules for action "MakeParser":
 $(gyp_shared_intermediate_dir)/blink/BisonCSSParser.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/BisonCSSParser.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/BisonCSSParser.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/BisonCSSParser.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/BisonCSSParser.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -350,6 +380,7 @@
 
 ### Rules for action "MakeTokenMatcherForViewport":
 $(gyp_shared_intermediate_dir)/blink/HTMLMetaElement.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/HTMLMetaElement.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/HTMLMetaElement.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLMetaElement.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLMetaElement.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -360,6 +391,7 @@
 
 ### Rules for action "HTMLElementLookupTrie":
 $(gyp_shared_intermediate_dir)/blink/HTMLElementLookupTrie.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/HTMLElementLookupTrie.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/HTMLElementLookupTrie.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLElementLookupTrie.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLElementLookupTrie.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -374,6 +406,7 @@
 ### Generated for rule "third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_bison":
 # "{'action': ['python', '../build/scripts/rule_bison.py', '$(RULE_SOURCES)', '$(gyp_shared_intermediate_dir)/blink', 'bison'], 'rule_name': 'bison', 'rule_sources': ['css/CSSGrammar.y', 'xml/XPathGrammar.y'], 'extension': 'y', 'outputs': ['$(gyp_shared_intermediate_dir)/blink/%(INPUT_ROOT)s.cpp', '$(gyp_shared_intermediate_dir)/blink/%(INPUT_ROOT)s.h']}":
 $(gyp_shared_intermediate_dir)/blink/CSSGrammar.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/CSSGrammar.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/CSSGrammar.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/CSSGrammar.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/CSSGrammar.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -383,6 +416,7 @@
 $(gyp_shared_intermediate_dir)/blink/CSSGrammar.h: $(gyp_shared_intermediate_dir)/blink/CSSGrammar.cpp ;
 
 $(gyp_shared_intermediate_dir)/blink/XPathGrammar.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/XPathGrammar.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/XPathGrammar.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XPathGrammar.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XPathGrammar.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -488,7 +522,6 @@
 	-Wno-unused-local-typedefs \
 	-m64 \
 	-march=x86-64 \
-	-fuse-ld=gold \
 	-ffunction-sections \
 	-funwind-tables \
 	-g \
@@ -575,7 +608,6 @@
 	-Wno-unused-local-typedefs \
 	-m64 \
 	-march=x86-64 \
-	-fuse-ld=gold \
 	-ffunction-sections \
 	-funwind-tables \
 	-g \
diff --git a/Source/core/make_core_generated.target.linux-arm.mk b/Source/core/make_core_generated.target.linux-arm.mk
index d37313d..24b552f 100644
--- a/Source/core/make_core_generated.target.linux-arm.mk
+++ b/Source/core/make_core_generated.target.linux-arm.mk
@@ -19,6 +19,7 @@
 
 ### Rules for action "generateXMLViewerCSS":
 $(gyp_shared_intermediate_dir)/blink/XMLViewerCSS.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/XMLViewerCSS.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/XMLViewerCSS.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XMLViewerCSS.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XMLViewerCSS.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -29,6 +30,7 @@
 
 ### Rules for action "generateXMLViewerJS":
 $(gyp_shared_intermediate_dir)/blink/XMLViewerJS.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/XMLViewerJS.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/XMLViewerJS.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XMLViewerJS.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XMLViewerJS.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -39,6 +41,7 @@
 
 ### Rules for action "HTMLEntityTable":
 $(gyp_shared_intermediate_dir)/blink/HTMLEntityTable.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/HTMLEntityTable.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/HTMLEntityTable.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLEntityTable.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLEntityTable.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -49,59 +52,65 @@
 
 ### Rules for action "CSSPropertyNames":
 $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/hasher.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_css_property_names.py $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSPropertyNames.in $(LOCAL_PATH)/third_party/WebKit/Source/core/css/SVGCSSPropertyNames.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_CSSPropertyNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_css_property_names.py css/CSSPropertyNames.in css/SVGCSSPropertyNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --gperf gperf --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_css_property_names.py css/CSSPropertyNames.in css/SVGCSSPropertyNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --gperf gperf --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_MEDIA_CAPTURE=1\" \"WTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1\" \"ENABLE_WEB_AUDIO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.h: $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp ;
 
 ### Rules for action "MediaFeatureNames":
 $(gyp_shared_intermediate_dir)/blink/MediaFeatureNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/MediaFeatureNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/MediaFeatureNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MediaFeatureNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MediaFeatureNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/MediaFeatureNames.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/hasher.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_names.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeNames.cpp.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeNames.h.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_media_feature_names.py $(LOCAL_PATH)/third_party/WebKit/Source/core/css/MediaFeatureNames.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_MediaFeatureNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_media_feature_names.py css/MediaFeatureNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_media_feature_names.py css/MediaFeatureNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_MEDIA_CAPTURE=1\" \"WTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1\" \"ENABLE_WEB_AUDIO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/MediaFeatureNames.h: $(gyp_shared_intermediate_dir)/blink/MediaFeatureNames.cpp ;
 
 ### Rules for action "MediaFeatures":
 $(gyp_shared_intermediate_dir)/blink/MediaFeatures.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/MediaFeatures.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/MediaFeatures.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MediaFeatures.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MediaFeatures.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/MediaFeatures.h: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/hasher.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_media_features.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MediaFeatures.h.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/MediaFeatureNames.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_MediaFeatures ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_media_features.py css/MediaFeatureNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_media_features.py css/MediaFeatureNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_MEDIA_CAPTURE=1\" \"WTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1\" \"ENABLE_WEB_AUDIO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 
 ### Rules for action "MediaTypeNames":
 $(gyp_shared_intermediate_dir)/blink/MediaTypeNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/MediaTypeNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/MediaTypeNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MediaTypeNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MediaTypeNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/MediaTypeNames.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/hasher.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_names.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeNames.cpp.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeNames.h.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/MediaTypeNames.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_MediaTypeNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_names.py css/MediaTypeNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_names.py css/MediaTypeNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_MEDIA_CAPTURE=1\" \"WTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1\" \"ENABLE_WEB_AUDIO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/MediaTypeNames.h: $(gyp_shared_intermediate_dir)/blink/MediaTypeNames.cpp ;
 
 ### Rules for action "MediaQueryTokenizerCodepoints":
 $(gyp_shared_intermediate_dir)/blink/MediaQueryTokenizerCodepoints.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/MediaQueryTokenizerCodepoints.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/MediaQueryTokenizerCodepoints.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MediaQueryTokenizerCodepoints.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MediaQueryTokenizerCodepoints.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/MediaQueryTokenizerCodepoints.cpp: $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_mediaquery_tokenizer_codepoints.py $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_MediaQueryTokenizerCodepoints ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_mediaquery_tokenizer_codepoints.py --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_mediaquery_tokenizer_codepoints.py --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_MEDIA_CAPTURE=1\" \"WTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1\" \"ENABLE_WEB_AUDIO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 
 ### Rules for action "StylePropertyShorthand":
 $(gyp_shared_intermediate_dir)/blink/StylePropertyShorthand.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/StylePropertyShorthand.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/StylePropertyShorthand.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/StylePropertyShorthand.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/StylePropertyShorthand.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -113,6 +122,7 @@
 
 ### Rules for action "StyleBuilder":
 $(gyp_shared_intermediate_dir)/blink/StyleBuilder.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/StyleBuilder.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/StyleBuilder.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/StyleBuilder.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/StyleBuilder.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -125,17 +135,19 @@
 
 ### Rules for action "CSSValueKeywords":
 $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/hasher.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_css_value_keywords.py $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSValueKeywords.in $(LOCAL_PATH)/third_party/WebKit/Source/core/css/SVGCSSValueKeywords.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_CSSValueKeywords ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_css_value_keywords.py css/CSSValueKeywords.in css/SVGCSSValueKeywords.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --gperf gperf --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_css_value_keywords.py css/CSSValueKeywords.in css/SVGCSSValueKeywords.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --gperf gperf --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_MEDIA_CAPTURE=1\" \"WTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1\" \"ENABLE_WEB_AUDIO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.h: $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp ;
 
 ### Rules for action "HTMLElementFactory":
 $(gyp_shared_intermediate_dir)/blink/HTMLElementFactory.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/HTMLElementFactory.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/HTMLElementFactory.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLElementFactory.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLElementFactory.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -151,6 +163,7 @@
 
 ### Rules for action "HTMLElementTypeHelpers":
 $(gyp_shared_intermediate_dir)/blink/HTMLElementTypeHelpers.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/HTMLElementTypeHelpers.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/HTMLElementTypeHelpers.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLElementTypeHelpers.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLElementTypeHelpers.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -161,6 +174,7 @@
 
 ### Rules for action "SVGNames":
 $(gyp_shared_intermediate_dir)/blink/SVGElementFactory.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/SVGElementFactory.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/SVGElementFactory.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/SVGElementFactory.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/SVGElementFactory.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -176,6 +190,7 @@
 
 ### Rules for action "SVGElementTypeHelpers":
 $(gyp_shared_intermediate_dir)/blink/SVGElementTypeHelpers.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/SVGElementTypeHelpers.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/SVGElementTypeHelpers.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/SVGElementTypeHelpers.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/SVGElementTypeHelpers.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -186,6 +201,7 @@
 
 ### Rules for action "EventFactory":
 $(gyp_shared_intermediate_dir)/blink/Event.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/Event.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/Event.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/Event.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/Event.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -198,6 +214,7 @@
 
 ### Rules for action "EventNames":
 $(gyp_shared_intermediate_dir)/blink/EventNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/EventNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/EventNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -209,6 +226,7 @@
 
 ### Rules for action "EventTargetFactory":
 $(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -220,6 +238,7 @@
 
 ### Rules for action "EventTargetNames":
 $(gyp_shared_intermediate_dir)/blink/EventTargetNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/EventTargetNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/EventTargetNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventTargetNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventTargetNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -231,28 +250,31 @@
 
 ### Rules for action "MathMLNames":
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/hasher.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_qualified_names.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeQualifiedNames.cpp.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeQualifiedNames.h.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/parser/MathMLTagNames.in $(LOCAL_PATH)/third_party/WebKit/Source/core/html/parser/MathMLAttributeNames.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_MathMLNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_qualified_names.py html/parser/MathMLTagNames.in html/parser/MathMLAttributeNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_qualified_names.py html/parser/MathMLTagNames.in html/parser/MathMLAttributeNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_MEDIA_CAPTURE=1\" \"WTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1\" \"ENABLE_WEB_AUDIO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.h: $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp ;
 
 ### Rules for action "UserAgentStyleSheets":
 $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h: $(LOCAL_PATH)/third_party/WebKit/Source/core/css/make-css-file-arrays.pl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/preprocessor.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/css/html.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/quirks.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/view-source.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeChromium.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeChromiumAndroid.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeChromiumLinux.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeChromiumSkia.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeMac.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeWin.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeWinQuirks.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/svg.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/mathml.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/mediaControls.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/mediaControlsAndroid.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/fullscreen.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/xhtmlmp.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/viewportAndroid.css $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_UserAgentStyleSheets ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/action_useragentstylesheets.py "$(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h" "$(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheetsData.cpp" css/html.css css/quirks.css css/view-source.css css/themeChromium.css css/themeChromiumAndroid.css css/themeChromiumLinux.css css/themeChromiumSkia.css css/themeMac.css css/themeWin.css css/themeWinQuirks.css css/svg.css css/mathml.css css/mediaControls.css css/mediaControlsAndroid.css css/fullscreen.css css/xhtmlmp.css css/viewportAndroid.css -- css/make-css-file-arrays.pl ../build/scripts/preprocessor.pm -- --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\"" --preprocessor "/usr/bin/gcc -E -P -x c++" --perl perl
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/action_useragentstylesheets.py "$(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h" "$(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheetsData.cpp" css/html.css css/quirks.css css/view-source.css css/themeChromium.css css/themeChromiumAndroid.css css/themeChromiumLinux.css css/themeChromiumSkia.css css/themeMac.css css/themeWin.css css/themeWinQuirks.css css/svg.css css/mathml.css css/mediaControls.css css/mediaControlsAndroid.css css/fullscreen.css css/xhtmlmp.css css/viewportAndroid.css -- css/make-css-file-arrays.pl ../build/scripts/preprocessor.pm -- --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_MEDIA_CAPTURE=1\" \"WTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1\" \"ENABLE_WEB_AUDIO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\"" --preprocessor "/usr/bin/gcc -E -P -x c++" --perl perl
 
 $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheetsData.cpp: $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h ;
 
 ### Rules for action "FetchInitiatorTypeNames":
 $(gyp_shared_intermediate_dir)/blink/FetchInitiatorTypeNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/FetchInitiatorTypeNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/FetchInitiatorTypeNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/FetchInitiatorTypeNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/FetchInitiatorTypeNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -264,6 +286,7 @@
 
 ### Rules for action "EventTypeNames":
 $(gyp_shared_intermediate_dir)/blink/EventTypeNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/EventTypeNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/EventTypeNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventTypeNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventTypeNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -275,6 +298,7 @@
 
 ### Rules for action "HTMLTokenizerNames":
 $(gyp_shared_intermediate_dir)/blink/HTMLTokenizerNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/HTMLTokenizerNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/HTMLTokenizerNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLTokenizerNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLTokenizerNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -286,6 +310,7 @@
 
 ### Rules for action "InputTypeNames":
 $(gyp_shared_intermediate_dir)/blink/InputTypeNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/InputTypeNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/InputTypeNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InputTypeNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InputTypeNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -297,6 +322,7 @@
 
 ### Rules for action "XLinkNames":
 $(gyp_shared_intermediate_dir)/blink/XLinkNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/XLinkNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/XLinkNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XLinkNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XLinkNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -308,6 +334,7 @@
 
 ### Rules for action "XMLNSNames":
 $(gyp_shared_intermediate_dir)/blink/XMLNSNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/XMLNSNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/XMLNSNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XMLNSNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XMLNSNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -319,6 +346,7 @@
 
 ### Rules for action "XMLNames":
 $(gyp_shared_intermediate_dir)/blink/XMLNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/XMLNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/XMLNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XMLNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XMLNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -330,6 +358,7 @@
 
 ### Rules for action "MakeTokenMatcher":
 $(gyp_shared_intermediate_dir)/blink/CSSTokenizer.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/CSSTokenizer.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/CSSTokenizer.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/CSSTokenizer.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/CSSTokenizer.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -340,6 +369,7 @@
 
 ### Rules for action "MakeParser":
 $(gyp_shared_intermediate_dir)/blink/BisonCSSParser.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/BisonCSSParser.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/BisonCSSParser.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/BisonCSSParser.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/BisonCSSParser.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -350,6 +380,7 @@
 
 ### Rules for action "MakeTokenMatcherForViewport":
 $(gyp_shared_intermediate_dir)/blink/HTMLMetaElement.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/HTMLMetaElement.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/HTMLMetaElement.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLMetaElement.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLMetaElement.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -360,6 +391,7 @@
 
 ### Rules for action "HTMLElementLookupTrie":
 $(gyp_shared_intermediate_dir)/blink/HTMLElementLookupTrie.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/HTMLElementLookupTrie.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/HTMLElementLookupTrie.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLElementLookupTrie.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLElementLookupTrie.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -374,6 +406,7 @@
 ### Generated for rule "third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_bison":
 # "{'action': ['python', '../build/scripts/rule_bison.py', '$(RULE_SOURCES)', '$(gyp_shared_intermediate_dir)/blink', 'bison'], 'rule_name': 'bison', 'rule_sources': ['css/CSSGrammar.y', 'xml/XPathGrammar.y'], 'extension': 'y', 'outputs': ['$(gyp_shared_intermediate_dir)/blink/%(INPUT_ROOT)s.cpp', '$(gyp_shared_intermediate_dir)/blink/%(INPUT_ROOT)s.h']}":
 $(gyp_shared_intermediate_dir)/blink/CSSGrammar.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/CSSGrammar.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/CSSGrammar.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/CSSGrammar.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/CSSGrammar.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -383,6 +416,7 @@
 $(gyp_shared_intermediate_dir)/blink/CSSGrammar.h: $(gyp_shared_intermediate_dir)/blink/CSSGrammar.cpp ;
 
 $(gyp_shared_intermediate_dir)/blink/XPathGrammar.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/XPathGrammar.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/XPathGrammar.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XPathGrammar.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XPathGrammar.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -486,7 +520,6 @@
 	-pipe \
 	-fPIC \
 	-fno-tree-sra \
-	-fuse-ld=gold \
 	-Wno-psabi \
 	-ffunction-sections \
 	-funwind-tables \
@@ -573,7 +606,6 @@
 	-pipe \
 	-fPIC \
 	-fno-tree-sra \
-	-fuse-ld=gold \
 	-Wno-psabi \
 	-ffunction-sections \
 	-funwind-tables \
diff --git a/Source/core/make_core_generated.target.linux-arm64.mk b/Source/core/make_core_generated.target.linux-arm64.mk
index 4c3af11..69b90b8 100644
--- a/Source/core/make_core_generated.target.linux-arm64.mk
+++ b/Source/core/make_core_generated.target.linux-arm64.mk
@@ -19,6 +19,7 @@
 
 ### Rules for action "generateXMLViewerCSS":
 $(gyp_shared_intermediate_dir)/blink/XMLViewerCSS.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/XMLViewerCSS.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/XMLViewerCSS.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XMLViewerCSS.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XMLViewerCSS.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -29,6 +30,7 @@
 
 ### Rules for action "generateXMLViewerJS":
 $(gyp_shared_intermediate_dir)/blink/XMLViewerJS.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/XMLViewerJS.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/XMLViewerJS.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XMLViewerJS.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XMLViewerJS.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -39,6 +41,7 @@
 
 ### Rules for action "HTMLEntityTable":
 $(gyp_shared_intermediate_dir)/blink/HTMLEntityTable.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/HTMLEntityTable.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/HTMLEntityTable.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLEntityTable.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLEntityTable.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -49,59 +52,65 @@
 
 ### Rules for action "CSSPropertyNames":
 $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/hasher.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_css_property_names.py $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSPropertyNames.in $(LOCAL_PATH)/third_party/WebKit/Source/core/css/SVGCSSPropertyNames.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_CSSPropertyNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_css_property_names.py css/CSSPropertyNames.in css/SVGCSSPropertyNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --gperf gperf --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_css_property_names.py css/CSSPropertyNames.in css/SVGCSSPropertyNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --gperf gperf --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.h: $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp ;
 
 ### Rules for action "MediaFeatureNames":
 $(gyp_shared_intermediate_dir)/blink/MediaFeatureNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/MediaFeatureNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/MediaFeatureNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MediaFeatureNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MediaFeatureNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/MediaFeatureNames.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/hasher.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_names.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeNames.cpp.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeNames.h.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_media_feature_names.py $(LOCAL_PATH)/third_party/WebKit/Source/core/css/MediaFeatureNames.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_MediaFeatureNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_media_feature_names.py css/MediaFeatureNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_media_feature_names.py css/MediaFeatureNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/MediaFeatureNames.h: $(gyp_shared_intermediate_dir)/blink/MediaFeatureNames.cpp ;
 
 ### Rules for action "MediaFeatures":
 $(gyp_shared_intermediate_dir)/blink/MediaFeatures.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/MediaFeatures.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/MediaFeatures.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MediaFeatures.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MediaFeatures.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/MediaFeatures.h: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/hasher.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_media_features.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MediaFeatures.h.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/MediaFeatureNames.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_MediaFeatures ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_media_features.py css/MediaFeatureNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_media_features.py css/MediaFeatureNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 
 ### Rules for action "MediaTypeNames":
 $(gyp_shared_intermediate_dir)/blink/MediaTypeNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/MediaTypeNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/MediaTypeNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MediaTypeNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MediaTypeNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/MediaTypeNames.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/hasher.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_names.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeNames.cpp.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeNames.h.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/MediaTypeNames.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_MediaTypeNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_names.py css/MediaTypeNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_names.py css/MediaTypeNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/MediaTypeNames.h: $(gyp_shared_intermediate_dir)/blink/MediaTypeNames.cpp ;
 
 ### Rules for action "MediaQueryTokenizerCodepoints":
 $(gyp_shared_intermediate_dir)/blink/MediaQueryTokenizerCodepoints.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/MediaQueryTokenizerCodepoints.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/MediaQueryTokenizerCodepoints.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MediaQueryTokenizerCodepoints.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MediaQueryTokenizerCodepoints.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/MediaQueryTokenizerCodepoints.cpp: $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_mediaquery_tokenizer_codepoints.py $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_MediaQueryTokenizerCodepoints ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_mediaquery_tokenizer_codepoints.py --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_mediaquery_tokenizer_codepoints.py --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 
 ### Rules for action "StylePropertyShorthand":
 $(gyp_shared_intermediate_dir)/blink/StylePropertyShorthand.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/StylePropertyShorthand.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/StylePropertyShorthand.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/StylePropertyShorthand.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/StylePropertyShorthand.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -113,6 +122,7 @@
 
 ### Rules for action "StyleBuilder":
 $(gyp_shared_intermediate_dir)/blink/StyleBuilder.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/StyleBuilder.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/StyleBuilder.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/StyleBuilder.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/StyleBuilder.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -125,17 +135,19 @@
 
 ### Rules for action "CSSValueKeywords":
 $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/hasher.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_css_value_keywords.py $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSValueKeywords.in $(LOCAL_PATH)/third_party/WebKit/Source/core/css/SVGCSSValueKeywords.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_CSSValueKeywords ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_css_value_keywords.py css/CSSValueKeywords.in css/SVGCSSValueKeywords.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --gperf gperf --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_css_value_keywords.py css/CSSValueKeywords.in css/SVGCSSValueKeywords.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --gperf gperf --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.h: $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp ;
 
 ### Rules for action "HTMLElementFactory":
 $(gyp_shared_intermediate_dir)/blink/HTMLElementFactory.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/HTMLElementFactory.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/HTMLElementFactory.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLElementFactory.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLElementFactory.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -151,6 +163,7 @@
 
 ### Rules for action "HTMLElementTypeHelpers":
 $(gyp_shared_intermediate_dir)/blink/HTMLElementTypeHelpers.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/HTMLElementTypeHelpers.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/HTMLElementTypeHelpers.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLElementTypeHelpers.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLElementTypeHelpers.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -161,6 +174,7 @@
 
 ### Rules for action "SVGNames":
 $(gyp_shared_intermediate_dir)/blink/SVGElementFactory.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/SVGElementFactory.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/SVGElementFactory.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/SVGElementFactory.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/SVGElementFactory.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -176,6 +190,7 @@
 
 ### Rules for action "SVGElementTypeHelpers":
 $(gyp_shared_intermediate_dir)/blink/SVGElementTypeHelpers.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/SVGElementTypeHelpers.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/SVGElementTypeHelpers.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/SVGElementTypeHelpers.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/SVGElementTypeHelpers.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -186,6 +201,7 @@
 
 ### Rules for action "EventFactory":
 $(gyp_shared_intermediate_dir)/blink/Event.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/Event.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/Event.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/Event.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/Event.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -198,6 +214,7 @@
 
 ### Rules for action "EventNames":
 $(gyp_shared_intermediate_dir)/blink/EventNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/EventNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/EventNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -209,6 +226,7 @@
 
 ### Rules for action "EventTargetFactory":
 $(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -220,6 +238,7 @@
 
 ### Rules for action "EventTargetNames":
 $(gyp_shared_intermediate_dir)/blink/EventTargetNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/EventTargetNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/EventTargetNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventTargetNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventTargetNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -231,28 +250,31 @@
 
 ### Rules for action "MathMLNames":
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/hasher.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_qualified_names.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeQualifiedNames.cpp.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeQualifiedNames.h.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/parser/MathMLTagNames.in $(LOCAL_PATH)/third_party/WebKit/Source/core/html/parser/MathMLAttributeNames.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_MathMLNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_qualified_names.py html/parser/MathMLTagNames.in html/parser/MathMLAttributeNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_qualified_names.py html/parser/MathMLTagNames.in html/parser/MathMLAttributeNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.h: $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp ;
 
 ### Rules for action "UserAgentStyleSheets":
 $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h: $(LOCAL_PATH)/third_party/WebKit/Source/core/css/make-css-file-arrays.pl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/preprocessor.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/css/html.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/quirks.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/view-source.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeChromium.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeChromiumAndroid.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeChromiumLinux.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeChromiumSkia.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeMac.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeWin.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeWinQuirks.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/svg.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/mathml.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/mediaControls.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/mediaControlsAndroid.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/fullscreen.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/xhtmlmp.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/viewportAndroid.css $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_UserAgentStyleSheets ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/action_useragentstylesheets.py "$(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h" "$(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheetsData.cpp" css/html.css css/quirks.css css/view-source.css css/themeChromium.css css/themeChromiumAndroid.css css/themeChromiumLinux.css css/themeChromiumSkia.css css/themeMac.css css/themeWin.css css/themeWinQuirks.css css/svg.css css/mathml.css css/mediaControls.css css/mediaControlsAndroid.css css/fullscreen.css css/xhtmlmp.css css/viewportAndroid.css -- css/make-css-file-arrays.pl ../build/scripts/preprocessor.pm -- --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\"" --preprocessor "/usr/bin/gcc -E -P -x c++" --perl perl
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/action_useragentstylesheets.py "$(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h" "$(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheetsData.cpp" css/html.css css/quirks.css css/view-source.css css/themeChromium.css css/themeChromiumAndroid.css css/themeChromiumLinux.css css/themeChromiumSkia.css css/themeMac.css css/themeWin.css css/themeWinQuirks.css css/svg.css css/mathml.css css/mediaControls.css css/mediaControlsAndroid.css css/fullscreen.css css/xhtmlmp.css css/viewportAndroid.css -- css/make-css-file-arrays.pl ../build/scripts/preprocessor.pm -- --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\"" --preprocessor "/usr/bin/gcc -E -P -x c++" --perl perl
 
 $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheetsData.cpp: $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h ;
 
 ### Rules for action "FetchInitiatorTypeNames":
 $(gyp_shared_intermediate_dir)/blink/FetchInitiatorTypeNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/FetchInitiatorTypeNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/FetchInitiatorTypeNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/FetchInitiatorTypeNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/FetchInitiatorTypeNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -264,6 +286,7 @@
 
 ### Rules for action "EventTypeNames":
 $(gyp_shared_intermediate_dir)/blink/EventTypeNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/EventTypeNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/EventTypeNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventTypeNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventTypeNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -275,6 +298,7 @@
 
 ### Rules for action "HTMLTokenizerNames":
 $(gyp_shared_intermediate_dir)/blink/HTMLTokenizerNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/HTMLTokenizerNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/HTMLTokenizerNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLTokenizerNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLTokenizerNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -286,6 +310,7 @@
 
 ### Rules for action "InputTypeNames":
 $(gyp_shared_intermediate_dir)/blink/InputTypeNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/InputTypeNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/InputTypeNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InputTypeNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InputTypeNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -297,6 +322,7 @@
 
 ### Rules for action "XLinkNames":
 $(gyp_shared_intermediate_dir)/blink/XLinkNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/XLinkNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/XLinkNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XLinkNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XLinkNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -308,6 +334,7 @@
 
 ### Rules for action "XMLNSNames":
 $(gyp_shared_intermediate_dir)/blink/XMLNSNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/XMLNSNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/XMLNSNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XMLNSNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XMLNSNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -319,6 +346,7 @@
 
 ### Rules for action "XMLNames":
 $(gyp_shared_intermediate_dir)/blink/XMLNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/XMLNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/XMLNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XMLNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XMLNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -330,6 +358,7 @@
 
 ### Rules for action "MakeTokenMatcher":
 $(gyp_shared_intermediate_dir)/blink/CSSTokenizer.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/CSSTokenizer.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/CSSTokenizer.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/CSSTokenizer.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/CSSTokenizer.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -340,6 +369,7 @@
 
 ### Rules for action "MakeParser":
 $(gyp_shared_intermediate_dir)/blink/BisonCSSParser.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/BisonCSSParser.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/BisonCSSParser.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/BisonCSSParser.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/BisonCSSParser.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -350,6 +380,7 @@
 
 ### Rules for action "MakeTokenMatcherForViewport":
 $(gyp_shared_intermediate_dir)/blink/HTMLMetaElement.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/HTMLMetaElement.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/HTMLMetaElement.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLMetaElement.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLMetaElement.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -360,6 +391,7 @@
 
 ### Rules for action "HTMLElementLookupTrie":
 $(gyp_shared_intermediate_dir)/blink/HTMLElementLookupTrie.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/HTMLElementLookupTrie.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/HTMLElementLookupTrie.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLElementLookupTrie.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLElementLookupTrie.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -374,6 +406,7 @@
 ### Generated for rule "third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_bison":
 # "{'action': ['python', '../build/scripts/rule_bison.py', '$(RULE_SOURCES)', '$(gyp_shared_intermediate_dir)/blink', 'bison'], 'rule_name': 'bison', 'rule_sources': ['css/CSSGrammar.y', 'xml/XPathGrammar.y'], 'extension': 'y', 'outputs': ['$(gyp_shared_intermediate_dir)/blink/%(INPUT_ROOT)s.cpp', '$(gyp_shared_intermediate_dir)/blink/%(INPUT_ROOT)s.h']}":
 $(gyp_shared_intermediate_dir)/blink/CSSGrammar.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/CSSGrammar.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/CSSGrammar.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/CSSGrammar.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/CSSGrammar.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -383,6 +416,7 @@
 $(gyp_shared_intermediate_dir)/blink/CSSGrammar.h: $(gyp_shared_intermediate_dir)/blink/CSSGrammar.cpp ;
 
 $(gyp_shared_intermediate_dir)/blink/XPathGrammar.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/XPathGrammar.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/XPathGrammar.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XPathGrammar.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XPathGrammar.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/make_core_generated.target.linux-mips.mk b/Source/core/make_core_generated.target.linux-mips.mk
index 4d3ff8f..373137f 100644
--- a/Source/core/make_core_generated.target.linux-mips.mk
+++ b/Source/core/make_core_generated.target.linux-mips.mk
@@ -19,6 +19,7 @@
 
 ### Rules for action "generateXMLViewerCSS":
 $(gyp_shared_intermediate_dir)/blink/XMLViewerCSS.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/XMLViewerCSS.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/XMLViewerCSS.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XMLViewerCSS.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XMLViewerCSS.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -29,6 +30,7 @@
 
 ### Rules for action "generateXMLViewerJS":
 $(gyp_shared_intermediate_dir)/blink/XMLViewerJS.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/XMLViewerJS.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/XMLViewerJS.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XMLViewerJS.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XMLViewerJS.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -39,6 +41,7 @@
 
 ### Rules for action "HTMLEntityTable":
 $(gyp_shared_intermediate_dir)/blink/HTMLEntityTable.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/HTMLEntityTable.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/HTMLEntityTable.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLEntityTable.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLEntityTable.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -49,59 +52,65 @@
 
 ### Rules for action "CSSPropertyNames":
 $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/hasher.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_css_property_names.py $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSPropertyNames.in $(LOCAL_PATH)/third_party/WebKit/Source/core/css/SVGCSSPropertyNames.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_CSSPropertyNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_css_property_names.py css/CSSPropertyNames.in css/SVGCSSPropertyNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --gperf gperf --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_css_property_names.py css/CSSPropertyNames.in css/SVGCSSPropertyNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --gperf gperf --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.h: $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp ;
 
 ### Rules for action "MediaFeatureNames":
 $(gyp_shared_intermediate_dir)/blink/MediaFeatureNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/MediaFeatureNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/MediaFeatureNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MediaFeatureNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MediaFeatureNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/MediaFeatureNames.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/hasher.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_names.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeNames.cpp.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeNames.h.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_media_feature_names.py $(LOCAL_PATH)/third_party/WebKit/Source/core/css/MediaFeatureNames.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_MediaFeatureNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_media_feature_names.py css/MediaFeatureNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_media_feature_names.py css/MediaFeatureNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/MediaFeatureNames.h: $(gyp_shared_intermediate_dir)/blink/MediaFeatureNames.cpp ;
 
 ### Rules for action "MediaFeatures":
 $(gyp_shared_intermediate_dir)/blink/MediaFeatures.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/MediaFeatures.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/MediaFeatures.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MediaFeatures.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MediaFeatures.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/MediaFeatures.h: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/hasher.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_media_features.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MediaFeatures.h.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/MediaFeatureNames.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_MediaFeatures ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_media_features.py css/MediaFeatureNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_media_features.py css/MediaFeatureNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 
 ### Rules for action "MediaTypeNames":
 $(gyp_shared_intermediate_dir)/blink/MediaTypeNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/MediaTypeNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/MediaTypeNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MediaTypeNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MediaTypeNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/MediaTypeNames.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/hasher.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_names.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeNames.cpp.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeNames.h.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/MediaTypeNames.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_MediaTypeNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_names.py css/MediaTypeNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_names.py css/MediaTypeNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/MediaTypeNames.h: $(gyp_shared_intermediate_dir)/blink/MediaTypeNames.cpp ;
 
 ### Rules for action "MediaQueryTokenizerCodepoints":
 $(gyp_shared_intermediate_dir)/blink/MediaQueryTokenizerCodepoints.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/MediaQueryTokenizerCodepoints.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/MediaQueryTokenizerCodepoints.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MediaQueryTokenizerCodepoints.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MediaQueryTokenizerCodepoints.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/MediaQueryTokenizerCodepoints.cpp: $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_mediaquery_tokenizer_codepoints.py $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_MediaQueryTokenizerCodepoints ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_mediaquery_tokenizer_codepoints.py --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_mediaquery_tokenizer_codepoints.py --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 
 ### Rules for action "StylePropertyShorthand":
 $(gyp_shared_intermediate_dir)/blink/StylePropertyShorthand.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/StylePropertyShorthand.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/StylePropertyShorthand.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/StylePropertyShorthand.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/StylePropertyShorthand.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -113,6 +122,7 @@
 
 ### Rules for action "StyleBuilder":
 $(gyp_shared_intermediate_dir)/blink/StyleBuilder.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/StyleBuilder.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/StyleBuilder.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/StyleBuilder.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/StyleBuilder.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -125,17 +135,19 @@
 
 ### Rules for action "CSSValueKeywords":
 $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/hasher.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_css_value_keywords.py $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSValueKeywords.in $(LOCAL_PATH)/third_party/WebKit/Source/core/css/SVGCSSValueKeywords.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_CSSValueKeywords ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_css_value_keywords.py css/CSSValueKeywords.in css/SVGCSSValueKeywords.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --gperf gperf --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_css_value_keywords.py css/CSSValueKeywords.in css/SVGCSSValueKeywords.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --gperf gperf --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.h: $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp ;
 
 ### Rules for action "HTMLElementFactory":
 $(gyp_shared_intermediate_dir)/blink/HTMLElementFactory.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/HTMLElementFactory.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/HTMLElementFactory.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLElementFactory.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLElementFactory.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -151,6 +163,7 @@
 
 ### Rules for action "HTMLElementTypeHelpers":
 $(gyp_shared_intermediate_dir)/blink/HTMLElementTypeHelpers.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/HTMLElementTypeHelpers.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/HTMLElementTypeHelpers.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLElementTypeHelpers.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLElementTypeHelpers.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -161,6 +174,7 @@
 
 ### Rules for action "SVGNames":
 $(gyp_shared_intermediate_dir)/blink/SVGElementFactory.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/SVGElementFactory.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/SVGElementFactory.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/SVGElementFactory.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/SVGElementFactory.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -176,6 +190,7 @@
 
 ### Rules for action "SVGElementTypeHelpers":
 $(gyp_shared_intermediate_dir)/blink/SVGElementTypeHelpers.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/SVGElementTypeHelpers.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/SVGElementTypeHelpers.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/SVGElementTypeHelpers.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/SVGElementTypeHelpers.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -186,6 +201,7 @@
 
 ### Rules for action "EventFactory":
 $(gyp_shared_intermediate_dir)/blink/Event.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/Event.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/Event.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/Event.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/Event.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -198,6 +214,7 @@
 
 ### Rules for action "EventNames":
 $(gyp_shared_intermediate_dir)/blink/EventNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/EventNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/EventNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -209,6 +226,7 @@
 
 ### Rules for action "EventTargetFactory":
 $(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -220,6 +238,7 @@
 
 ### Rules for action "EventTargetNames":
 $(gyp_shared_intermediate_dir)/blink/EventTargetNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/EventTargetNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/EventTargetNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventTargetNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventTargetNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -231,28 +250,31 @@
 
 ### Rules for action "MathMLNames":
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/hasher.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_qualified_names.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeQualifiedNames.cpp.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeQualifiedNames.h.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/parser/MathMLTagNames.in $(LOCAL_PATH)/third_party/WebKit/Source/core/html/parser/MathMLAttributeNames.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_MathMLNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_qualified_names.py html/parser/MathMLTagNames.in html/parser/MathMLAttributeNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_qualified_names.py html/parser/MathMLTagNames.in html/parser/MathMLAttributeNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.h: $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp ;
 
 ### Rules for action "UserAgentStyleSheets":
 $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h: $(LOCAL_PATH)/third_party/WebKit/Source/core/css/make-css-file-arrays.pl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/preprocessor.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/css/html.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/quirks.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/view-source.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeChromium.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeChromiumAndroid.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeChromiumLinux.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeChromiumSkia.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeMac.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeWin.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeWinQuirks.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/svg.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/mathml.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/mediaControls.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/mediaControlsAndroid.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/fullscreen.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/xhtmlmp.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/viewportAndroid.css $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_UserAgentStyleSheets ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/action_useragentstylesheets.py "$(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h" "$(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheetsData.cpp" css/html.css css/quirks.css css/view-source.css css/themeChromium.css css/themeChromiumAndroid.css css/themeChromiumLinux.css css/themeChromiumSkia.css css/themeMac.css css/themeWin.css css/themeWinQuirks.css css/svg.css css/mathml.css css/mediaControls.css css/mediaControlsAndroid.css css/fullscreen.css css/xhtmlmp.css css/viewportAndroid.css -- css/make-css-file-arrays.pl ../build/scripts/preprocessor.pm -- --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\"" --preprocessor "/usr/bin/gcc -E -P -x c++" --perl perl
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/action_useragentstylesheets.py "$(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h" "$(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheetsData.cpp" css/html.css css/quirks.css css/view-source.css css/themeChromium.css css/themeChromiumAndroid.css css/themeChromiumLinux.css css/themeChromiumSkia.css css/themeMac.css css/themeWin.css css/themeWinQuirks.css css/svg.css css/mathml.css css/mediaControls.css css/mediaControlsAndroid.css css/fullscreen.css css/xhtmlmp.css css/viewportAndroid.css -- css/make-css-file-arrays.pl ../build/scripts/preprocessor.pm -- --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\"" --preprocessor "/usr/bin/gcc -E -P -x c++" --perl perl
 
 $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheetsData.cpp: $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h ;
 
 ### Rules for action "FetchInitiatorTypeNames":
 $(gyp_shared_intermediate_dir)/blink/FetchInitiatorTypeNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/FetchInitiatorTypeNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/FetchInitiatorTypeNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/FetchInitiatorTypeNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/FetchInitiatorTypeNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -264,6 +286,7 @@
 
 ### Rules for action "EventTypeNames":
 $(gyp_shared_intermediate_dir)/blink/EventTypeNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/EventTypeNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/EventTypeNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventTypeNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventTypeNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -275,6 +298,7 @@
 
 ### Rules for action "HTMLTokenizerNames":
 $(gyp_shared_intermediate_dir)/blink/HTMLTokenizerNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/HTMLTokenizerNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/HTMLTokenizerNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLTokenizerNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLTokenizerNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -286,6 +310,7 @@
 
 ### Rules for action "InputTypeNames":
 $(gyp_shared_intermediate_dir)/blink/InputTypeNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/InputTypeNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/InputTypeNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InputTypeNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InputTypeNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -297,6 +322,7 @@
 
 ### Rules for action "XLinkNames":
 $(gyp_shared_intermediate_dir)/blink/XLinkNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/XLinkNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/XLinkNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XLinkNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XLinkNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -308,6 +334,7 @@
 
 ### Rules for action "XMLNSNames":
 $(gyp_shared_intermediate_dir)/blink/XMLNSNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/XMLNSNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/XMLNSNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XMLNSNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XMLNSNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -319,6 +346,7 @@
 
 ### Rules for action "XMLNames":
 $(gyp_shared_intermediate_dir)/blink/XMLNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/XMLNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/XMLNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XMLNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XMLNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -330,6 +358,7 @@
 
 ### Rules for action "MakeTokenMatcher":
 $(gyp_shared_intermediate_dir)/blink/CSSTokenizer.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/CSSTokenizer.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/CSSTokenizer.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/CSSTokenizer.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/CSSTokenizer.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -340,6 +369,7 @@
 
 ### Rules for action "MakeParser":
 $(gyp_shared_intermediate_dir)/blink/BisonCSSParser.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/BisonCSSParser.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/BisonCSSParser.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/BisonCSSParser.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/BisonCSSParser.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -350,6 +380,7 @@
 
 ### Rules for action "MakeTokenMatcherForViewport":
 $(gyp_shared_intermediate_dir)/blink/HTMLMetaElement.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/HTMLMetaElement.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/HTMLMetaElement.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLMetaElement.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLMetaElement.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -360,6 +391,7 @@
 
 ### Rules for action "HTMLElementLookupTrie":
 $(gyp_shared_intermediate_dir)/blink/HTMLElementLookupTrie.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/HTMLElementLookupTrie.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/HTMLElementLookupTrie.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLElementLookupTrie.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLElementLookupTrie.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -374,6 +406,7 @@
 ### Generated for rule "third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_bison":
 # "{'action': ['python', '../build/scripts/rule_bison.py', '$(RULE_SOURCES)', '$(gyp_shared_intermediate_dir)/blink', 'bison'], 'rule_name': 'bison', 'rule_sources': ['css/CSSGrammar.y', 'xml/XPathGrammar.y'], 'extension': 'y', 'outputs': ['$(gyp_shared_intermediate_dir)/blink/%(INPUT_ROOT)s.cpp', '$(gyp_shared_intermediate_dir)/blink/%(INPUT_ROOT)s.h']}":
 $(gyp_shared_intermediate_dir)/blink/CSSGrammar.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/CSSGrammar.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/CSSGrammar.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/CSSGrammar.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/CSSGrammar.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -383,6 +416,7 @@
 $(gyp_shared_intermediate_dir)/blink/CSSGrammar.h: $(gyp_shared_intermediate_dir)/blink/CSSGrammar.cpp ;
 
 $(gyp_shared_intermediate_dir)/blink/XPathGrammar.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/XPathGrammar.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/XPathGrammar.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XPathGrammar.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XPathGrammar.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
diff --git a/Source/core/make_core_generated.target.linux-x86.mk b/Source/core/make_core_generated.target.linux-x86.mk
index c12ddf8..824aa83 100644
--- a/Source/core/make_core_generated.target.linux-x86.mk
+++ b/Source/core/make_core_generated.target.linux-x86.mk
@@ -19,6 +19,7 @@
 
 ### Rules for action "generateXMLViewerCSS":
 $(gyp_shared_intermediate_dir)/blink/XMLViewerCSS.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/XMLViewerCSS.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/XMLViewerCSS.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XMLViewerCSS.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XMLViewerCSS.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -29,6 +30,7 @@
 
 ### Rules for action "generateXMLViewerJS":
 $(gyp_shared_intermediate_dir)/blink/XMLViewerJS.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/XMLViewerJS.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/XMLViewerJS.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XMLViewerJS.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XMLViewerJS.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -39,6 +41,7 @@
 
 ### Rules for action "HTMLEntityTable":
 $(gyp_shared_intermediate_dir)/blink/HTMLEntityTable.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/HTMLEntityTable.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/HTMLEntityTable.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLEntityTable.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLEntityTable.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -49,59 +52,65 @@
 
 ### Rules for action "CSSPropertyNames":
 $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/hasher.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_css_property_names.py $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSPropertyNames.in $(LOCAL_PATH)/third_party/WebKit/Source/core/css/SVGCSSPropertyNames.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_CSSPropertyNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_css_property_names.py css/CSSPropertyNames.in css/SVGCSSPropertyNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --gperf gperf --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_css_property_names.py css/CSSPropertyNames.in css/SVGCSSPropertyNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --gperf gperf --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_MEDIA_CAPTURE=1\" \"WTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1\" \"ENABLE_WEB_AUDIO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.h: $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp ;
 
 ### Rules for action "MediaFeatureNames":
 $(gyp_shared_intermediate_dir)/blink/MediaFeatureNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/MediaFeatureNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/MediaFeatureNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MediaFeatureNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MediaFeatureNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/MediaFeatureNames.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/hasher.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_names.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeNames.cpp.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeNames.h.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_media_feature_names.py $(LOCAL_PATH)/third_party/WebKit/Source/core/css/MediaFeatureNames.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_MediaFeatureNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_media_feature_names.py css/MediaFeatureNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_media_feature_names.py css/MediaFeatureNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_MEDIA_CAPTURE=1\" \"WTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1\" \"ENABLE_WEB_AUDIO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/MediaFeatureNames.h: $(gyp_shared_intermediate_dir)/blink/MediaFeatureNames.cpp ;
 
 ### Rules for action "MediaFeatures":
 $(gyp_shared_intermediate_dir)/blink/MediaFeatures.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/MediaFeatures.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/MediaFeatures.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MediaFeatures.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MediaFeatures.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/MediaFeatures.h: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/hasher.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_media_features.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MediaFeatures.h.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/MediaFeatureNames.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_MediaFeatures ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_media_features.py css/MediaFeatureNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_media_features.py css/MediaFeatureNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_MEDIA_CAPTURE=1\" \"WTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1\" \"ENABLE_WEB_AUDIO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 
 ### Rules for action "MediaTypeNames":
 $(gyp_shared_intermediate_dir)/blink/MediaTypeNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/MediaTypeNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/MediaTypeNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MediaTypeNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MediaTypeNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/MediaTypeNames.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/hasher.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_names.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeNames.cpp.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeNames.h.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/MediaTypeNames.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_MediaTypeNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_names.py css/MediaTypeNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_names.py css/MediaTypeNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_MEDIA_CAPTURE=1\" \"WTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1\" \"ENABLE_WEB_AUDIO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/MediaTypeNames.h: $(gyp_shared_intermediate_dir)/blink/MediaTypeNames.cpp ;
 
 ### Rules for action "MediaQueryTokenizerCodepoints":
 $(gyp_shared_intermediate_dir)/blink/MediaQueryTokenizerCodepoints.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/MediaQueryTokenizerCodepoints.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/MediaQueryTokenizerCodepoints.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MediaQueryTokenizerCodepoints.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MediaQueryTokenizerCodepoints.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/MediaQueryTokenizerCodepoints.cpp: $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_mediaquery_tokenizer_codepoints.py $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_MediaQueryTokenizerCodepoints ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_mediaquery_tokenizer_codepoints.py --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_mediaquery_tokenizer_codepoints.py --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_MEDIA_CAPTURE=1\" \"WTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1\" \"ENABLE_WEB_AUDIO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 
 ### Rules for action "StylePropertyShorthand":
 $(gyp_shared_intermediate_dir)/blink/StylePropertyShorthand.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/StylePropertyShorthand.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/StylePropertyShorthand.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/StylePropertyShorthand.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/StylePropertyShorthand.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -113,6 +122,7 @@
 
 ### Rules for action "StyleBuilder":
 $(gyp_shared_intermediate_dir)/blink/StyleBuilder.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/StyleBuilder.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/StyleBuilder.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/StyleBuilder.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/StyleBuilder.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -125,17 +135,19 @@
 
 ### Rules for action "CSSValueKeywords":
 $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/hasher.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_css_value_keywords.py $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSValueKeywords.in $(LOCAL_PATH)/third_party/WebKit/Source/core/css/SVGCSSValueKeywords.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_CSSValueKeywords ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_css_value_keywords.py css/CSSValueKeywords.in css/SVGCSSValueKeywords.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --gperf gperf --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_css_value_keywords.py css/CSSValueKeywords.in css/SVGCSSValueKeywords.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --gperf gperf --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_MEDIA_CAPTURE=1\" \"WTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1\" \"ENABLE_WEB_AUDIO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.h: $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp ;
 
 ### Rules for action "HTMLElementFactory":
 $(gyp_shared_intermediate_dir)/blink/HTMLElementFactory.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/HTMLElementFactory.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/HTMLElementFactory.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLElementFactory.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLElementFactory.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -151,6 +163,7 @@
 
 ### Rules for action "HTMLElementTypeHelpers":
 $(gyp_shared_intermediate_dir)/blink/HTMLElementTypeHelpers.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/HTMLElementTypeHelpers.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/HTMLElementTypeHelpers.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLElementTypeHelpers.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLElementTypeHelpers.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -161,6 +174,7 @@
 
 ### Rules for action "SVGNames":
 $(gyp_shared_intermediate_dir)/blink/SVGElementFactory.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/SVGElementFactory.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/SVGElementFactory.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/SVGElementFactory.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/SVGElementFactory.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -176,6 +190,7 @@
 
 ### Rules for action "SVGElementTypeHelpers":
 $(gyp_shared_intermediate_dir)/blink/SVGElementTypeHelpers.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/SVGElementTypeHelpers.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/SVGElementTypeHelpers.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/SVGElementTypeHelpers.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/SVGElementTypeHelpers.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -186,6 +201,7 @@
 
 ### Rules for action "EventFactory":
 $(gyp_shared_intermediate_dir)/blink/Event.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/Event.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/Event.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/Event.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/Event.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -198,6 +214,7 @@
 
 ### Rules for action "EventNames":
 $(gyp_shared_intermediate_dir)/blink/EventNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/EventNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/EventNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -209,6 +226,7 @@
 
 ### Rules for action "EventTargetFactory":
 $(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -220,6 +238,7 @@
 
 ### Rules for action "EventTargetNames":
 $(gyp_shared_intermediate_dir)/blink/EventTargetNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/EventTargetNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/EventTargetNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventTargetNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventTargetNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -231,28 +250,31 @@
 
 ### Rules for action "MathMLNames":
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/hasher.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_qualified_names.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeQualifiedNames.cpp.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeQualifiedNames.h.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/parser/MathMLTagNames.in $(LOCAL_PATH)/third_party/WebKit/Source/core/html/parser/MathMLAttributeNames.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_MathMLNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_qualified_names.py html/parser/MathMLTagNames.in html/parser/MathMLAttributeNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_qualified_names.py html/parser/MathMLTagNames.in html/parser/MathMLAttributeNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_MEDIA_CAPTURE=1\" \"WTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1\" \"ENABLE_WEB_AUDIO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.h: $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp ;
 
 ### Rules for action "UserAgentStyleSheets":
 $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h: $(LOCAL_PATH)/third_party/WebKit/Source/core/css/make-css-file-arrays.pl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/preprocessor.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/css/html.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/quirks.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/view-source.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeChromium.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeChromiumAndroid.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeChromiumLinux.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeChromiumSkia.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeMac.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeWin.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeWinQuirks.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/svg.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/mathml.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/mediaControls.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/mediaControlsAndroid.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/fullscreen.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/xhtmlmp.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/viewportAndroid.css $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_UserAgentStyleSheets ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/action_useragentstylesheets.py "$(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h" "$(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheetsData.cpp" css/html.css css/quirks.css css/view-source.css css/themeChromium.css css/themeChromiumAndroid.css css/themeChromiumLinux.css css/themeChromiumSkia.css css/themeMac.css css/themeWin.css css/themeWinQuirks.css css/svg.css css/mathml.css css/mediaControls.css css/mediaControlsAndroid.css css/fullscreen.css css/xhtmlmp.css css/viewportAndroid.css -- css/make-css-file-arrays.pl ../build/scripts/preprocessor.pm -- --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\"" --preprocessor "/usr/bin/gcc -E -P -x c++" --perl perl
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/action_useragentstylesheets.py "$(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h" "$(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheetsData.cpp" css/html.css css/quirks.css css/view-source.css css/themeChromium.css css/themeChromiumAndroid.css css/themeChromiumLinux.css css/themeChromiumSkia.css css/themeMac.css css/themeWin.css css/themeWinQuirks.css css/svg.css css/mathml.css css/mediaControls.css css/mediaControlsAndroid.css css/fullscreen.css css/xhtmlmp.css css/viewportAndroid.css -- css/make-css-file-arrays.pl ../build/scripts/preprocessor.pm -- --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_MEDIA_CAPTURE=1\" \"WTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1\" \"ENABLE_WEB_AUDIO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\"" --preprocessor "/usr/bin/gcc -E -P -x c++" --perl perl
 
 $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheetsData.cpp: $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h ;
 
 ### Rules for action "FetchInitiatorTypeNames":
 $(gyp_shared_intermediate_dir)/blink/FetchInitiatorTypeNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/FetchInitiatorTypeNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/FetchInitiatorTypeNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/FetchInitiatorTypeNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/FetchInitiatorTypeNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -264,6 +286,7 @@
 
 ### Rules for action "EventTypeNames":
 $(gyp_shared_intermediate_dir)/blink/EventTypeNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/EventTypeNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/EventTypeNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventTypeNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventTypeNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -275,6 +298,7 @@
 
 ### Rules for action "HTMLTokenizerNames":
 $(gyp_shared_intermediate_dir)/blink/HTMLTokenizerNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/HTMLTokenizerNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/HTMLTokenizerNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLTokenizerNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLTokenizerNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -286,6 +310,7 @@
 
 ### Rules for action "InputTypeNames":
 $(gyp_shared_intermediate_dir)/blink/InputTypeNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/InputTypeNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/InputTypeNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InputTypeNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InputTypeNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -297,6 +322,7 @@
 
 ### Rules for action "XLinkNames":
 $(gyp_shared_intermediate_dir)/blink/XLinkNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/XLinkNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/XLinkNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XLinkNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XLinkNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -308,6 +334,7 @@
 
 ### Rules for action "XMLNSNames":
 $(gyp_shared_intermediate_dir)/blink/XMLNSNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/XMLNSNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/XMLNSNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XMLNSNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XMLNSNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -319,6 +346,7 @@
 
 ### Rules for action "XMLNames":
 $(gyp_shared_intermediate_dir)/blink/XMLNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/XMLNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/XMLNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XMLNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XMLNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -330,6 +358,7 @@
 
 ### Rules for action "MakeTokenMatcher":
 $(gyp_shared_intermediate_dir)/blink/CSSTokenizer.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/CSSTokenizer.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/CSSTokenizer.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/CSSTokenizer.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/CSSTokenizer.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -340,6 +369,7 @@
 
 ### Rules for action "MakeParser":
 $(gyp_shared_intermediate_dir)/blink/BisonCSSParser.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/BisonCSSParser.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/BisonCSSParser.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/BisonCSSParser.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/BisonCSSParser.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -350,6 +380,7 @@
 
 ### Rules for action "MakeTokenMatcherForViewport":
 $(gyp_shared_intermediate_dir)/blink/HTMLMetaElement.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/HTMLMetaElement.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/HTMLMetaElement.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLMetaElement.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLMetaElement.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -360,6 +391,7 @@
 
 ### Rules for action "HTMLElementLookupTrie":
 $(gyp_shared_intermediate_dir)/blink/HTMLElementLookupTrie.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/HTMLElementLookupTrie.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/HTMLElementLookupTrie.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLElementLookupTrie.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLElementLookupTrie.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -374,6 +406,7 @@
 ### Generated for rule "third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_bison":
 # "{'action': ['python', '../build/scripts/rule_bison.py', '$(RULE_SOURCES)', '$(gyp_shared_intermediate_dir)/blink', 'bison'], 'rule_name': 'bison', 'rule_sources': ['css/CSSGrammar.y', 'xml/XPathGrammar.y'], 'extension': 'y', 'outputs': ['$(gyp_shared_intermediate_dir)/blink/%(INPUT_ROOT)s.cpp', '$(gyp_shared_intermediate_dir)/blink/%(INPUT_ROOT)s.h']}":
 $(gyp_shared_intermediate_dir)/blink/CSSGrammar.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/CSSGrammar.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/CSSGrammar.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/CSSGrammar.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/CSSGrammar.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -383,6 +416,7 @@
 $(gyp_shared_intermediate_dir)/blink/CSSGrammar.h: $(gyp_shared_intermediate_dir)/blink/CSSGrammar.cpp ;
 
 $(gyp_shared_intermediate_dir)/blink/XPathGrammar.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/XPathGrammar.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/XPathGrammar.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XPathGrammar.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XPathGrammar.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -488,7 +522,6 @@
 	-mfpmath=sse \
 	-mmmx \
 	-m32 \
-	-fuse-ld=gold \
 	-ffunction-sections \
 	-funwind-tables \
 	-g \
@@ -575,7 +608,6 @@
 	-mfpmath=sse \
 	-mmmx \
 	-m32 \
-	-fuse-ld=gold \
 	-ffunction-sections \
 	-funwind-tables \
 	-g \
diff --git a/Source/core/make_core_generated.target.linux-x86_64.mk b/Source/core/make_core_generated.target.linux-x86_64.mk
index c543ba2..ab272d5 100644
--- a/Source/core/make_core_generated.target.linux-x86_64.mk
+++ b/Source/core/make_core_generated.target.linux-x86_64.mk
@@ -19,6 +19,7 @@
 
 ### Rules for action "generateXMLViewerCSS":
 $(gyp_shared_intermediate_dir)/blink/XMLViewerCSS.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/XMLViewerCSS.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/XMLViewerCSS.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XMLViewerCSS.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XMLViewerCSS.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -29,6 +30,7 @@
 
 ### Rules for action "generateXMLViewerJS":
 $(gyp_shared_intermediate_dir)/blink/XMLViewerJS.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/XMLViewerJS.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/XMLViewerJS.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XMLViewerJS.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XMLViewerJS.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -39,6 +41,7 @@
 
 ### Rules for action "HTMLEntityTable":
 $(gyp_shared_intermediate_dir)/blink/HTMLEntityTable.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/HTMLEntityTable.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/HTMLEntityTable.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLEntityTable.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLEntityTable.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -49,59 +52,65 @@
 
 ### Rules for action "CSSPropertyNames":
 $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/hasher.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_css_property_names.py $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSPropertyNames.in $(LOCAL_PATH)/third_party/WebKit/Source/core/css/SVGCSSPropertyNames.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_CSSPropertyNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_css_property_names.py css/CSSPropertyNames.in css/SVGCSSPropertyNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --gperf gperf --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_css_property_names.py css/CSSPropertyNames.in css/SVGCSSPropertyNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --gperf gperf --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_MEDIA_CAPTURE=1\" \"WTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1\" \"ENABLE_WEB_AUDIO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.h: $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp ;
 
 ### Rules for action "MediaFeatureNames":
 $(gyp_shared_intermediate_dir)/blink/MediaFeatureNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/MediaFeatureNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/MediaFeatureNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MediaFeatureNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MediaFeatureNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/MediaFeatureNames.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/hasher.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_names.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeNames.cpp.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeNames.h.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_media_feature_names.py $(LOCAL_PATH)/third_party/WebKit/Source/core/css/MediaFeatureNames.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_MediaFeatureNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_media_feature_names.py css/MediaFeatureNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_media_feature_names.py css/MediaFeatureNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_MEDIA_CAPTURE=1\" \"WTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1\" \"ENABLE_WEB_AUDIO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/MediaFeatureNames.h: $(gyp_shared_intermediate_dir)/blink/MediaFeatureNames.cpp ;
 
 ### Rules for action "MediaFeatures":
 $(gyp_shared_intermediate_dir)/blink/MediaFeatures.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/MediaFeatures.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/MediaFeatures.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MediaFeatures.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MediaFeatures.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/MediaFeatures.h: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/hasher.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_media_features.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MediaFeatures.h.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/MediaFeatureNames.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_MediaFeatures ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_media_features.py css/MediaFeatureNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_media_features.py css/MediaFeatureNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_MEDIA_CAPTURE=1\" \"WTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1\" \"ENABLE_WEB_AUDIO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 
 ### Rules for action "MediaTypeNames":
 $(gyp_shared_intermediate_dir)/blink/MediaTypeNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/MediaTypeNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/MediaTypeNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MediaTypeNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MediaTypeNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/MediaTypeNames.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/hasher.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_names.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeNames.cpp.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeNames.h.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/MediaTypeNames.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_MediaTypeNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_names.py css/MediaTypeNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_names.py css/MediaTypeNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_MEDIA_CAPTURE=1\" \"WTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1\" \"ENABLE_WEB_AUDIO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/MediaTypeNames.h: $(gyp_shared_intermediate_dir)/blink/MediaTypeNames.cpp ;
 
 ### Rules for action "MediaQueryTokenizerCodepoints":
 $(gyp_shared_intermediate_dir)/blink/MediaQueryTokenizerCodepoints.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/MediaQueryTokenizerCodepoints.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/MediaQueryTokenizerCodepoints.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MediaQueryTokenizerCodepoints.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MediaQueryTokenizerCodepoints.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/MediaQueryTokenizerCodepoints.cpp: $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_mediaquery_tokenizer_codepoints.py $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_MediaQueryTokenizerCodepoints ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_mediaquery_tokenizer_codepoints.py --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_mediaquery_tokenizer_codepoints.py --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_MEDIA_CAPTURE=1\" \"WTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1\" \"ENABLE_WEB_AUDIO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 
 ### Rules for action "StylePropertyShorthand":
 $(gyp_shared_intermediate_dir)/blink/StylePropertyShorthand.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/StylePropertyShorthand.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/StylePropertyShorthand.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/StylePropertyShorthand.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/StylePropertyShorthand.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -113,6 +122,7 @@
 
 ### Rules for action "StyleBuilder":
 $(gyp_shared_intermediate_dir)/blink/StyleBuilder.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/StyleBuilder.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/StyleBuilder.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/StyleBuilder.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/StyleBuilder.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -125,17 +135,19 @@
 
 ### Rules for action "CSSValueKeywords":
 $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/hasher.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_css_value_keywords.py $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSValueKeywords.in $(LOCAL_PATH)/third_party/WebKit/Source/core/css/SVGCSSValueKeywords.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_CSSValueKeywords ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_css_value_keywords.py css/CSSValueKeywords.in css/SVGCSSValueKeywords.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --gperf gperf --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_css_value_keywords.py css/CSSValueKeywords.in css/SVGCSSValueKeywords.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --gperf gperf --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_MEDIA_CAPTURE=1\" \"WTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1\" \"ENABLE_WEB_AUDIO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.h: $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp ;
 
 ### Rules for action "HTMLElementFactory":
 $(gyp_shared_intermediate_dir)/blink/HTMLElementFactory.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/HTMLElementFactory.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/HTMLElementFactory.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLElementFactory.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLElementFactory.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -151,6 +163,7 @@
 
 ### Rules for action "HTMLElementTypeHelpers":
 $(gyp_shared_intermediate_dir)/blink/HTMLElementTypeHelpers.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/HTMLElementTypeHelpers.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/HTMLElementTypeHelpers.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLElementTypeHelpers.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLElementTypeHelpers.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -161,6 +174,7 @@
 
 ### Rules for action "SVGNames":
 $(gyp_shared_intermediate_dir)/blink/SVGElementFactory.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/SVGElementFactory.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/SVGElementFactory.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/SVGElementFactory.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/SVGElementFactory.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -176,6 +190,7 @@
 
 ### Rules for action "SVGElementTypeHelpers":
 $(gyp_shared_intermediate_dir)/blink/SVGElementTypeHelpers.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/SVGElementTypeHelpers.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/SVGElementTypeHelpers.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/SVGElementTypeHelpers.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/SVGElementTypeHelpers.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -186,6 +201,7 @@
 
 ### Rules for action "EventFactory":
 $(gyp_shared_intermediate_dir)/blink/Event.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/Event.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/Event.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/Event.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/Event.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -198,6 +214,7 @@
 
 ### Rules for action "EventNames":
 $(gyp_shared_intermediate_dir)/blink/EventNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/EventNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/EventNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -209,6 +226,7 @@
 
 ### Rules for action "EventTargetFactory":
 $(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -220,6 +238,7 @@
 
 ### Rules for action "EventTargetNames":
 $(gyp_shared_intermediate_dir)/blink/EventTargetNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/EventTargetNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/EventTargetNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventTargetNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventTargetNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -231,28 +250,31 @@
 
 ### Rules for action "MathMLNames":
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/hasher.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_qualified_names.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeQualifiedNames.cpp.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeQualifiedNames.h.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/parser/MathMLTagNames.in $(LOCAL_PATH)/third_party/WebKit/Source/core/html/parser/MathMLAttributeNames.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_MathMLNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_qualified_names.py html/parser/MathMLTagNames.in html/parser/MathMLAttributeNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_qualified_names.py html/parser/MathMLTagNames.in html/parser/MathMLAttributeNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_MEDIA_CAPTURE=1\" \"WTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1\" \"ENABLE_WEB_AUDIO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.h: $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp ;
 
 ### Rules for action "UserAgentStyleSheets":
 $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h: $(LOCAL_PATH)/third_party/WebKit/Source/core/css/make-css-file-arrays.pl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/preprocessor.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/css/html.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/quirks.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/view-source.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeChromium.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeChromiumAndroid.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeChromiumLinux.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeChromiumSkia.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeMac.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeWin.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeWinQuirks.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/svg.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/mathml.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/mediaControls.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/mediaControlsAndroid.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/fullscreen.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/xhtmlmp.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/viewportAndroid.css $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_UserAgentStyleSheets ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/action_useragentstylesheets.py "$(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h" "$(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheetsData.cpp" css/html.css css/quirks.css css/view-source.css css/themeChromium.css css/themeChromiumAndroid.css css/themeChromiumLinux.css css/themeChromiumSkia.css css/themeMac.css css/themeWin.css css/themeWinQuirks.css css/svg.css css/mathml.css css/mediaControls.css css/mediaControlsAndroid.css css/fullscreen.css css/xhtmlmp.css css/viewportAndroid.css -- css/make-css-file-arrays.pl ../build/scripts/preprocessor.pm -- --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_OPENTYPE_VERTICAL=1\"" --preprocessor "/usr/bin/gcc -E -P -x c++" --perl perl
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/action_useragentstylesheets.py "$(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h" "$(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheetsData.cpp" css/html.css css/quirks.css css/view-source.css css/themeChromium.css css/themeChromiumAndroid.css css/themeChromiumLinux.css css/themeChromiumSkia.css css/themeMac.css css/themeWin.css css/themeWinQuirks.css css/svg.css css/mathml.css css/mediaControls.css css/mediaControlsAndroid.css css/fullscreen.css css/xhtmlmp.css css/viewportAndroid.css -- css/make-css-file-arrays.pl ../build/scripts/preprocessor.pm -- --defines "\"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_SVG_FONTS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_MEDIA_CAPTURE=1\" \"WTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1\" \"ENABLE_WEB_AUDIO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\"" --preprocessor "/usr/bin/gcc -E -P -x c++" --perl perl
 
 $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheetsData.cpp: $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h ;
 
 ### Rules for action "FetchInitiatorTypeNames":
 $(gyp_shared_intermediate_dir)/blink/FetchInitiatorTypeNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/FetchInitiatorTypeNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/FetchInitiatorTypeNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/FetchInitiatorTypeNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/FetchInitiatorTypeNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -264,6 +286,7 @@
 
 ### Rules for action "EventTypeNames":
 $(gyp_shared_intermediate_dir)/blink/EventTypeNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/EventTypeNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/EventTypeNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventTypeNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventTypeNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -275,6 +298,7 @@
 
 ### Rules for action "HTMLTokenizerNames":
 $(gyp_shared_intermediate_dir)/blink/HTMLTokenizerNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/HTMLTokenizerNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/HTMLTokenizerNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLTokenizerNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLTokenizerNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -286,6 +310,7 @@
 
 ### Rules for action "InputTypeNames":
 $(gyp_shared_intermediate_dir)/blink/InputTypeNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/InputTypeNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/InputTypeNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InputTypeNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InputTypeNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -297,6 +322,7 @@
 
 ### Rules for action "XLinkNames":
 $(gyp_shared_intermediate_dir)/blink/XLinkNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/XLinkNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/XLinkNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XLinkNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XLinkNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -308,6 +334,7 @@
 
 ### Rules for action "XMLNSNames":
 $(gyp_shared_intermediate_dir)/blink/XMLNSNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/XMLNSNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/XMLNSNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XMLNSNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XMLNSNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -319,6 +346,7 @@
 
 ### Rules for action "XMLNames":
 $(gyp_shared_intermediate_dir)/blink/XMLNames.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/XMLNames.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/XMLNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XMLNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XMLNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -330,6 +358,7 @@
 
 ### Rules for action "MakeTokenMatcher":
 $(gyp_shared_intermediate_dir)/blink/CSSTokenizer.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/CSSTokenizer.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/CSSTokenizer.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/CSSTokenizer.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/CSSTokenizer.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -340,6 +369,7 @@
 
 ### Rules for action "MakeParser":
 $(gyp_shared_intermediate_dir)/blink/BisonCSSParser.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/BisonCSSParser.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/BisonCSSParser.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/BisonCSSParser.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/BisonCSSParser.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -350,6 +380,7 @@
 
 ### Rules for action "MakeTokenMatcherForViewport":
 $(gyp_shared_intermediate_dir)/blink/HTMLMetaElement.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/HTMLMetaElement.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/HTMLMetaElement.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLMetaElement.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLMetaElement.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -360,6 +391,7 @@
 
 ### Rules for action "HTMLElementLookupTrie":
 $(gyp_shared_intermediate_dir)/blink/HTMLElementLookupTrie.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/HTMLElementLookupTrie.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/HTMLElementLookupTrie.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLElementLookupTrie.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/HTMLElementLookupTrie.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -374,6 +406,7 @@
 ### Generated for rule "third_party_WebKit_Source_core_core_generated_gyp_make_core_generated_target_bison":
 # "{'action': ['python', '../build/scripts/rule_bison.py', '$(RULE_SOURCES)', '$(gyp_shared_intermediate_dir)/blink', 'bison'], 'rule_name': 'bison', 'rule_sources': ['css/CSSGrammar.y', 'xml/XPathGrammar.y'], 'extension': 'y', 'outputs': ['$(gyp_shared_intermediate_dir)/blink/%(INPUT_ROOT)s.cpp', '$(gyp_shared_intermediate_dir)/blink/%(INPUT_ROOT)s.h']}":
 $(gyp_shared_intermediate_dir)/blink/CSSGrammar.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/CSSGrammar.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/CSSGrammar.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/CSSGrammar.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/CSSGrammar.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -383,6 +416,7 @@
 $(gyp_shared_intermediate_dir)/blink/CSSGrammar.h: $(gyp_shared_intermediate_dir)/blink/CSSGrammar.cpp ;
 
 $(gyp_shared_intermediate_dir)/blink/XPathGrammar.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/XPathGrammar.cpp: gyp_var_prefix := $(GYP_VAR_PREFIX)
 $(gyp_shared_intermediate_dir)/blink/XPathGrammar.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XPathGrammar.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/XPathGrammar.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
@@ -488,7 +522,6 @@
 	-Wno-unused-local-typedefs \
 	-m64 \
 	-march=x86-64 \
-	-fuse-ld=gold \
 	-ffunction-sections \
 	-funwind-tables \
 	-g \
@@ -575,7 +608,6 @@
 	-Wno-unused-local-typedefs \
 	-m64 \
 	-march=x86-64 \
-	-fuse-ld=gold \
 	-ffunction-sections \
 	-funwind-tables \
 	-g \
diff --git a/Source/core/page/DOMWindowPagePopup.cpp b/Source/core/page/DOMWindowPagePopup.cpp
index 4c76925..ec7f963 100644
--- a/Source/core/page/DOMWindowPagePopup.cpp
+++ b/Source/core/page/DOMWindowPagePopup.cpp
@@ -71,6 +71,7 @@
 void DOMWindowPagePopup::trace(Visitor* visitor)
 {
     visitor->trace(m_controller);
+    WillBeHeapSupplement<DOMWindow>::trace(visitor);
 }
 
 }
diff --git a/Source/core/page/EventHandler.cpp b/Source/core/page/EventHandler.cpp
index fe0fcb1..8a35789 100644
--- a/Source/core/page/EventHandler.cpp
+++ b/Source/core/page/EventHandler.cpp
@@ -84,8 +84,7 @@
 #include "core/rendering/RenderWidget.h"
 #include "core/rendering/style/CursorList.h"
 #include "core/rendering/style/RenderStyle.h"
-#include "core/svg/SVGDocument.h"
-#include "core/svg/SVGElementInstance.h"
+#include "core/svg/SVGDocumentExtensions.h"
 #include "core/svg/SVGUseElement.h"
 #include "platform/PlatformGestureEvent.h"
 #include "platform/PlatformKeyboardEvent.h"
@@ -133,8 +132,8 @@
 static const double minimumCursorScale = 0.001;
 
 // The minimum amount of time an element stays active after a ShowPress
-// This is roughly 2 frames, which should be long enough to be noticeable.
-static const double minimumActiveInterval = 0.032;
+// This is roughly 9 frames, which should be long enough to be noticeable.
+static const double minimumActiveInterval = 0.15;
 
 #if OS(MACOSX)
 static const double TextDragDelay = 0.15;
@@ -222,7 +221,6 @@
     , m_mousePositionIsUnknown(true)
     , m_mouseDownTimestamp(0)
     , m_widgetIsLatched(false)
-    , m_originatingTouchPointTargetKey(0)
     , m_touchPressed(false)
     , m_scrollGestureHandlingNode(nullptr)
     , m_lastHitTestResultOverWidget(false)
@@ -260,7 +258,6 @@
     m_resizeScrollableArea = 0;
     m_nodeUnderMouse = nullptr;
     m_lastNodeUnderMouse = nullptr;
-    m_lastInstanceUnderMouse = nullptr;
     m_lastMouseMoveEventSubframe = nullptr;
     m_lastScrollbarUnderMouse = nullptr;
     m_clickCount = 0;
@@ -278,9 +275,8 @@
     m_capturingMouseEventsNode = nullptr;
     m_latchedWheelEventNode = nullptr;
     m_previousWheelScrolledNode = nullptr;
-    m_originatingTouchPointTargets.clear();
-    m_originatingTouchPointDocument.clear();
-    m_originatingTouchPointTargetKey = 0;
+    m_targetForTouchID.clear();
+    m_touchSequenceDocument.clear();
     m_scrollGestureHandlingNode = nullptr;
     m_lastHitTestResultOverWidget = false;
     m_previousGestureScrolledNode = nullptr;
@@ -589,11 +585,10 @@
     if (event.isOverWidget() && passWidgetMouseDownEventToWidget(event))
         return true;
 
-    if (m_frame->document()->isSVGDocument()
-        && toSVGDocument(m_frame->document())->zoomAndPanEnabled()) {
+    if (m_frame->document()->isSVGDocument() && m_frame->document()->accessSVGExtensions().zoomAndPanEnabled()) {
         if (event.event().shiftKey() && singleClick) {
             m_svgPan = true;
-            toSVGDocument(m_frame->document())->startPan(m_frame->view()->windowToContents(event.event().position()));
+            m_frame->document()->accessSVGExtensions().startPan(m_frame->view()->windowToContents(event.event().position()));
             return true;
         }
     }
@@ -1399,7 +1394,7 @@
     cancelFakeMouseMoveEvent();
 
     if (m_svgPan) {
-        toSVGDocument(m_frame->document())->updatePan(m_frame->view()->windowToContents(m_lastKnownMousePosition));
+        m_frame->document()->accessSVGExtensions().updatePan(m_frame->view()->windowToContents(m_lastKnownMousePosition));
         return true;
     }
 
@@ -1529,7 +1524,7 @@
 
     if (m_svgPan) {
         m_svgPan = false;
-        toSVGDocument(m_frame->document())->updatePan(m_frame->view()->windowToContents(m_lastKnownMousePosition));
+        m_frame->document()->accessSVGExtensions().updatePan(m_frame->view()->windowToContents(m_lastKnownMousePosition));
         return true;
     }
 
@@ -1804,22 +1799,6 @@
     return m_frame->document()->prepareMouseEvent(request, documentPointForWindowPoint(m_frame, mev.position()), mev);
 }
 
-static inline SVGElementInstance* instanceAssociatedWithShadowTreeElement(Node* referenceNode)
-{
-    if (!referenceNode || !referenceNode->isSVGElement())
-        return 0;
-
-    ShadowRoot* shadowRoot = referenceNode->containingShadowRoot();
-    if (!shadowRoot)
-        return 0;
-
-    Element* shadowTreeParentElement = shadowRoot->host();
-    if (!isSVGUseElement(shadowTreeParentElement))
-        return 0;
-
-    return toSVGUseElement(shadowTreeParentElement)->instanceForShadowTreeElement(referenceNode);
-}
-
 void EventHandler::updateMouseEventTargetNode(Node* targetNode, const PlatformMouseEvent& mouseEvent, bool fireMouseOverOut)
 {
     Node* result = targetNode;
@@ -1834,37 +1813,6 @@
     }
     m_nodeUnderMouse = result;
 
-    // <use> shadow tree elements may have been recloned, update node under mouse in any case
-    if (m_lastInstanceUnderMouse) {
-        SVGElement* lastCorrespondingElement = m_lastInstanceUnderMouse->correspondingElement();
-        SVGElement* lastCorrespondingUseElement = m_lastInstanceUnderMouse->correspondingUseElement();
-
-        if (lastCorrespondingElement && lastCorrespondingUseElement) {
-            HashSet<SVGElementInstance*> instances = lastCorrespondingElement->instancesForElement();
-
-            // Locate the recloned shadow tree element for our corresponding instance
-            HashSet<SVGElementInstance*>::iterator end = instances.end();
-            for (HashSet<SVGElementInstance*>::iterator it = instances.begin(); it != end; ++it) {
-                SVGElementInstance* instance = (*it);
-                ASSERT(instance->correspondingElement() == lastCorrespondingElement);
-
-                if (instance == m_lastInstanceUnderMouse)
-                    continue;
-
-                if (instance->correspondingUseElement() != lastCorrespondingUseElement)
-                    continue;
-
-                SVGElement* shadowTreeElement = instance->shadowTreeElement();
-                if (!shadowTreeElement->inDocument() || m_lastNodeUnderMouse == shadowTreeElement)
-                    continue;
-
-                m_lastNodeUnderMouse = shadowTreeElement;
-                m_lastInstanceUnderMouse = instance;
-                break;
-            }
-        }
-    }
-
     // Fire mouseout/mouseover if the mouse has shifted to a different node.
     if (fireMouseOverOut) {
         RenderLayer* layerForLastNode = layerForNode(m_lastNodeUnderMouse.get());
@@ -1898,7 +1846,6 @@
         if (m_lastNodeUnderMouse && m_lastNodeUnderMouse->document() != m_frame->document()) {
             m_lastNodeUnderMouse = nullptr;
             m_lastScrollbarUnderMouse = nullptr;
-            m_lastInstanceUnderMouse = nullptr;
         }
 
         if (m_lastNodeUnderMouse != m_nodeUnderMouse) {
@@ -1910,7 +1857,6 @@
                 m_nodeUnderMouse->dispatchMouseEvent(mouseEvent, EventTypeNames::mouseover, 0, m_lastNodeUnderMouse.get());
         }
         m_lastNodeUnderMouse = m_nodeUnderMouse;
-        m_lastInstanceUnderMouse = instanceAssociatedWithShadowTreeElement(m_nodeUnderMouse.get());
     }
 }
 
@@ -2166,8 +2112,9 @@
             hitType |= HitTestRequest::ReadOnly;
     } else if (gestureEvent.type() == PlatformEvent::GestureTap) {
         hitType |= HitTestRequest::Release;
-        // If the Tap is received very shortly after ShowPress, we want to delay clearing
-        // of the active state so that it's visible to the user for at least one frame.
+        // If the Tap is received very shortly after ShowPress, we want to
+        // delay clearing of the active state so that it's visible to the user
+        // for at least a couple of frames.
         activeInterval = WTF::currentTime() - m_lastShowPressTimestamp;
         shouldKeepActiveForMinInterval = m_lastShowPressTimestamp && activeInterval < minimumActiveInterval;
         if (shouldKeepActiveForMinInterval)
@@ -2404,10 +2351,8 @@
     RefPtr<Node> node = m_scrollGestureHandlingNode;
     clearGestureScrollNodes();
 
-    if (node) {
-        ASSERT(node->refCount() > 0);
+    if (node)
         passGestureEventToWidgetIfPossible(gestureEvent, node->renderer());
-    }
 
     return false;
 }
@@ -3437,27 +3382,6 @@
 {
     TRACE_EVENT0("webkit", "EventHandler::handleTouchEvent");
 
-    // First build up the lists to use for the 'touches', 'targetTouches' and 'changedTouches' attributes
-    // in the JS event. See http://www.sitepen.com/blog/2008/07/10/touching-and-gesturing-on-the-iphone/
-    // for an overview of how these lists fit together.
-
-    // Holds the complete set of touches on the screen and will be used as the 'touches' list in the JS event.
-    RefPtrWillBeRawPtr<TouchList> touches = TouchList::create();
-
-    // A different view on the 'touches' list above, filtered and grouped by event target. Used for the
-    // 'targetTouches' list in the JS event.
-    typedef WillBeHeapHashMap<EventTarget*, RefPtrWillBeMember<TouchList> > TargetTouchesHeapMap;
-    TargetTouchesHeapMap touchesByTarget;
-
-    // Array of touches per state, used to assemble the 'changedTouches' list in the JS event.
-    typedef HashSet<RefPtr<EventTarget> > EventTargetSet;
-    struct {
-        // The touches corresponding to the particular change state this struct instance represents.
-        RefPtrWillBeMember<TouchList> m_touches;
-        // Set of targets involved in m_touches.
-        EventTargetSet m_targets;
-    } changedTouches[PlatformTouchPoint::TouchStateEnd];
-
     const Vector<PlatformTouchPoint>& points = event.touchPoints();
 
     UserGestureIndicator gestureIndicator(DefinitelyProcessingUserGesture);
@@ -3472,50 +3396,31 @@
         if (point.state() != PlatformTouchPoint::TouchReleased && point.state() != PlatformTouchPoint::TouchCancelled)
             allTouchReleased = false;
     }
+    if (freshTouchEvents) {
+        // Ideally we'd ASSERT !m_touchSequenceDocument here since we should
+        // have cleared the active document when we saw the last release. But we
+        // have some tests that violate this, ClusterFuzz could trigger it, and
+        // there may be cases where the browser doesn't reliably release all
+        // touches. http://crbug.com/345372 tracks this.
+        m_touchSequenceDocument.clear();
+    }
 
+    // First do hit tests for any new touch points.
     for (i = 0; i < points.size(); ++i) {
         const PlatformTouchPoint& point = points[i];
-        PlatformTouchPoint::State pointState = point.state();
         LayoutPoint pagePoint = documentPointForWindowPoint(m_frame, point.pos());
 
-        // Gesture events trigger the active state, not touch events,
-        // so touch event hit tests can always be read only.
-        HitTestRequest::HitTestRequestType hitType = HitTestRequest::TouchEvent | HitTestRequest::ReadOnly;
-        // The HitTestRequest types used for mouse events map quite adequately
-        // to touch events. Note that in addition to meaning that the hit test
-        // should affect the active state of the current node if necessary,
-        // HitTestRequest::Active signifies that the hit test is taking place
-        // with the mouse (or finger in this case) being pressed.
-        switch (pointState) {
-        case PlatformTouchPoint::TouchPressed:
-            hitType |= HitTestRequest::Active;
-            break;
-        case PlatformTouchPoint::TouchMoved:
-            hitType |= HitTestRequest::Active | HitTestRequest::Move;
-            break;
-        case PlatformTouchPoint::TouchReleased:
-        case PlatformTouchPoint::TouchCancelled:
-            hitType |= HitTestRequest::Release;
-            break;
-        case PlatformTouchPoint::TouchStationary:
-            hitType |= HitTestRequest::Active;
-            break;
-        default:
-            ASSERT_NOT_REACHED();
-            break;
-        }
-
-        // Increment the platform touch id by 1 to avoid storing a key of 0 in the hashmap.
-        unsigned touchPointTargetKey = point.id() + 1;
-        RefPtr<EventTarget> touchTarget;
-        if (pointState == PlatformTouchPoint::TouchPressed) {
+        // Touch events implicitly capture to the touched node, and don't change
+        // active/hover states themselves (Gesture events do). So we only need
+        // to hit-test on touchstart, and it can be read-only.
+        if (point.state() == PlatformTouchPoint::TouchPressed) {
+            HitTestRequest::HitTestRequestType hitType = HitTestRequest::TouchEvent | HitTestRequest::ReadOnly | HitTestRequest::Active;
             HitTestResult result;
-            if (freshTouchEvents) {
+            if (!m_touchSequenceDocument) {
                 result = hitTestResultAtPoint(pagePoint, hitType);
-                m_originatingTouchPointTargetKey = touchPointTargetKey;
-            } else if (m_originatingTouchPointDocument.get() && m_originatingTouchPointDocument->frame()) {
-                LayoutPoint pagePointInOriginatingDocument = documentPointForWindowPoint(m_originatingTouchPointDocument->frame(), point.pos());
-                result = hitTestResultInFrame(m_originatingTouchPointDocument->frame(), pagePointInOriginatingDocument, hitType);
+            } else if (m_touchSequenceDocument->frame()) {
+                LayoutPoint pagePointInOriginatingDocument = documentPointForWindowPoint(m_touchSequenceDocument->frame(), point.pos());
+                result = hitTestResultInFrame(m_touchSequenceDocument->frame(), pagePointInOriginatingDocument, hitType);
             } else
                 continue;
 
@@ -3527,40 +3432,108 @@
             if (node->isTextNode())
                 node = NodeRenderingTraversal::parent(node);
 
-            Document& doc = node->document();
-            // Record the originating touch document even if it does not have a touch listener.
-            if (freshTouchEvents) {
-                m_originatingTouchPointDocument = &doc;
-                freshTouchEvents = false;
+            if (!m_touchSequenceDocument) {
+                // Keep track of which document should receive all touch events
+                // in the active sequence. This must be a single document to
+                // ensure we don't leak Nodes between documents.
+                m_touchSequenceDocument = &(result.innerNode()->document());
             }
-            if (!doc.hasTouchEventHandlers())
-                continue;
-            m_originatingTouchPointTargets.set(touchPointTargetKey, node);
-            touchTarget = node;
+
+            // Ideally we'd ASSERT(!m_targetForTouchID.contains(point.id())
+            // since we shouldn't get a touchstart for a touch that's already
+            // down. However EventSender allows this to be violated and there's
+            // some tests that take advantage of it. There may also be edge
+            // cases in the browser where this happens.
+            // See http://crbug.com/345372.
+            m_targetForTouchID.set(point.id(), node);
 
             TouchAction effectiveTouchAction = computeEffectiveTouchAction(pagePoint);
             if (effectiveTouchAction != TouchActionAuto)
                 m_frame->page()->chrome().client().setTouchAction(effectiveTouchAction);
+        }
+    }
 
-        } else if (pointState == PlatformTouchPoint::TouchReleased || pointState == PlatformTouchPoint::TouchCancelled) {
-            // The target should be the original target for this touch, so get it from the hashmap. As it's a release or cancel
-            // we also remove it from the map.
-            touchTarget = m_originatingTouchPointTargets.take(touchPointTargetKey);
-        } else
-            // No hittest is performed on move or stationary, since the target is not allowed to change anyway.
-            touchTarget = m_originatingTouchPointTargets.get(touchPointTargetKey);
+    m_touchPressed = !allTouchReleased;
 
-        if (!touchTarget.get())
-            continue;
-        Document& doc = touchTarget->toNode()->document();
-        if (!doc.hasTouchEventHandlers())
-            continue;
-        LocalFrame* targetFrame = doc.frame();
-        if (!targetFrame)
-            continue;
+    // If there's no document receiving touch events, or no handlers on the
+    // document set to receive the events, then we can skip all the rest of
+    // this work.
+    if (!m_touchSequenceDocument || !m_touchSequenceDocument->hasTouchEventHandlers() || !m_touchSequenceDocument->frame()) {
+        if (allTouchReleased)
+            m_touchSequenceDocument.clear();
+        return false;
+    }
+
+    // Build up the lists to use for the 'touches', 'targetTouches' and
+    // 'changedTouches' attributes in the JS event. See
+    // http://www.w3.org/TR/touch-events/#touchevent-interface for how these
+    // lists fit together.
+
+    // Holds the complete set of touches on the screen.
+    RefPtrWillBeRawPtr<TouchList> touches = TouchList::create();
+
+    // A different view on the 'touches' list above, filtered and grouped by
+    // event target. Used for the 'targetTouches' list in the JS event.
+    typedef WillBeHeapHashMap<EventTarget*, RefPtrWillBeMember<TouchList> > TargetTouchesHeapMap;
+    TargetTouchesHeapMap touchesByTarget;
+
+    // Array of touches per state, used to assemble the 'changedTouches' list.
+    typedef HashSet<RefPtr<EventTarget> > EventTargetSet;
+    struct {
+        // The touches corresponding to the particular change state this struct
+        // instance represents.
+        RefPtrWillBeMember<TouchList> m_touches;
+        // Set of targets involved in m_touches.
+        EventTargetSet m_targets;
+    } changedTouches[PlatformTouchPoint::TouchStateEnd];
+
+    for (i = 0; i < points.size(); ++i) {
+        const PlatformTouchPoint& point = points[i];
+        LayoutPoint pagePoint = documentPointForWindowPoint(m_frame, point.pos());
+        PlatformTouchPoint::State pointState = point.state();
+        RefPtr<EventTarget> touchTarget;
+
+        if (pointState == PlatformTouchPoint::TouchReleased || pointState == PlatformTouchPoint::TouchCancelled) {
+            // The target should be the original target for this touch, so get
+            // it from the hashmap. As it's a release or cancel we also remove
+            // it from the map.
+            touchTarget = m_targetForTouchID.take(point.id());
+        } else {
+            // No hittest is performed on move or stationary, since the target
+            // is not allowed to change anyway.
+            touchTarget = m_targetForTouchID.get(point.id());
+        }
+
+        LocalFrame* targetFrame;
+        bool knownTarget;
+        if (touchTarget) {
+            Document& doc = touchTarget->toNode()->document();
+            ASSERT(&doc == m_touchSequenceDocument.get());
+            targetFrame = doc.frame();
+            knownTarget = true;
+        } else {
+            // If we don't have a target registered for the point it means we've
+            // missed our opportunity to do a hit test for it (due to some
+            // optimization that prevented blink from ever seeing the
+            // touchstart), or that the touch started outside the active touch
+            // sequence document. We should still include the touch in the
+            // Touches list reported to the application (eg. so it can
+            // differentiate between a one and two finger gesture), but we won't
+            // actually dispatch any events for it. Set the target to the
+            // Document so that there's some valid node here. Perhaps this
+            // should really be DOMWindow, but in all other cases the target of
+            // a Touch is a Node so using the window could be a breaking change.
+            // Since we know there was no handler invoked, the specific target
+            // should be completely irrelevant to the application.
+            touchTarget = m_touchSequenceDocument;
+            targetFrame = m_touchSequenceDocument->frame();
+            knownTarget = false;
+        }
+        ASSERT(targetFrame);
 
         if (m_frame != targetFrame) {
-            // pagePoint should always be relative to the target elements containing frame.
+            // pagePoint should always be relative to the target elements
+            // containing frame.
             pagePoint = documentPointForWindowPoint(targetFrame, point.pos());
         }
 
@@ -3577,15 +3550,17 @@
                                             adjustedRadiusX, adjustedRadiusY,
                                             point.rotationAngle(), point.force());
 
-        // Ensure this target's touch list exists, even if it ends up empty, so it can always be passed to TouchEvent::Create below.
+        // Ensure this target's touch list exists, even if it ends up empty, so
+        // it can always be passed to TouchEvent::Create below.
         TargetTouchesHeapMap::iterator targetTouchesIterator = touchesByTarget.find(touchTarget.get());
         if (targetTouchesIterator == touchesByTarget.end()) {
             touchesByTarget.set(touchTarget.get(), TouchList::create());
             targetTouchesIterator = touchesByTarget.find(touchTarget.get());
         }
 
-        // touches and targetTouches should only contain information about touches still on the screen, so if this point is
-        // released or cancelled it will only appear in the changedTouches list.
+        // touches and targetTouches should only contain information about
+        // touches still on the screen, so if this point is released or
+        // cancelled it will only appear in the changedTouches list.
         if (pointState != PlatformTouchPoint::TouchReleased && pointState != PlatformTouchPoint::TouchCancelled) {
             touches->append(touch);
             targetTouchesIterator->value->append(touch);
@@ -3594,10 +3569,10 @@
         // Now build up the correct list for changedTouches.
         // Note that  any touches that are in the TouchStationary state (e.g. if
         // the user had several points touched but did not move them all) should
-        // never be in the changedTouches list so we do not handle them explicitly here.
-        // See https://bugs.webkit.org/show_bug.cgi?id=37609 for further discussion
-        // about the TouchStationary state.
-        if (pointState != PlatformTouchPoint::TouchStationary) {
+        // never be in the changedTouches list so we do not handle them
+        // explicitly here. See https://bugs.webkit.org/show_bug.cgi?id=37609
+        // for further discussion about the TouchStationary state.
+        if (pointState != PlatformTouchPoint::TouchStationary && knownTarget) {
             ASSERT(pointState < PlatformTouchPoint::TouchStateEnd);
             if (!changedTouches[pointState].m_touches)
                 changedTouches[pointState].m_touches = TouchList::create();
@@ -3605,32 +3580,24 @@
             changedTouches[pointState].m_targets.add(touchTarget);
         }
     }
-    m_touchPressed = touches->length() > 0;
     if (allTouchReleased)
-        m_originatingTouchPointDocument.clear();
+        m_touchSequenceDocument.clear();
 
-    // Now iterate the changedTouches list and m_targets within it, sending events to the targets as required.
+    // Now iterate the changedTouches list and m_targets within it, sending
+    // events to the targets as required.
     bool swallowedEvent = false;
-    RefPtrWillBeRawPtr<TouchList> emptyList = TouchList::create();
     for (unsigned state = 0; state != PlatformTouchPoint::TouchStateEnd; ++state) {
         if (!changedTouches[state].m_touches)
             continue;
 
-        // When sending a touch cancel event, use empty touches and targetTouches lists.
-        bool isTouchCancelEvent = (state == PlatformTouchPoint::TouchCancelled);
-        RefPtrWillBeRawPtr<TouchList>& effectiveTouches(isTouchCancelEvent ? emptyList : touches);
         const AtomicString& stateName(eventNameForTouchPointState(static_cast<PlatformTouchPoint::State>(state)));
         const EventTargetSet& targetsForState = changedTouches[state].m_targets;
-
         for (EventTargetSet::const_iterator it = targetsForState.begin(); it != targetsForState.end(); ++it) {
             EventTarget* touchEventTarget = it->get();
-            RefPtrWillBeRawPtr<TouchList> targetTouches(isTouchCancelEvent ? emptyList.get() : touchesByTarget.get(touchEventTarget));
-            ASSERT(targetTouches);
-
-            RefPtrWillBeRawPtr<TouchEvent> touchEvent =
-                TouchEvent::create(effectiveTouches.get(), targetTouches.get(), changedTouches[state].m_touches.get(),
-                    stateName, touchEventTarget->toNode()->document().domWindow(),
-                    0, 0, 0, 0, event.ctrlKey(), event.altKey(), event.shiftKey(), event.metaKey(), event.cancelable());
+            RefPtrWillBeRawPtr<TouchEvent> touchEvent = TouchEvent::create(
+                touches.get(), touchesByTarget.get(touchEventTarget), changedTouches[state].m_touches.get(),
+                stateName, touchEventTarget->toNode()->document().domWindow(),
+                0, 0, 0, 0, event.ctrlKey(), event.altKey(), event.shiftKey(), event.metaKey(), event.cancelable());
             touchEventTarget->toNode()->dispatchTouchEvent(touchEvent.get());
             swallowedEvent = swallowedEvent || touchEvent->defaultPrevented() || touchEvent->defaultHandled();
         }
diff --git a/Source/core/page/EventHandler.h b/Source/core/page/EventHandler.h
index 06dca73..e157c2d 100644
--- a/Source/core/page/EventHandler.h
+++ b/Source/core/page/EventHandler.h
@@ -41,6 +41,7 @@
 #include "platform/scroll/ScrollTypes.h"
 #include "wtf/Forward.h"
 #include "wtf/HashMap.h"
+#include "wtf/HashTraits.h"
 #include "wtf/RefPtr.h"
 
 namespace WebCore {
@@ -333,7 +334,6 @@
     Timer<EventHandler> m_fakeMouseMoveEventTimer;
 
     bool m_svgPan;
-    RefPtr<SVGElementInstance> m_lastInstanceUnderMouse;
 
     RenderLayerScrollableArea* m_resizeScrollableArea;
 
@@ -369,10 +369,13 @@
 
     RefPtr<Node> m_previousWheelScrolledNode;
 
-    typedef HashMap<int, RefPtr<EventTarget> > TouchTargetMap;
-    TouchTargetMap m_originatingTouchPointTargets;
-    RefPtr<Document> m_originatingTouchPointDocument;
-    unsigned m_originatingTouchPointTargetKey;
+    // The target of each active touch point indexed by the touch ID.
+    typedef HashMap<unsigned, RefPtr<EventTarget>, DefaultHash<unsigned>::Hash, WTF::UnsignedWithZeroKeyHashTraits<unsigned> > TouchTargetMap;
+    TouchTargetMap m_targetForTouchID;
+
+    // If set, the document of the active touch sequence. Unset if no touch sequence active.
+    RefPtr<Document> m_touchSequenceDocument;
+
     bool m_touchPressed;
 
     RefPtr<Node> m_scrollGestureHandlingNode;
diff --git a/Source/core/page/EventSource.idl b/Source/core/page/EventSource.idl
index aa3d6b2..932fece 100644
--- a/Source/core/page/EventSource.idl
+++ b/Source/core/page/EventSource.idl
@@ -34,7 +34,7 @@
     ActiveDOMObject,
     Constructor(DOMString url, optional Dictionary eventSourceInit),
     ConstructorCallWith=ExecutionContext,
-    GlobalContext=Window&WorkerGlobalScope,
+    Exposed=Window&Worker,
     RaisesException=Constructor,
 ] interface EventSource : EventTarget {
 
diff --git a/Source/core/page/Page.cpp b/Source/core/page/Page.cpp
index cffd5c3..a2ed7e8 100644
--- a/Source/core/page/Page.cpp
+++ b/Source/core/page/Page.cpp
@@ -30,6 +30,7 @@
 #include "core/fetch/ResourceFetcher.h"
 #include "core/frame/DOMTimer.h"
 #include "core/frame/DOMWindow.h"
+#include "core/frame/EventHandlerRegistry.h"
 #include "core/frame/FrameHost.h"
 #include "core/frame/FrameView.h"
 #include "core/frame/LocalFrame.h"
@@ -53,7 +54,6 @@
 #include "core/rendering/FastTextAutosizer.h"
 #include "core/rendering/RenderView.h"
 #include "core/rendering/TextAutosizer.h"
-#include "core/speech/SpeechInput.h"
 #include "core/storage/StorageNamespace.h"
 #include "platform/plugins/PluginData.h"
 #include "wtf/HashMap.h"
@@ -205,6 +205,7 @@
     m_contextMenuController->documentDetached(document);
     if (m_validationMessageClient)
         m_validationMessageClient->documentDetached(*document);
+    m_frameHost->eventHandlerRegistry().documentDetached(*document);
 }
 
 bool Page::openedByDOM() const
@@ -541,6 +542,7 @@
 void Page::trace(Visitor* visitor)
 {
     visitor->trace(m_multisamplingChangedObservers);
+    visitor->trace(m_frameHost);
     WillBeHeapSupplementable<Page>::trace(visitor);
 }
 
diff --git a/Source/core/page/Page.h b/Source/core/page/Page.h
index f8fc9c9..bb7c72b 100644
--- a/Source/core/page/Page.h
+++ b/Source/core/page/Page.h
@@ -217,7 +217,6 @@
     PassOwnPtr<LifecycleNotifier<Page> > createLifecycleNotifier();
 
     void trace(Visitor*);
-    void clearWeakMembers(Visitor*);
     void willBeDestroyed();
 
 protected:
@@ -287,7 +286,7 @@
 
     // A pointer to all the interfaces provided to in-process Frames for this Page.
     // FIXME: Most of the members of Page should move onto FrameHost.
-    OwnPtr<FrameHost> m_frameHost;
+    OwnPtrWillBeMember<FrameHost> m_frameHost;
 };
 
 } // namespace WebCore
diff --git a/Source/core/page/PointerLockController.cpp b/Source/core/page/PointerLockController.cpp
index ab377a3..257cfa9 100644
--- a/Source/core/page/PointerLockController.cpp
+++ b/Source/core/page/PointerLockController.cpp
@@ -49,6 +49,7 @@
 void PointerLockController::requestPointerLock(Element* target)
 {
     if (!target || !target->inDocument() || m_documentOfRemovedElementWhileWaitingForUnlock) {
+        enqueueEvent(EventTypeNames::pointerlockerror, target);
         enqueueEvent(EventTypeNames::webkitpointerlockerror, target);
         return;
     }
@@ -56,21 +57,25 @@
     if (target->document().isSandboxed(SandboxPointerLock)) {
         // FIXME: This message should be moved off the console once a solution to https://bugs.webkit.org/show_bug.cgi?id=103274 exists.
         target->document().addConsoleMessage(SecurityMessageSource, ErrorMessageLevel, "Blocked pointer lock on an element because the element's frame is sandboxed and the 'allow-pointer-lock' permission is not set.");
+        enqueueEvent(EventTypeNames::pointerlockerror, target);
         enqueueEvent(EventTypeNames::webkitpointerlockerror, target);
         return;
     }
 
     if (m_element) {
         if (m_element->document() != target->document()) {
+            enqueueEvent(EventTypeNames::pointerlockerror, target);
             enqueueEvent(EventTypeNames::webkitpointerlockerror, target);
             return;
         }
+        enqueueEvent(EventTypeNames::pointerlockchange, target);
         enqueueEvent(EventTypeNames::webkitpointerlockchange, target);
         m_element = target;
     } else if (m_page->chrome().client().requestPointerLock()) {
         m_lockPending = true;
         m_element = target;
     } else {
+        enqueueEvent(EventTypeNames::pointerlockerror, target);
         enqueueEvent(EventTypeNames::webkitpointerlockerror, target);
     }
 }
@@ -111,18 +116,21 @@
 
 void PointerLockController::didAcquirePointerLock()
 {
+    enqueueEvent(EventTypeNames::pointerlockchange, m_element.get());
     enqueueEvent(EventTypeNames::webkitpointerlockchange, m_element.get());
     m_lockPending = false;
 }
 
 void PointerLockController::didNotAcquirePointerLock()
 {
+    enqueueEvent(EventTypeNames::pointerlockerror, m_element.get());
     enqueueEvent(EventTypeNames::webkitpointerlockerror, m_element.get());
     clearElement();
 }
 
 void PointerLockController::didLosePointerLock()
 {
+    enqueueEvent(EventTypeNames::pointerlockchange, m_element ? &m_element->document() : m_documentOfRemovedElementWhileWaitingForUnlock.get());
     enqueueEvent(EventTypeNames::webkitpointerlockchange, m_element ? &m_element->document() : m_documentOfRemovedElementWhileWaitingForUnlock.get());
     clearElement();
     m_documentOfRemovedElementWhileWaitingForUnlock = nullptr;
diff --git a/Source/core/page/Selection.idl b/Source/core/page/Selection.idl
index dee956d..53b0826 100644
--- a/Source/core/page/Selection.idl
+++ b/Source/core/page/Selection.idl
@@ -61,28 +61,27 @@
     [NotEnumerable] DOMString toString();
 
     // WebKit extensions
-    readonly attribute Node baseNode;
-    readonly attribute long baseOffset;
-    readonly attribute Node extentNode;
-    readonly attribute long extentOffset;
+    [MeasureAs=SelectionBaseNode] readonly attribute Node baseNode;
+    [MeasureAs=SelectionBaseOffset] readonly attribute long baseOffset;
+    [MeasureAs=SelectionExtentNode] readonly attribute Node extentNode;
+    [MeasureAs=SelectionExtentOffset] readonly attribute long extentOffset;
 
     // WebKit's "type" accessor returns "None", "Range" and "Caret"
     // IE's type accessor returns "none", "text" and "control"
-    readonly attribute DOMString type;
+    [MeasureAs=SelectionType] readonly attribute DOMString type;
 
-    void modify([Default=Undefined] optional DOMString alter,
-                [Default=Undefined] optional DOMString direction,
-                [Default=Undefined] optional DOMString granularity);
-    [RaisesException] void setBaseAndExtent([Default=Undefined] optional Node baseNode,
-                          [Default=Undefined] optional long baseOffset,
-                          [Default=Undefined] optional Node extentNode,
-                          [Default=Undefined] optional long extentOffset);
+    [MeasureAs=SelectionModify] void modify([Default=Undefined] optional DOMString alter,
+                                            [Default=Undefined] optional DOMString direction,
+                                            [Default=Undefined] optional DOMString granularity);
+    [MeasureAs=SelectionSetBaseAndExtent, RaisesException] void setBaseAndExtent([Default=Undefined] optional Node baseNode,
+                                                                                 [Default=Undefined] optional long baseOffset,
+                                                                                 [Default=Undefined] optional Node extentNode,
+                                                                                 [Default=Undefined] optional long extentOffset);
     [ImplementedAs=collapse, MeasureAs=SelectionSetPosition, RaisesException, TypeChecking=Interface|Nullable] void setPosition(Node node,
-                                                                                                                   optional long offset);
-
+                                                                                                                                optional long offset);
 
     // IE extentions
     // http://msdn.microsoft.com/en-us/library/ms535869(VS.85).aspx
-    void empty();
+    [MeasureAs=SelectionEmpty] void empty();
 };
 
diff --git a/Source/core/page/scrolling/ScrollingCoordinator.cpp b/Source/core/page/scrolling/ScrollingCoordinator.cpp
index ca643a2..ec2352f 100644
--- a/Source/core/page/scrolling/ScrollingCoordinator.cpp
+++ b/Source/core/page/scrolling/ScrollingCoordinator.cpp
@@ -32,10 +32,11 @@
 #include "core/dom/FullscreenElementStack.h"
 #include "core/dom/Node.h"
 #include "core/dom/WheelController.h"
-#include "core/html/HTMLElement.h"
+#include "core/frame/EventHandlerRegistry.h"
 #include "core/frame/FrameView.h"
 #include "core/frame/LocalFrame.h"
 #include "core/frame/Settings.h"
+#include "core/html/HTMLElement.h"
 #include "core/page/Page.h"
 #include "core/plugins/PluginView.h"
 #include "core/rendering/RenderGeometryMap.h"
@@ -348,8 +349,9 @@
     GraphicsLayer* scrollLayer = scrollableArea->layerForScrolling();
 
     if (scrollLayer) {
+        ASSERT(m_page);
         // With pinch virtual viewport we no longer need to special case the main frame.
-        bool pinchVirtualViewportEnabled = m_page->mainFrame()->document()->settings()->pinchVirtualViewportEnabled();
+        bool pinchVirtualViewportEnabled = m_page->settings().pinchVirtualViewportEnabled();
         bool layerScrollShouldFireGraphicsLayerDidScroll = isForMainFrame(scrollableArea) && !pinchVirtualViewportEnabled;
         scrollLayer->setScrollableArea(scrollableArea, layerScrollShouldFireGraphicsLayerDidScroll);
     }
@@ -678,8 +680,7 @@
     // instead on a per-layer basis. We therefore only update this information for the root
     // scrolling layer.
     if (WebLayer* scrollLayer = toWebLayer(m_page->mainFrame()->view()->layerForScrolling())) {
-        // TODO(skyostil): Hook this up.
-        bool haveHandlers = false;
+        bool haveHandlers = m_page->frameHost().eventHandlerRegistry().hasEventHandlers(EventHandlerRegistry::ScrollEvent);
         scrollLayer->setHaveScrollEventHandlers(haveHandlers);
     }
 }
diff --git a/Source/core/plugins/PluginOcclusionSupport.cpp b/Source/core/plugins/PluginOcclusionSupport.cpp
index d637996..f554141 100644
--- a/Source/core/plugins/PluginOcclusionSupport.cpp
+++ b/Source/core/plugins/PluginOcclusionSupport.cpp
@@ -193,7 +193,7 @@
     // as being in the top layer.
     const Element* ancestor = topLayerAncestor(element);
     Document* document = parentFrameView->frame().document();
-    const Vector<RefPtr<Element> >& elements = document->topLayerElements();
+    const WillBeHeapVector<RefPtrWillBeMember<Element> >& elements = document->topLayerElements();
     size_t start = ancestor ? elements.find(ancestor) + 1 : 0;
     for (size_t i = start; i < elements.size(); ++i)
         addTreeToOcclusions(elements[i]->renderer(), frameRect, occlusions);
diff --git a/Source/core/rendering/ClipRect.h b/Source/core/rendering/ClipRect.h
index ad57d06..b0bed95 100644
--- a/Source/core/rendering/ClipRect.h
+++ b/Source/core/rendering/ClipRect.h
@@ -196,12 +196,12 @@
 public:
     ClipRectsCache()
     {
-#ifndef NDEBUG
         for (int i = 0; i < NumCachedClipRectsTypes; ++i) {
             m_clipRectsRoot[i] = 0;
+#ifndef NDEBUG
             m_scrollbarRelevancy[i] = IgnoreOverlayScrollbarSize;
-        }
 #endif
+        }
     }
 
     PassRefPtr<ClipRects> getClipRects(ClipRectsType clipRectsType, ShouldRespectOverflowClip respectOverflow) { return m_clipRects[getIndex(clipRectsType, respectOverflow)]; }
diff --git a/Source/core/rendering/FastTextAutosizer.cpp b/Source/core/rendering/FastTextAutosizer.cpp
index 3aae41f..a4d738b 100644
--- a/Source/core/rendering/FastTextAutosizer.cpp
+++ b/Source/core/rendering/FastTextAutosizer.cpp
@@ -43,30 +43,74 @@
 #include "core/rendering/RenderTableCell.h"
 #include "core/rendering/RenderView.h"
 
+#ifdef AUTOSIZING_DOM_DEBUG_INFO
+#include "core/dom/ExecutionContextTask.h"
+#endif
+
 using namespace std;
 
 namespace WebCore {
 
 #ifdef AUTOSIZING_DOM_DEBUG_INFO
-static void writeDebugInfo(RenderObject* renderObject, const AtomicString& output)
+class WriteDebugInfoTask : public ExecutionContextTask {
+public:
+    WriteDebugInfoTask(PassRefPtr<Element> element, AtomicString value)
+        : m_element(element)
+        , m_value(value)
+    {
+    }
+
+    virtual void performTask(ExecutionContext*)
+    {
+        m_element->setAttribute("data-autosizing", m_value, ASSERT_NO_EXCEPTION);
+    }
+
+private:
+    RefPtr<Element> m_element;
+    AtomicString m_value;
+};
+
+static void writeDebugInfo(RenderObject* renderer, const AtomicString& output)
 {
-    Node* node = renderObject->node();
+    Node* node = renderer->node();
     if (!node)
         return;
     if (node->isDocumentNode())
         node = toDocument(node)->documentElement();
-    if (node->isElementNode())
-        toElement(node)->setAttribute("data-autosizing", output, ASSERT_NO_EXCEPTION);
+    if (!node->isElementNode())
+        return;
+    node->document().postTask(adoptPtr(new WriteDebugInfoTask(toElement(node), output)));
 }
 
-static void writeDebugPageInfo(const Document* document, float baseMultiplier, int layoutWidth, int frameWidth)
+void FastTextAutosizer::writeClusterDebugInfo(Cluster* cluster)
 {
-    if (Element* element = document->documentElement()) {
-        element->setAttribute("data-autosizing-pageinfo",
-            AtomicString(String::format("bm %f * (lw %d / fw %d)",
-                baseMultiplier, layoutWidth, frameWidth)),
-            ASSERT_NO_EXCEPTION);
+    String explanation = "";
+    if (cluster->m_flags & SUPPRESSING) {
+        explanation = "[suppressed]";
+    } else if (!(cluster->m_flags & (INDEPENDENT | WIDER_OR_NARROWER))) {
+        explanation = "[inherited]";
+    } else if (cluster->m_supercluster) {
+        explanation = "[supercluster]";
+    } else if (!clusterHasEnoughTextToAutosize(cluster)) {
+        explanation = "[insufficient-text]";
+    } else {
+        const RenderBlock* widthProvider = clusterWidthProvider(cluster->m_root);
+        if (cluster->m_hasTableAncestor && cluster->m_multiplier < multiplierFromBlock(widthProvider)) {
+            explanation = "[table-ancestor-limited]";
+        } else {
+            explanation = String::format("[from width %d of %s]",
+                static_cast<int>(widthFromBlock(widthProvider)), widthProvider->debugName().utf8().data());
+        }
     }
+    String pageInfo = "";
+    if (cluster->m_root->isRenderView()) {
+        pageInfo = String::format("; pageinfo: bm %f * (lw %d / fw %d)",
+            m_pageInfo.m_baseMultiplier, m_pageInfo.m_layoutWidth, m_pageInfo.m_frameWidth);
+    }
+    float multiplier = cluster->m_flags & SUPPRESSING ? 1.0 : cluster->m_multiplier;
+    writeDebugInfo(const_cast<RenderBlock*>(cluster->m_root),
+        AtomicString(String::format("cluster: %f %s%s", multiplier,
+            explanation.utf8().data(), pageInfo.utf8().data())));
 }
 #endif
 
@@ -276,9 +320,17 @@
 {
     if (!m_pageInfo.m_settingEnabled)
         return;
+
     ASSERT(!m_blocksThatHaveBegunLayout.contains(block));
 
-    m_fingerprintMapper.remove(block);
+    if (m_fingerprintMapper.remove(block) && m_firstBlockToBeginLayout) {
+        // RenderBlock with a fingerprint was destroyed during layout.
+        // Clear the cluster stack and the supercluster map to avoid stale pointers.
+        // Speculative fix for http://crbug.com/369485.
+        m_firstBlockToBeginLayout = 0;
+        m_clusterStack.clear();
+        m_superclusters.clear();
+    }
 }
 
 FastTextAutosizer::BeginLayoutBehavior FastTextAutosizer::prepareForLayout(const RenderBlock* block)
@@ -288,9 +340,6 @@
 #endif
 
     if (!m_firstBlockToBeginLayout) {
-#ifdef AUTOSIZING_DOM_DEBUG_INFO
-        writeDebugPageInfo(m_document, m_pageInfo.m_baseMultiplier, m_pageInfo.m_layoutWidth, m_pageInfo.m_frameWidth);
-#endif
         m_firstBlockToBeginLayout = block;
         prepareClusterStack(block->parent());
     } else if (block == currentCluster()->m_root) {
@@ -605,7 +654,8 @@
     RenderObject* descendant = root->nextInPreOrder(root);
     while (descendant) {
         if (descendant->isRenderBlock()) {
-            if (!descendant->isTableCell() && classifyBlock(descendant, INDEPENDENT | SUPPRESSING)) {
+            if (!(descendant->isTableCell() || (root->isTableCell() && descendant->isTable()))
+                && classifyBlock(descendant, INDEPENDENT | SUPPRESSING)) {
                 descendant = descendant->nextInPreOrderAfterChildren(root);
                 continue;
             }
@@ -687,7 +737,13 @@
     if (!(flags & INDEPENDENT) && !(flags & EXPLICIT_WIDTH) && !!(flags & SUPPRESSING) == parentSuppresses)
         return 0;
 
-    return new Cluster(block, flags, parentCluster, getSupercluster(block));
+    Cluster* cluster = new Cluster(block, flags, parentCluster, getSupercluster(block));
+#ifdef AUTOSIZING_DOM_DEBUG_INFO
+    // Non-SUPPRESSING clusters are annotated in clusterMultiplier.
+    if (flags & SUPPRESSING)
+        writeClusterDebugInfo(cluster);
+#endif
+    return cluster;
 }
 
 FastTextAutosizer::Supercluster* FastTextAutosizer::getSupercluster(const RenderBlock* block)
@@ -734,25 +790,7 @@
     }
 
 #ifdef AUTOSIZING_DOM_DEBUG_INFO
-    // FIXME(crbug.com/339213): Reduce redundant logic by storing the explanation category in the Cluster.
-    String explanation = "";
-    if (!(cluster->m_flags & (INDEPENDENT | WIDER_OR_NARROWER))) {
-        explanation = "[inherited]";
-    } else if (cluster->m_supercluster) {
-        explanation = "[supercluster]";
-    } else if (!clusterHasEnoughTextToAutosize(cluster)) {
-        explanation = "[insufficient-text]";
-    } else {
-        const RenderBlock* widthProvider = clusterWidthProvider(cluster->m_root);
-        if (cluster->m_hasTableAncestor && cluster->m_multiplier < multiplierFromBlock(widthProvider)) {
-            explanation = "[table-ancestor-limited]";
-        } else {
-            explanation = String::format("[from width %d of %s]",
-                static_cast<int>(widthFromBlock(widthProvider)), widthProvider->debugName().utf8().data());
-        }
-    }
-    writeDebugInfo(const_cast<RenderBlock*>(cluster->m_root),
-        AtomicString(String::format("cluster: %f %s", cluster->m_multiplier, explanation.utf8().data())));
+    writeClusterDebugInfo(cluster);
 #endif
 
     ASSERT(cluster->m_multiplier);
@@ -811,14 +849,18 @@
             result = widthProvider;
         }
     }
+    RELEASE_ASSERT(result);
     return result;
 }
 
 float FastTextAutosizer::widthFromBlock(const RenderBlock* block)
 {
+    RELEASE_ASSERT(block);
+    RELEASE_ASSERT(block->style());
     if (block->isTable()) {
         RenderBlock* containingBlock = block->containingBlock();
-        ASSERT(block->containingBlock());
+        // containingBlock should only be null in detached subtrees.
+        RELEASE_ASSERT(block->containingBlock());
         if (block->style()->logicalWidth().isSpecified())
             return floatValueForLength(block->style()->logicalWidth(), containingBlock->contentLogicalWidth().toFloat());
         return containingBlock->contentLogicalWidth().toFloat();
@@ -887,8 +929,10 @@
     // its text node's lowest common ancestor as isAutosizingCluster would have made them into their
     // own independent cluster.
     const RenderBlock* containingBlock = firstNode->containingBlock();
-    ASSERT(containingBlock->isDescendantOf(root));
+    if (!containingBlock)
+        return root;
 
+    ASSERT(containingBlock->isDescendantOf(root));
     return containingBlock;
 }
 
@@ -930,12 +974,12 @@
     style->setTextAutosizingMultiplier(multiplier);
     style->setUnique();
 
-    // Don't free currentStyle until the end of the layout pass. This allows other parts of the system
-    // to safely hold raw RenderStyle* pointers during layout, e.g. BreakingContext::m_currentStyle.
-    m_stylesRetainedDuringLayout.append(currentStyle);
-
     switch (relayoutBehavior) {
     case AlreadyInLayout:
+        // Don't free currentStyle until the end of the layout pass. This allows other parts of the system
+        // to safely hold raw RenderStyle* pointers during layout, e.g. BreakingContext::m_currentStyle.
+        m_stylesRetainedDuringLayout.append(currentStyle);
+
         renderer->setStyleInternal(style.release());
         renderer->setNeedsLayout();
         if (renderer->isRenderBlock())
@@ -1024,15 +1068,15 @@
 #endif
 }
 
-void FastTextAutosizer::FingerprintMapper::remove(const RenderObject* renderer)
+bool FastTextAutosizer::FingerprintMapper::remove(const RenderObject* renderer)
 {
     Fingerprint fingerprint = m_fingerprints.take(renderer);
     if (!fingerprint || !renderer->isRenderBlock())
-        return;
+        return false;
 
     ReverseFingerprintMap::iterator blocksIter = m_blocksForFingerprint.find(fingerprint);
     if (blocksIter == m_blocksForFingerprint.end())
-        return;
+        return false;
 
     BlockSet& blocks = *blocksIter->value;
     blocks.remove(toRenderBlock(renderer));
@@ -1041,6 +1085,7 @@
 #ifndef NDEBUG
     assertMapsAreConsistent();
 #endif
+    return true;
 }
 
 FastTextAutosizer::Fingerprint FastTextAutosizer::FingerprintMapper::get(const RenderObject* renderer)
diff --git a/Source/core/rendering/FastTextAutosizer.h b/Source/core/rendering/FastTextAutosizer.h
index d830280..77b46c1 100644
--- a/Source/core/rendering/FastTextAutosizer.h
+++ b/Source/core/rendering/FastTextAutosizer.h
@@ -201,7 +201,8 @@
     public:
         void add(const RenderObject*, Fingerprint);
         void addTentativeClusterRoot(const RenderBlock*, Fingerprint);
-        void remove(const RenderObject*);
+        // Returns true if any BlockSet was modified or freed by the removal.
+        bool remove(const RenderObject*);
         Fingerprint get(const RenderObject*);
         BlockSet& getTentativeClusterRoots(Fingerprint);
     private:
@@ -274,6 +275,9 @@
     const RenderObject* findTextLeaf(const RenderObject*, size_t&, TextLeafSearch);
     bool shouldDescendForTableInflation(RenderObject*);
     BlockFlags classifyBlock(const RenderObject*, BlockFlags mask = UINT_MAX);
+#ifdef AUTOSIZING_DOM_DEBUG_INFO
+    void writeClusterDebugInfo(Cluster*);
+#endif
 
     const Document* m_document;
     const RenderBlock* m_firstBlockToBeginLayout;
diff --git a/Source/core/rendering/HitTestResult.cpp b/Source/core/rendering/HitTestResult.cpp
index 63f71c0..8df2b42 100644
--- a/Source/core/rendering/HitTestResult.cpp
+++ b/Source/core/rendering/HitTestResult.cpp
@@ -279,11 +279,13 @@
     if (!m_innerNonSharedNode)
         return KURL();
 
-    if (!(m_innerNonSharedNode->renderer() && m_innerNonSharedNode->renderer()->isImage()))
+    RenderObject* renderer = m_innerNonSharedNode->renderer();
+    if (!(renderer && (renderer->isImage() || renderer->isCanvas())))
         return KURL();
 
     AtomicString urlString;
-    if (isHTMLEmbedElement(*m_innerNonSharedNode)
+    if (isHTMLCanvasElement(*m_innerNonSharedNode)
+        || isHTMLEmbedElement(*m_innerNonSharedNode)
         || isHTMLImageElement(*m_innerNonSharedNode)
         || isHTMLInputElement(*m_innerNonSharedNode)
         || isHTMLObjectElement(*m_innerNonSharedNode)
diff --git a/Source/core/rendering/LayoutRepainter.cpp b/Source/core/rendering/LayoutRepainter.cpp
index a0e5762..7f9b410 100644
--- a/Source/core/rendering/LayoutRepainter.cpp
+++ b/Source/core/rendering/LayoutRepainter.cpp
@@ -45,6 +45,7 @@
             // Hits in compositing/video/video-controls-layer-creation.html
             DisableCompositingQueryAsserts disabler;
             m_oldBounds = m_object.clippedOverflowRectForRepaint(m_repaintContainer);
+            m_oldOffset = m_object.positionFromRepaintContainer(m_repaintContainer);
         }
     }
 }
@@ -57,7 +58,7 @@
     // Hits in compositing/video/video-controls-layer-creation.html
     DisableCompositingQueryAsserts disabler;
 
-    return m_checkForRepaint ? m_object.repaintAfterLayoutIfNeeded(m_repaintContainer, m_object.selfNeedsLayout(), m_oldBounds) : false;
+    return m_checkForRepaint ? m_object.repaintAfterLayoutIfNeeded(m_repaintContainer, m_object.selfNeedsLayout(), m_oldBounds, m_oldOffset) : false;
 }
 
 } // namespace WebCore
diff --git a/Source/core/rendering/LayoutRepainter.h b/Source/core/rendering/LayoutRepainter.h
index 55fdd1e..30a3aef 100644
--- a/Source/core/rendering/LayoutRepainter.h
+++ b/Source/core/rendering/LayoutRepainter.h
@@ -44,10 +44,10 @@
 
 private:
     RenderObject& m_object;
-    RenderLayerModelObject* m_repaintContainer;
+    const RenderLayerModelObject* m_repaintContainer;
     // We store these values as LayoutRects, but the final invalidations will be pixel snapped
     LayoutRect m_oldBounds;
-    LayoutRect m_oldOutlineBox;
+    LayoutPoint m_oldOffset;
     bool m_checkForRepaint;
 };
 
diff --git a/Source/core/rendering/RenderBlock.cpp b/Source/core/rendering/RenderBlock.cpp
index 66e6126..897fc69 100644
--- a/Source/core/rendering/RenderBlock.cpp
+++ b/Source/core/rendering/RenderBlock.cpp
@@ -362,6 +362,9 @@
 
 void RenderBlock::repaintTreeAfterLayout()
 {
+    if (!shouldCheckForInvalidationAfterLayout())
+        return;
+
     RenderBox::repaintTreeAfterLayout();
 
     // Take care of positioned objects. This is required as LayoutState keeps a single clip rect.
@@ -1457,12 +1460,6 @@
     addVisualOverflow(inflatedRect);
 }
 
-bool RenderBlock::createsBlockFormattingContext() const
-{
-    return isInlineBlockOrInlineTable() || isFloatingOrOutOfFlowPositioned() || hasOverflowClip() || isFlexItemIncludingDeprecated()
-        || style()->specifiesColumns() || isRenderFlowThread() || isTableCell() || isTableCaption() || isFieldset() || isWritingModeRoot() || isDocumentElement() || style()->columnSpan();
-}
-
 void RenderBlock::updateBlockChildDirtyBitsBeforeLayout(bool relayoutChildren, RenderBox* child)
 {
     // FIXME: Technically percentage height objects only need a relayout if their percentage isn't going to be turned into
@@ -1530,11 +1527,6 @@
         if (needsSimplifiedNormalFlowLayout())
             simplifiedNormalFlowLayout();
 
-        // Make sure a forced break is applied after the content if we are a flow thread in a simplified layout.
-        // This ensures the size information is correctly computed for the last auto-height region receiving content.
-        if (isRenderFlowThread())
-            toRenderFlowThread(this)->applyBreakAfterContent(clientLogicalBottom());
-
         // Lay out our positioned objects if our positioned child bit is set.
         // Also, if an absolute position element inside a relative positioned container moves, and the absolute element has a fixed position
         // child, neither the fixed element nor its container learn of the movement since posChildNeedsLayout() is only marked as far as the
@@ -2705,12 +2697,6 @@
     }
 }
 
-bool RenderBlock::avoidsFloats() const
-{
-    // Floats can't intrude into our box if we have a non-auto column count or width.
-    return RenderBox::avoidsFloats() || !style()->hasAutoColumnCount() || !style()->hasAutoColumnWidth();
-}
-
 bool RenderBlock::isPointInOverflowControl(HitTestResult& result, const LayoutPoint& locationInContainer, const LayoutPoint& accumulatedOffset)
 {
     if (!scrollsOverflow())
@@ -4033,8 +4019,12 @@
     else
         firstLetter = RenderBlockFlow::createAnonymous(&document());
     firstLetter->setStyle(pseudoStyle);
-    firstLetterContainer->addChild(firstLetter, currentChild);
 
+    // FIXME: The first letter code should not modify the render tree during
+    // layout. crbug.com/370458
+    DeprecatedDisableModifyRenderTreeStructureAsserts disabler;
+
+    firstLetterContainer->addChild(firstLetter, currentChild);
     RenderText* textObj = toRenderText(currentChild);
 
     // The original string is going to be either a generated content string or a DOM node's
diff --git a/Source/core/rendering/RenderBlock.h b/Source/core/rendering/RenderBlock.h
index 74af6b2..4365111 100644
--- a/Source/core/rendering/RenderBlock.h
+++ b/Source/core/rendering/RenderBlock.h
@@ -327,6 +327,7 @@
 
     void setDesiredColumnCountAndWidth(int, LayoutUnit);
 
+    bool avoidsOrIgnoresFloats() { return isFloatingOrOutOfFlowPositioned() || avoidsFloats(); }
 public:
     virtual void computeOverflow(LayoutUnit oldClientAfterEdge, bool = false);
 protected:
@@ -345,6 +346,8 @@
 
     virtual bool isInlineBlockOrInlineTable() const OVERRIDE FINAL { return isInline() && isReplaced(); }
 
+    virtual void repaintTreeAfterLayout() OVERRIDE;
+
 private:
     virtual RenderObjectChildList* virtualChildren() OVERRIDE FINAL { return children(); }
     virtual const RenderObjectChildList* virtualChildren() const OVERRIDE FINAL { return children(); }
@@ -353,8 +356,6 @@
 
     virtual bool isRenderBlock() const OVERRIDE FINAL { return true; }
 
-    virtual void repaintTreeAfterLayout() OVERRIDE;
-
     void makeChildrenNonInline(RenderObject* insertionPoint = 0);
     virtual void removeLeftoverAnonymousBlock(RenderBlock* child);
 
@@ -389,8 +390,6 @@
     bool hasCaret() const { return hasCaret(CursorCaret) || hasCaret(DragCaret); }
     bool hasCaret(CaretType) const;
 
-    virtual bool avoidsFloats() const OVERRIDE;
-
     bool hitTestColumns(const HitTestRequest&, HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction);
     bool hitTestContents(const HitTestRequest&, HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction);
     // FIXME-BLOCKFLOW: Remove virtualizaion when all callers have moved to RenderBlockFlow
@@ -471,8 +470,6 @@
     enum PageBoundaryRule { ExcludePageBoundary, IncludePageBoundary };
     LayoutUnit nextPageLogicalTop(LayoutUnit logicalOffset, PageBoundaryRule = ExcludePageBoundary) const;
 
-    bool createsBlockFormattingContext() const;
-
 public:
     LayoutUnit pageLogicalTopForOffset(LayoutUnit offset) const;
     LayoutUnit pageLogicalHeightForOffset(LayoutUnit offset) const;
diff --git a/Source/core/rendering/RenderBlockFlow.cpp b/Source/core/rendering/RenderBlockFlow.cpp
index 8e0b0e2..93f99d7 100644
--- a/Source/core/rendering/RenderBlockFlow.cpp
+++ b/Source/core/rendering/RenderBlockFlow.cpp
@@ -420,9 +420,6 @@
     LayoutUnit oldHeight = logicalHeight();
     LayoutUnit oldClientAfterEdge = clientLogicalBottom();
 
-    if (isRenderFlowThread())
-        toRenderFlowThread(this)->applyBreakAfterContent(oldClientAfterEdge);
-
     updateLogicalHeight();
     LayoutUnit newHeight = logicalHeight();
     if (oldHeight > newHeight && !childrenInline()) {
@@ -758,7 +755,7 @@
     }
 
     // Inline blocks are covered by the isReplaced() check in the avoidFloats method.
-    if (avoidsFloats() || isDocumentElement() || isRenderView() || isFloatingOrOutOfFlowPositioned() || isTableCell()) {
+    if (avoidsOrIgnoresFloats() || isRenderView()) {
         if (m_floatingObjects) {
             m_floatingObjects->clear();
         }
@@ -788,7 +785,7 @@
     RenderBlockFlow* parentBlockFlow = toRenderBlockFlow(parent());
     bool parentHasFloats = false;
     RenderObject* prev = previousSibling();
-    while (prev && (!prev->isBox() || !prev->isRenderBlock() || toRenderBlock(prev)->avoidsFloats() || toRenderBlock(prev)->createsBlockFormattingContext())) {
+    while (prev && (!prev->isBox() || !prev->isRenderBlock() || toRenderBlock(prev)->avoidsOrIgnoresFloats())) {
         if (prev->isFloating())
             parentHasFloats = true;
         prev = prev->previousSibling();
@@ -1721,7 +1718,7 @@
     FloatingObjectSetIterator end = floatingObjectSet.end();
 
     for (RenderObject* next = nextSibling(); next; next = next->nextSibling()) {
-        if (!next->isRenderBlockFlow() || next->isFloatingOrOutOfFlowPositioned() || toRenderBlock(next)->avoidsFloats())
+        if (!next->isRenderBlockFlow() || avoidsOrIgnoresFloats())
             continue;
 
         RenderBlockFlow* nextBlock = toRenderBlockFlow(next);
@@ -1813,7 +1810,7 @@
 void RenderBlockFlow::styleWillChange(StyleDifference diff, const RenderStyle& newStyle)
 {
     RenderStyle* oldStyle = style();
-    s_canPropagateFloatIntoSibling = oldStyle ? !isFloatingOrOutOfFlowPositioned() && !avoidsFloats() : false;
+    s_canPropagateFloatIntoSibling = oldStyle ? !createsBlockFormattingContext() : false;
     if (oldStyle && parent() && diff.needsFullLayout() && oldStyle->position() != newStyle.position()
         && containsFloats() && !isFloating() && !isOutOfFlowPositioned() && newStyle.hasOutOfFlowPosition())
             markAllDescendantsWithFloatsForLayout();
@@ -1829,7 +1826,7 @@
     // blocks, then we need to find the top most parent containing that overhanging float and
     // then mark its descendants with floats for layout and clear all floats from its next
     // sibling blocks that exist in our floating objects list. See bug 56299 and 62875.
-    bool canPropagateFloatIntoSibling = !isFloatingOrOutOfFlowPositioned() && !avoidsFloats();
+    bool canPropagateFloatIntoSibling = !createsBlockFormattingContext();
     if (diff.needsFullLayout() && s_canPropagateFloatIntoSibling && !canPropagateFloatIntoSibling && hasOverhangingFloats()) {
         RenderBlockFlow* parentBlockFlow = this;
         const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set();
@@ -2316,6 +2313,9 @@
 
         RenderBox* childBox = floatingObject->renderer();
 
+        // FIXME Investigate if this can be removed. crbug.com/370006
+        childBox->setMayNeedInvalidation(true);
+
         LayoutUnit childLogicalLeftMargin = style()->isLeftToRightDirection() ? marginStartForChild(childBox) : marginEndForChild(childBox);
         LayoutRect oldRect = childBox->frameRect();
 
diff --git a/Source/core/rendering/RenderBox.cpp b/Source/core/rendering/RenderBox.cpp
index e3bc858..c1e5be5 100644
--- a/Source/core/rendering/RenderBox.cpp
+++ b/Source/core/rendering/RenderBox.cpp
@@ -1558,8 +1558,14 @@
     ASSERT(RuntimeEnabledFeatures::repaintAfterLayoutEnabled());
     ASSERT(!needsLayout());
 
+    if (!shouldCheckForInvalidationAfterLayout())
+        return;
+
     const LayoutRect oldRepaintRect = previousRepaintRect();
-    setPreviousRepaintRect(clippedOverflowRectForRepaint(containerForRepaint()));
+    const LayoutPoint oldPositionFromRepaintContainer = previousPositionFromRepaintContainer();
+    const RenderLayerModelObject* repaintContainer = containerForRepaint();
+    setPreviousRepaintRect(clippedOverflowRectForRepaint(repaintContainer));
+    setPreviousPositionFromRepaintContainer(positionFromRepaintContainer(repaintContainer));
 
     // If we are set to do a full repaint that means the RenderView will be
     // invalidated. We can then skip issuing of invalidations for the child
@@ -1577,9 +1583,10 @@
         setShouldDoFullRepaintAfterLayout(true);
     }
 
-    const LayoutRect newRepaintRect = previousRepaintRect();
+    const LayoutRect& newRepaintRect = previousRepaintRect();
+    const LayoutPoint& newPositionFromRepaintContainer = previousPositionFromRepaintContainer();
     bool didFullRepaint = repaintAfterLayoutIfNeeded(containerForRepaint(),
-        shouldDoFullRepaintAfterLayout(), oldRepaintRect, &newRepaintRect);
+        shouldDoFullRepaintAfterLayout(), oldRepaintRect, oldPositionFromRepaintContainer, &newRepaintRect, &newPositionFromRepaintContainer);
 
     if (!didFullRepaint)
         repaintOverflowIfNeeded();
@@ -2784,8 +2791,8 @@
                 return computeIntrinsicLogicalWidthUsing(logicalWidth, cw, borderAndPaddingLogicalWidth()) - borderAndPaddingLogicalWidth();
             if (cw > 0 || (!cw && (containerLogicalWidth.isFixed() || containerLogicalWidth.isPercent())))
                 return adjustContentBoxLogicalWidthForBoxSizing(minimumValueForLength(logicalWidth, cw));
+            return 0;
         }
-        // fall through
         case Intrinsic:
         case MinIntrinsic:
         case Auto:
@@ -4101,7 +4108,16 @@
 
 bool RenderBox::avoidsFloats() const
 {
-    return isReplaced() || hasOverflowClip() || isHR() || isLegend() || isWritingModeRoot() || isFlexItemIncludingDeprecated();
+    // CSS2.1: "The border box of a table, a block-level replaced element, or an element in the normal flow that establishes a new block formatting
+    // context .. must not overlap the margin box of any floats in the same block formatting context."
+    // FIXME: The inclusion of horizontal rule and legend elements here isn't covered by any spec.
+    return isReplaced() || isHR() || isLegend() || isTable() || (!isFloatingOrOutOfFlowPositioned() && createsBlockFormattingContext());
+}
+
+bool RenderBox::createsBlockFormattingContext() const
+{
+    return isInlineBlockOrInlineTable() || isFloatingOrOutOfFlowPositioned() || hasOverflowClip() || isFlexItemIncludingDeprecated()
+        || style()->specifiesColumns() || isRenderFlowThread() || isTableCell() || isTableCaption() || isFieldset() || isWritingModeRoot() || isDocumentElement() || style()->columnSpan();
 }
 
 void RenderBox::markForPaginationRelayoutIfNeeded(SubtreeLayoutScope& layoutScope)
diff --git a/Source/core/rendering/RenderBox.h b/Source/core/rendering/RenderBox.h
index 3c834aa..e9ce3b6 100644
--- a/Source/core/rendering/RenderBox.h
+++ b/Source/core/rendering/RenderBox.h
@@ -72,7 +72,7 @@
     // position:static elements that are not flex-items get their z-index coerced to auto.
     virtual LayerType layerTypeRequired() const OVERRIDE
     {
-        if (isPositioned() || createsGroup() || hasClipPath() || hasTransform() || hasHiddenBackface() || hasReflection() || style()->specifiesColumns() || !style()->hasAutoZIndex() || style()->hasWillChangeCompositingHint() || style()->hasWillChangeGpuRasterizationHint() || style()->shouldCompositeForCurrentAnimations())
+        if (isPositioned() || createsGroup() || hasClipPath() || hasTransform() || hasHiddenBackface() || hasReflection() || style()->specifiesColumns() || !style()->hasAutoZIndex() || style()->shouldCompositeForCurrentAnimations())
             return NormalLayer;
         if (hasOverflowClip())
             return OverflowClipLayer;
@@ -662,6 +662,8 @@
 
     void updateIntrinsicContentLogicalHeight(LayoutUnit intrinsicContentLogicalHeight) const { m_intrinsicContentLogicalHeight = intrinsicContentLogicalHeight; }
 
+    bool createsBlockFormattingContext() const;
+
 private:
     void updateShapeOutsideInfoAfterStyleChange(const RenderStyle&, const RenderStyle* oldStyle);
     void updateGridPositionAfterStyleChange(const RenderStyle*);
diff --git a/Source/core/rendering/RenderDeprecatedFlexibleBox.cpp b/Source/core/rendering/RenderDeprecatedFlexibleBox.cpp
index 52f09bc..e98dde3 100644
--- a/Source/core/rendering/RenderDeprecatedFlexibleBox.cpp
+++ b/Source/core/rendering/RenderDeprecatedFlexibleBox.cpp
@@ -999,6 +999,9 @@
 {
     LayoutRect oldRect = child->frameRect();
 
+    // FIXME Investigate if this can be removed based on other flags. crbug.com/370010
+    child->setMayNeedInvalidation(true);
+
     // Place the child.
     child->setLocation(location);
 
diff --git a/Source/core/rendering/RenderFieldset.h b/Source/core/rendering/RenderFieldset.h
index 0ebc486..ce8a356 100644
--- a/Source/core/rendering/RenderFieldset.h
+++ b/Source/core/rendering/RenderFieldset.h
@@ -42,7 +42,6 @@
     virtual RenderObject* layoutSpecialExcludedChild(bool relayoutChildren, SubtreeLayoutScope&) OVERRIDE;
 
     virtual void computePreferredLogicalWidths() OVERRIDE;
-    virtual bool avoidsFloats() const OVERRIDE { return true; }
 
     virtual void paintBoxDecorations(PaintInfo&, const LayoutPoint&) OVERRIDE;
     virtual void paintMask(PaintInfo&, const LayoutPoint&) OVERRIDE;
diff --git a/Source/core/rendering/RenderFlexibleBox.cpp b/Source/core/rendering/RenderFlexibleBox.cpp
index aa4c8f4..2395e4a 100644
--- a/Source/core/rendering/RenderFlexibleBox.cpp
+++ b/Source/core/rendering/RenderFlexibleBox.cpp
@@ -1110,6 +1110,9 @@
             continue;
         }
 
+        // FIXME Investigate if this can be removed based on other flags. crbug.com/370010
+        child->setMayNeedInvalidation(true);
+
         LayoutUnit childPreferredSize = childSizes[i] + mainAxisBorderAndPaddingExtentForChild(child);
         setLogicalOverrideSize(child, childPreferredSize);
         if (childPreferredSize != mainAxisExtentForChild(child)) {
diff --git a/Source/core/rendering/RenderFlowThread.cpp b/Source/core/rendering/RenderFlowThread.cpp
index 3f5c801..0cf04c5 100644
--- a/Source/core/rendering/RenderFlowThread.cpp
+++ b/Source/core/rendering/RenderFlowThread.cpp
@@ -134,14 +134,6 @@
     RenderBlockFlow::layout();
 
     m_pageLogicalSizeChanged = false;
-
-    if (lastRegion())
-        lastRegion()->expandToEncompassFlowThreadContentsIfNeeded();
-}
-
-void RenderFlowThread::updateLogicalWidth()
-{
-    setLogicalWidth(initialLogicalWidth());
 }
 
 void RenderFlowThread::computeLogicalHeight(LayoutUnit, LayoutUnit logicalTop, LogicalExtentComputedValues& computedValues) const
@@ -365,13 +357,6 @@
     ASSERT(m_regionList.contains(startRegion) && m_regionList.contains(endRegion));
 }
 
-void RenderFlowThread::applyBreakAfterContent(LayoutUnit clientHeight)
-{
-    // Simulate a region break at height. If it points inside an auto logical height region,
-    // then it may determine the region computed autoheight.
-    addForcedRegionBreak(clientHeight, this, false);
-}
-
 void RenderFlowThread::updateRegionsFlowThreadPortionRect()
 {
     LayoutUnit logicalHeight = 0;
diff --git a/Source/core/rendering/RenderFlowThread.h b/Source/core/rendering/RenderFlowThread.h
index b699469..5e76e30 100644
--- a/Source/core/rendering/RenderFlowThread.h
+++ b/Source/core/rendering/RenderFlowThread.h
@@ -60,7 +60,7 @@
     virtual bool isRenderFlowThread() const OVERRIDE FINAL { return true; }
     virtual bool isRenderMultiColumnFlowThread() const { return false; }
 
-    virtual void layout() OVERRIDE FINAL;
+    virtual void layout() OVERRIDE;
 
     // Always create a RenderLayer for the RenderFlowThread so that we
     // can easily avoid drawing the children directly.
@@ -72,7 +72,6 @@
     virtual void removeRegionFromThread(RenderRegion*);
     const RenderRegionList& renderRegionList() const { return m_regionList; }
 
-    virtual void updateLogicalWidth() OVERRIDE FINAL;
     virtual void computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logicalTop, LogicalExtentComputedValues&) const OVERRIDE;
 
     bool hasRegions() const { return m_regionList.size(); }
@@ -103,7 +102,6 @@
     void getRegionRangeForBox(const RenderBox*, RenderRegion*& startRegion, RenderRegion*& endRegion) const;
 
     virtual bool addForcedRegionBreak(LayoutUnit, RenderObject* breakChild, bool isBefore, LayoutUnit* offsetBreakAdjustment = 0) { return false; }
-    void applyBreakAfterContent(LayoutUnit);
 
     virtual bool isPageLogicalHeightKnown() const { return true; }
     bool pageLogicalSizeChanged() const { return m_pageLogicalSizeChanged; }
@@ -121,10 +119,6 @@
 protected:
     virtual const char* renderName() const = 0;
 
-    // Overridden by columns/pages to set up an initial logical width of the page width even when
-    // no regions have been generated yet.
-    virtual LayoutUnit initialLogicalWidth() const { return 0; };
-
     void updateRegionsFlowThreadPortionRect();
     bool shouldRepaint(const LayoutRect&) const;
 
diff --git a/Source/core/rendering/RenderFrameSet.cpp b/Source/core/rendering/RenderFrameSet.cpp
index 779fd42..bc7938f 100644
--- a/Source/core/rendering/RenderFrameSet.cpp
+++ b/Source/core/rendering/RenderFrameSet.cpp
@@ -441,7 +441,7 @@
 
     bool doFullRepaint = selfNeedsLayout() && checkForRepaintDuringLayout();
     LayoutRect oldBounds;
-    RenderLayerModelObject* repaintContainer = 0;
+    const RenderLayerModelObject* repaintContainer = 0;
     if (doFullRepaint) {
         repaintContainer = containerForRepaint();
         oldBounds = clippedOverflowRectForRepaint(repaintContainer);
diff --git a/Source/core/rendering/RenderFullScreen.cpp b/Source/core/rendering/RenderFullScreen.cpp
index bca1d5b..2abefb8 100644
--- a/Source/core/rendering/RenderFullScreen.cpp
+++ b/Source/core/rendering/RenderFullScreen.cpp
@@ -110,6 +110,10 @@
 
 RenderObject* RenderFullScreen::wrapRenderer(RenderObject* object, RenderObject* parent, Document* document)
 {
+    // FIXME: We should not modify the structure of the render tree during
+    // layout. crbug.com/370459
+    DeprecatedDisableModifyRenderTreeStructureAsserts disabler;
+
     RenderFullScreen* fullscreenRenderer = RenderFullScreen::createAnonymous(document);
     fullscreenRenderer->setStyle(createFullScreenStyle());
     if (parent && !parent->isChildAllowed(fullscreenRenderer, fullscreenRenderer->style())) {
@@ -146,6 +150,10 @@
 
 void RenderFullScreen::unwrapRenderer()
 {
+    // FIXME: We should not modify the structure of the render tree during
+    // layout. crbug.com/370459
+    DeprecatedDisableModifyRenderTreeStructureAsserts disabler;
+
     if (parent()) {
         RenderObject* child;
         while ((child = firstChild())) {
diff --git a/Source/core/rendering/RenderHTMLCanvas.cpp b/Source/core/rendering/RenderHTMLCanvas.cpp
index 0b73b02..ae25912 100644
--- a/Source/core/rendering/RenderHTMLCanvas.cpp
+++ b/Source/core/rendering/RenderHTMLCanvas.cpp
@@ -46,15 +46,7 @@
 
 LayerType RenderHTMLCanvas::layerTypeRequired() const
 {
-    LayerType type = RenderReplaced::layerTypeRequired();
-    if (type != NoLayer)
-        return type;
-
-    HTMLCanvasElement* canvas = toHTMLCanvasElement(node());
-    if (canvas && canvas->renderingContext() && canvas->renderingContext()->isAccelerated())
-        return NormalLayer;
-
-    return NoLayer;
+    return NormalLayer;
 }
 
 void RenderHTMLCanvas::paintReplaced(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
diff --git a/Source/core/rendering/RenderInputSpeech.cpp b/Source/core/rendering/RenderInputSpeech.cpp
deleted file mode 100644
index 8513441..0000000
--- a/Source/core/rendering/RenderInputSpeech.cpp
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- *     * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#if ENABLE(INPUT_SPEECH)
-#include "core/rendering/RenderInputSpeech.h"
-
-#include "core/html/shadow/TextControlInnerElements.h"
-#include "core/rendering/PaintInfo.h"
-#include "core/rendering/RenderBox.h"
-#include "platform/graphics/GraphicsContext.h"
-
-namespace WebCore {
-
-static const float defaultControlFontPixelSize = 13;
-static const float defaultSpeechButtonSize = 16;
-static const float minSpeechButtonSize = 8;
-static const float maxSpeechButtonSize = 40;
-
-void RenderInputSpeech::adjustInputFieldSpeechButtonStyle(RenderStyle* style, Element*)
-{
-    // Scale the button size based on the font size.
-    float fontScale = style->fontSize() / defaultControlFontPixelSize;
-    int speechButtonSize = lroundf(std::min(std::max(minSpeechButtonSize, defaultSpeechButtonSize * fontScale), maxSpeechButtonSize));
-    style->setWidth(Length(speechButtonSize, Fixed));
-    style->setHeight(Length(speechButtonSize, Fixed));
-}
-
-bool RenderInputSpeech::paintInputFieldSpeechButton(RenderObject* object, const PaintInfo& paintInfo, const IntRect& rect)
-{
-    Element* element = object->node()->isElementNode() ? toElement(object->node()) : 0;
-    if (!element || !element->isInputFieldSpeechButtonElement())
-        return false;
-
-    // Get the renderer of <input> element.
-    Node* input = object->node()->shadowHost();
-    if (!input->renderer()->isBox())
-        return false;
-    RenderBox* inputRenderBox = toRenderBox(input->renderer());
-    LayoutRect inputContentBox = inputRenderBox->contentBoxRect();
-
-    // Make sure the scaled button stays square and will fit in its parent's box.
-    LayoutUnit buttonSize = std::min(inputContentBox.width(), std::min<LayoutUnit>(inputContentBox.height(), rect.height()));
-    // Calculate button's coordinates relative to the input element.
-    // Center the button vertically.  Round up though, so if it has to be one pixel off-center, it will
-    // be one pixel closer to the bottom of the field.  This tends to look better with the text.
-    LayoutRect buttonRect(object->offsetFromAncestorContainer(inputRenderBox).width(),
-                          inputContentBox.y() + (inputContentBox.height() - buttonSize + 1) / 2,
-                          buttonSize, buttonSize);
-
-    // Compute an offset between the part renderer and the input renderer.
-    LayoutSize offsetFromInputRenderer = -(object->offsetFromAncestorContainer(inputRenderBox));
-    // Move the rect into partRenderer's coords.
-    buttonRect.move(offsetFromInputRenderer);
-    // Account for the local drawing offset.
-    buttonRect.moveBy(rect.location());
-
-    DEFINE_STATIC_REF(Image, imageStateNormal, (Image::loadPlatformResource("inputSpeech")));
-    DEFINE_STATIC_REF(Image, imageStateRecording, (Image::loadPlatformResource("inputSpeechRecording")));
-    DEFINE_STATIC_REF(Image, imageStateWaiting, (Image::loadPlatformResource("inputSpeechWaiting")));
-
-    InputFieldSpeechButtonElement* speechButton = toInputFieldSpeechButtonElement(element);
-    Image* image = imageStateNormal;
-    if (speechButton->state() == InputFieldSpeechButtonElement::Recording)
-        image = imageStateRecording;
-    else if (speechButton->state() == InputFieldSpeechButtonElement::Recognizing)
-        image = imageStateWaiting;
-    paintInfo.context->drawImage(image, pixelSnappedIntRect(buttonRect));
-
-    return false;
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(INPUT_SPEECH)
diff --git a/Source/core/rendering/RenderInputSpeech.h b/Source/core/rendering/RenderInputSpeech.h
deleted file mode 100644
index e1d8c6e..0000000
--- a/Source/core/rendering/RenderInputSpeech.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- *     * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef RenderInputSpeech_h
-#define RenderInputSpeech_h
-
-#if ENABLE(INPUT_SPEECH)
-
-namespace WebCore {
-
-struct PaintInfo;
-
-class Element;
-class IntRect;
-class RenderObject;
-class RenderStyle;
-class StyleResolver;
-
-class RenderInputSpeech {
-public:
-    static void adjustInputFieldSpeechButtonStyle(RenderStyle*, Element*);
-    static bool paintInputFieldSpeechButton(RenderObject*, const PaintInfo&, const IntRect&);
-};
-
-} // namespace WebCore
-
-#endif
-#endif // RenderInputSpeech_h
diff --git a/Source/core/rendering/RenderLayer.cpp b/Source/core/rendering/RenderLayer.cpp
index af9e053..3ed3012 100644
--- a/Source/core/rendering/RenderLayer.cpp
+++ b/Source/core/rendering/RenderLayer.cpp
@@ -132,7 +132,6 @@
     , m_hasNonCompositedChild(false)
     , m_shouldIsolateCompositedDescendants(false)
     , m_lostGroupedMapping(false)
-    , m_suppressingCompositedLayerCreation(false)
     , m_viewportConstrainedNotCompositedReason(NoNotCompositedReason)
     , m_renderer(renderer)
     , m_parent(0)
@@ -212,18 +211,21 @@
     if (changeType == CanvasChanged || changeType == VideoChanged || changeType == FullScreenChanged)
         compositor()->updateLayerCompositingState(this);
 
-    if (changeType == CanvasContextChanged)
-        compositor()->setNeedsCompositingUpdate(CompositingUpdateAfterCanvasContextChange);
+    if (changeType == CanvasContextChanged) {
+        compositor()->setNeedsCompositingUpdate(CompositingUpdateAfterCompositingInputChange);
+
+        // Although we're missing test coverage, we need to call
+        // GraphicsLayer::setContentsToPlatformLayer with the new platform
+        // layer for this canvas.
+        // See http://crbug.com/349195
+        if (hasCompositedLayerMapping())
+            compositedLayerMapping()->setNeedsGraphicsLayerUpdate();
+    }
 
     if (m_compositedLayerMapping)
         m_compositedLayerMapping->contentChanged(changeType);
 }
 
-bool RenderLayer::canRender3DTransforms() const
-{
-    return compositor()->canRender3DTransforms();
-}
-
 bool RenderLayer::paintsWithFilters() const
 {
     if (!renderer()->hasFilter())
@@ -408,6 +410,7 @@
     const bool isRootFixedPos = position == FixedPosition && containingBlock->enclosingLayer() == rootLayer;
     const bool otherIsRootFixedPos = otherPosition == FixedPosition && otherContainingBlock->enclosingLayer() == rootLayer;
 
+    // FIXME: some of these cases don't look quite right.
     if (isRootFixedPos && otherIsRootFixedPos)
         return false;
     if (isRootFixedPos || otherIsRootFixedPos)
@@ -420,8 +423,13 @@
     // closest scrollable ancestor.
     HashSet<const RenderObject*> containingBlocks;
     while (containingBlock) {
-        if (containingBlock->enclosingLayer()->scrollsOverflow())
+        if (containingBlock->enclosingLayer()->scrollsOverflow()) {
             break;
+        }
+        if (containingBlock->enclosingLayer() == other) {
+            // This layer does not scroll with respect to the other layer if the other one does not scroll and this one is a child.
+            return false;
+        }
         containingBlocks.add(containingBlock);
         containingBlock = containingBlock->containingBlock();
     }
@@ -429,9 +437,14 @@
     // Do the same for the 2nd layer, but if we find a common containing block,
     // it means both layers are contained within a single non-scrolling subtree.
     // Hence, they will not scroll with respect to each other.
+    bool thisLayerScrollsOverflow = scrollsOverflow();
     while (otherContainingBlock) {
         if (containingBlocks.contains(otherContainingBlock))
             return false;
+        // The other layer scrolls with respect to this one if this one scrolls and it's a child.
+        if (!thisLayerScrollsOverflow && otherContainingBlock->enclosingLayer() == this)
+            return false;
+        // The other layer does not scroll with respect to this one if this one does not scroll and it's a child.
         if (otherContainingBlock->enclosingLayer()->scrollsOverflow())
             break;
         otherContainingBlock = otherContainingBlock->containingBlock();
@@ -531,7 +544,7 @@
         ASSERT(box);
         m_transform->makeIdentity();
         box->style()->applyTransform(*m_transform, box->pixelSnappedBorderBoxRect().size(), RenderStyle::IncludeTransformOrigin);
-        makeMatrixRenderable(*m_transform, canRender3DTransforms());
+        makeMatrixRenderable(*m_transform, compositor()->hasAcceleratedCompositing());
     }
 
     if (had3DTransform != has3DTransform())
@@ -568,7 +581,7 @@
         RenderBox* box = renderBox();
         TransformationMatrix currTransform;
         box->style()->applyTransform(currTransform, box->pixelSnappedBorderBoxRect().size(), RenderStyle::ExcludeTransformOrigin);
-        makeMatrixRenderable(currTransform, canRender3DTransforms());
+        makeMatrixRenderable(currTransform, compositor()->hasAcceleratedCompositing());
         return currTransform;
     }
 
@@ -1396,7 +1409,7 @@
     } else
         setLastChild(child);
 
-    child->setParent(this);
+    child->m_parent = this;
 
     setNeedsToUpdateAncestorDependentProperties();
 
@@ -1467,7 +1480,7 @@
 
     oldChild->setPreviousSibling(0);
     oldChild->setNextSibling(0);
-    oldChild->setParent(0);
+    oldChild->m_parent = 0;
 
     oldChild->updateDescendantDependentFlags();
     if (subtreeContainsOutOfFlowPositionedLayer(oldChild)) {
@@ -1764,7 +1777,7 @@
 void RenderLayer::updateScrollableArea()
 {
     if (requiresScrollableArea())
-        m_scrollableArea = adoptPtr(new RenderLayerScrollableArea(*renderBox()));
+        m_scrollableArea = adoptPtr(new RenderLayerScrollableArea(*this));
     else
         m_scrollableArea = nullptr;
 }
@@ -3415,7 +3428,12 @@
 
     RenderLayerStackingNodeIterator iterator(*m_stackingNode.get(), AllChildren);
     while (RenderLayerStackingNode* node = iterator.next()) {
-        if (node->layer()->hasCompositedLayerMapping() && options != ApplyBoundsChickenEggHacks)
+        // Here we exclude both directly composted layers and squashing layers
+        // because those RenderLayers don't paint into the graphics layer
+        // for this RenderLayer. For example, the bounds of squashed RenderLayers
+        // will be included in the computation of the appropriate squashing
+        // GraphicsLayer.
+        if (options != ApplyBoundsChickenEggHacks && node->layer()->compositingState() != NotComposited)
             continue;
         result.unite(node->layer()->boundingBoxForCompositing(this, options));
     }
@@ -3604,20 +3622,6 @@
     return false;
 }
 
-void RenderLayer::setParent(RenderLayer* parent)
-{
-    if (parent == m_parent)
-        return;
-
-    if (m_parent && !renderer()->documentBeingDestroyed())
-        compositor()->layerWillBeRemoved(m_parent, this);
-
-    m_parent = parent;
-
-    if (m_parent && !renderer()->documentBeingDestroyed())
-        compositor()->layerWasAdded(m_parent, this);
-}
-
 bool RenderLayer::shouldBeSelfPaintingLayer() const
 {
     return m_layerType == NormalLayer
diff --git a/Source/core/rendering/RenderLayer.h b/Source/core/rendering/RenderLayer.h
index 21b89dc..814e35a 100644
--- a/Source/core/rendering/RenderLayer.h
+++ b/Source/core/rendering/RenderLayer.h
@@ -125,8 +125,6 @@
     void styleChanged(StyleDifference, const RenderStyle* oldStyle);
 
     bool isSelfPaintingLayer() const { return m_isSelfPaintingLayer; }
-    bool isOverflowOnlyLayer() const { return m_layerType == OverflowClipLayer; }
-    bool isForcedLayer() const { return m_layerType == ForcedLayer; }
 
     void setLayerType(LayerType layerType) { m_layerType = layerType; }
 
@@ -164,8 +162,6 @@
     // Allows updates of layer content without repainting.
     void contentChanged(ContentChangeType);
 
-    bool canRender3DTransforms() const;
-
     enum UpdateLayerPositionsFlag {
         CheckForRepaint = 1 << 0,
         NeedsFullRepaintInBacking = 1 << 1,
@@ -270,6 +266,7 @@
     // paints the layers that intersect the damage rect from back to
     // front.  The hitTest method looks for mouse events by walking
     // layers that intersect the point from front to back.
+    // paint() assumes that the caller will clip to the bounds of damageRect if necessary.
     void paint(GraphicsContext*, const LayoutRect& damageRect, PaintBehavior = PaintBehaviorNormal, RenderObject* paintingRoot = 0, PaintLayerFlags = 0);
     bool hitTest(const HitTestRequest&, HitTestResult&);
     bool hitTest(const HitTestRequest&, const HitTestLocation&, HitTestResult&);
@@ -446,6 +443,7 @@
         return isRootLayer() || layerRenderer->isPositioned() || hasTransform();
     }
 
+    // paintLayer() assumes that the caller will clip to the bounds of the painting dirty if necessary.
     void paintLayer(GraphicsContext*, const LayerPaintingInfo&, PaintLayerFlags);
 
     PassOwnPtr<Vector<FloatRect> > collectTrackedRepaintRects() const;
@@ -497,15 +495,13 @@
     bool shouldIsolateCompositedDescendants() const { ASSERT(isAllowedToQueryCompositingState()); return m_shouldIsolateCompositedDescendants; }
     void setShouldIsolateCompositedDescendants(bool b)  { m_shouldIsolateCompositedDescendants = b; }
 
-    bool suppressingCompositedLayerCreation() const { ASSERT(isAllowedToQueryCompositingState()); return m_suppressingCompositedLayerCreation; }
-    void setSuppressingCompositedLayerCreation(bool b) { m_suppressingCompositedLayerCreation = b; }
-
     void updateDescendantDependentFlags();
 
     void updateOrRemoveFilterEffectRenderer();
 
     void updateSelfPaintingLayer();
 
+    // paintLayerContents() assumes that the caller will clip to the bounds of the painting dirty rect if necessary.
     void paintLayerContents(GraphicsContext*, const LayerPaintingInfo&, PaintLayerFlags);
 
     RenderLayer* enclosingTransformedAncestor() const;
@@ -547,7 +543,6 @@
 
     void setNextSibling(RenderLayer* next) { m_next = next; }
     void setPreviousSibling(RenderLayer* prev) { m_previous = prev; }
-    void setParent(RenderLayer* parent);
     void setFirstChild(RenderLayer* first) { m_first = first; }
     void setLastChild(RenderLayer* last) { m_last = last; }
 
@@ -703,9 +698,6 @@
     // and we don't yet know to what graphics layer this RenderLayer will be assigned.
     unsigned m_lostGroupedMapping : 1;
 
-    // Whether this render layer is trying to avoid becoming composited, if possible.
-    unsigned m_suppressingCompositedLayerCreation : 1;
-
     // The reason, if any exists, that a fixed-position layer is chosen not to be composited.
     unsigned m_viewportConstrainedNotCompositedReason : ViewportConstrainedNotCompositedReasonBits;
 
diff --git a/Source/core/rendering/RenderLayerModelObject.cpp b/Source/core/rendering/RenderLayerModelObject.cpp
index ce728d9..724750e 100644
--- a/Source/core/rendering/RenderLayerModelObject.cpp
+++ b/Source/core/rendering/RenderLayerModelObject.cpp
@@ -121,8 +121,6 @@
 void RenderLayerModelObject::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
 {
     bool hadTransform = hasTransform();
-    bool hadLayer = hasLayer();
-    bool layerWasSelfPainting = hadLayer && layer()->isSelfPaintingLayer();
 
     RenderObject::styleDidChange(diff, oldStyle);
     updateFromStyle();
@@ -161,10 +159,7 @@
         // FIXME: Ideally we shouldn't need this setter but we can't easily infer an overflow-only layer
         // from the style.
         layer()->setLayerType(type);
-
         layer()->styleChanged(diff, oldStyle);
-        if (hadLayer && layer()->isSelfPaintingLayer() != layerWasSelfPainting)
-            setChildNeedsLayout();
     }
 
     if (FrameView *frameView = view()->frameView()) {
diff --git a/Source/core/rendering/RenderLayerRepainter.cpp b/Source/core/rendering/RenderLayerRepainter.cpp
index 1cdebbd..8751d75 100644
--- a/Source/core/rendering/RenderLayerRepainter.cpp
+++ b/Source/core/rendering/RenderLayerRepainter.cpp
@@ -73,8 +73,9 @@
         // LayoutState outside the layout() phase and use it here.
         ASSERT(!view->layoutStateEnabled());
 
-        RenderLayerModelObject* repaintContainer = m_renderer.containerForRepaint();
+        const RenderLayerModelObject* repaintContainer = m_renderer.containerForRepaint();
         LayoutRect oldRepaintRect = m_repaintRect;
+        LayoutPoint oldOffset = m_offset;
         computeRepaintRects(repaintContainer);
         shouldCheckForRepaint &= shouldRepaintLayer();
 
@@ -85,7 +86,7 @@
                     if (m_repaintRect != oldRepaintRect)
                         m_renderer.repaintUsingContainer(repaintContainer, pixelSnappedIntRect(m_repaintRect), InvalidationLayer);
                 } else {
-                    m_renderer.repaintAfterLayoutIfNeeded(repaintContainer, m_renderer.selfNeedsLayout(), oldRepaintRect, &m_repaintRect);
+                    m_renderer.repaintAfterLayoutIfNeeded(repaintContainer, m_renderer.selfNeedsLayout(), oldRepaintRect, oldOffset, &m_repaintRect, &m_offset);
                 }
             }
         }
@@ -113,6 +114,7 @@
         m_renderer.setPreviousRepaintRect(m_renderer.clippedOverflowRectForRepaint(m_renderer.containerForRepaint()));
     } else {
         m_repaintRect = m_renderer.clippedOverflowRectForRepaint(repaintContainer);
+        m_offset = m_renderer.positionFromRepaintContainer(repaintContainer);
     }
 }
 
@@ -141,7 +143,7 @@
 }
 
 // Since we're only painting non-composited layers, we know that they all share the same repaintContainer.
-void RenderLayerRepainter::repaintIncludingNonCompositingDescendants(RenderLayerModelObject* repaintContainer)
+void RenderLayerRepainter::repaintIncludingNonCompositingDescendants(const RenderLayerModelObject* repaintContainer)
 {
     m_renderer.repaintUsingContainer(repaintContainer, pixelSnappedIntRect(m_renderer.clippedOverflowRectForRepaint(repaintContainer)), InvalidationLayer);
 
@@ -201,11 +203,28 @@
     if (m_renderer.compositingState() == PaintsIntoGroupedBacking) {
         LayoutRect updatedRect(r);
 
+        ASSERT(m_renderer.layer());
+        ASSERT(m_renderer.layer()->enclosingTransformedAncestor());
+        ASSERT(m_renderer.layer()->enclosingTransformedAncestor()->renderer());
+
+        // FIXME: this defensive code should not have to exist. None of these pointers should ever be 0. See crbug.com/370410.
+        RenderLayerModelObject* transformedAncestor = 0;
+        if (RenderLayer* ancestor = m_renderer.layer()->enclosingTransformedAncestor())
+            transformedAncestor = ancestor->renderer();
+        if (!transformedAncestor)
+            return;
+
+        // If the transformedAncestor is actually the RenderView, we might get
+        // confused and think that we can use LayoutState. Ideally, we'd made
+        // LayoutState work for all composited layers as well, but until then
+        // we need to disable LayoutState for squashed layers.
+        LayoutStateDisabler layoutStateDisabler(*transformedAncestor);
+
         // This code adjusts the repaint rectangle to be in the space of the transformed ancestor of the grouped (i.e. squashed)
         // layer. This is because all layers that squash together need to repaint w.r.t. a single container that is
         // an ancestor of all of them, in order to properly take into account any local transforms etc.
         // FIXME: remove this special-case code that works around the repainting code structure.
-        m_renderer.computeRectForRepaint(m_renderer.layer()->enclosingTransformedAncestor()->renderer(), updatedRect);
+        m_renderer.computeRectForRepaint(transformedAncestor, updatedRect);
         updatedRect.moveBy(-m_renderer.layer()->groupedMapping()->squashingOffsetFromTransformedAncestor());
 
         IntRect repaintRect = pixelSnappedIntRect(updatedRect);
diff --git a/Source/core/rendering/RenderLayerRepainter.h b/Source/core/rendering/RenderLayerRepainter.h
index 04c4dfc..7df0b18 100644
--- a/Source/core/rendering/RenderLayerRepainter.h
+++ b/Source/core/rendering/RenderLayerRepainter.h
@@ -70,7 +70,7 @@
     LayoutRect repaintRectIncludingNonCompositingDescendants() const;
 
     void repaintAfterLayout(bool shouldCheckForRepaint);
-    void repaintIncludingNonCompositingDescendants(RenderLayerModelObject* repaintContainer);
+    void repaintIncludingNonCompositingDescendants(const RenderLayerModelObject* repaintContainer);
 
     void setRepaintStatus(RepaintStatus status) { m_repaintStatus = status; }
 
@@ -96,6 +96,7 @@
     unsigned m_repaintStatus; // RepaintStatus
 
     LayoutRect m_repaintRect; // Cached repaint rects. Used by layout.
+    LayoutPoint m_offset;
 };
 
 } // namespace WebCore
diff --git a/Source/core/rendering/RenderLayerScrollableArea.cpp b/Source/core/rendering/RenderLayerScrollableArea.cpp
index 2bfe940..f09c05c 100644
--- a/Source/core/rendering/RenderLayerScrollableArea.cpp
+++ b/Source/core/rendering/RenderLayerScrollableArea.cpp
@@ -75,8 +75,13 @@
 
 const int ResizerControlExpandRatioForTouch = 2;
 
-RenderLayerScrollableArea::RenderLayerScrollableArea(RenderBox& box)
-    : m_box(box)
+// Default value is set to 15 as the default
+// minimum size used by firefox is 15x15.
+static const int defaultMinimumWidthForResizing = 15;
+static const int defaultMinimumHeightForResizing = 15;
+
+RenderLayerScrollableArea::RenderLayerScrollableArea(RenderLayer& layer)
+    : m_layer(layer)
     , m_inResizeMode(false)
     , m_scrollsOverflow(false)
     , m_scrollDimensionsDirty(true)
@@ -88,7 +93,7 @@
 {
     ScrollableArea::setConstrainsScrollingToContentEdge(false);
 
-    Node* node = m_box.node();
+    Node* node = box().node();
     if (node && node->isElementNode()) {
         // We save and restore only the scrollOffset as the other scroll values are recalculated.
         Element* element = toElement(node);
@@ -103,31 +108,31 @@
 
 RenderLayerScrollableArea::~RenderLayerScrollableArea()
 {
-    if (inResizeMode() && !m_box.documentBeingDestroyed()) {
-        if (LocalFrame* frame = m_box.frame())
+    if (inResizeMode() && !box().documentBeingDestroyed()) {
+        if (LocalFrame* frame = box().frame())
             frame->eventHandler().resizeScrollableAreaDestroyed();
     }
 
-    if (LocalFrame* frame = m_box.frame()) {
+    if (LocalFrame* frame = box().frame()) {
         if (FrameView* frameView = frame->view()) {
             frameView->removeScrollableArea(this);
         }
     }
 
-    if (m_box.frame() && m_box.frame()->page()) {
-        if (ScrollingCoordinator* scrollingCoordinator = m_box.frame()->page()->scrollingCoordinator())
+    if (box().frame() && box().frame()->page()) {
+        if (ScrollingCoordinator* scrollingCoordinator = box().frame()->page()->scrollingCoordinator())
             scrollingCoordinator->willDestroyScrollableArea(this);
     }
 
-    if (!m_box.documentBeingDestroyed()) {
-        Node* node = m_box.node();
+    if (!box().documentBeingDestroyed()) {
+        Node* node = box().node();
         if (node && node->isElementNode())
             toElement(node)->setSavedLayerScrollOffset(m_scrollOffset);
     }
 
-    if (LocalFrame* frame = m_box.frame()) {
+    if (LocalFrame* frame = box().frame()) {
         if (FrameView* frameView = frame->view())
-            frameView->removeResizerArea(m_box);
+            frameView->removeResizerArea(box());
     }
 
     destroyScrollbar(HorizontalScrollbar);
@@ -141,7 +146,7 @@
 
 GraphicsLayer* RenderLayerScrollableArea::layerForScrolling() const
 {
-    return m_box.hasCompositedLayerMapping() ? m_box.compositedLayerMapping()->scrollingContentsLayer() : 0;
+    return box().hasCompositedLayerMapping() ? box().compositedLayerMapping()->scrollingContentsLayer() : 0;
 }
 
 GraphicsLayer* RenderLayerScrollableArea::layerForHorizontalScrollbar() const
@@ -149,7 +154,7 @@
     // See crbug.com/343132.
     DisableCompositingQueryAsserts disabler;
 
-    return m_box.hasCompositedLayerMapping() ? m_box.compositedLayerMapping()->layerForHorizontalScrollbar() : 0;
+    return box().hasCompositedLayerMapping() ? box().compositedLayerMapping()->layerForHorizontalScrollbar() : 0;
 }
 
 GraphicsLayer* RenderLayerScrollableArea::layerForVerticalScrollbar() const
@@ -157,7 +162,7 @@
     // See crbug.com/343132.
     DisableCompositingQueryAsserts disabler;
 
-    return m_box.hasCompositedLayerMapping() ? m_box.compositedLayerMapping()->layerForVerticalScrollbar() : 0;
+    return box().hasCompositedLayerMapping() ? box().compositedLayerMapping()->layerForVerticalScrollbar() : 0;
 }
 
 GraphicsLayer* RenderLayerScrollableArea::layerForScrollCorner() const
@@ -165,7 +170,7 @@
     // See crbug.com/343132.
     DisableCompositingQueryAsserts disabler;
 
-    return m_box.hasCompositedLayerMapping() ? m_box.compositedLayerMapping()->layerForScrollCorner() : 0;
+    return box().hasCompositedLayerMapping() ? box().compositedLayerMapping()->layerForScrollCorner() : 0;
 }
 
 void RenderLayerScrollableArea::invalidateScrollbarRect(Scrollbar* scrollbar, const IntRect& rect)
@@ -187,23 +192,23 @@
 
     IntRect scrollRect = rect;
     // If we are not yet inserted into the tree, there is no need to repaint.
-    if (!m_box.parent())
+    if (!box().parent())
         return;
 
     if (scrollbar == m_vBar.get())
-        scrollRect.move(verticalScrollbarStart(0, m_box.width()), m_box.borderTop());
+        scrollRect.move(verticalScrollbarStart(0, box().width()), box().borderTop());
     else
-        scrollRect.move(horizontalScrollbarStart(0), m_box.height() - m_box.borderBottom() - scrollbar->height());
+        scrollRect.move(horizontalScrollbarStart(0), box().height() - box().borderBottom() - scrollbar->height());
 
     if (scrollRect.isEmpty())
         return;
 
     LayoutRect repaintRect = scrollRect;
-    m_box.flipForWritingMode(repaintRect);
+    box().flipForWritingMode(repaintRect);
 
     IntRect intRect = pixelSnappedIntRect(repaintRect);
 
-    if (RuntimeEnabledFeatures::repaintAfterLayoutEnabled() && m_box.frameView()->isInPerformLayout()) {
+    if (RuntimeEnabledFeatures::repaintAfterLayoutEnabled() && box().frameView()->isInPerformLayout()) {
         if (scrollbar == m_vBar.get()) {
             m_verticalBarDamage = intRect;
             m_hasVerticalBarDamage = true;
@@ -213,7 +218,7 @@
         }
 
     } else {
-        m_box.repaintRectangle(intRect);
+        box().repaintRectangle(intRect);
     }
 }
 
@@ -232,7 +237,7 @@
 
 bool RenderLayerScrollableArea::isActive() const
 {
-    Page* page = m_box.frame()->page();
+    Page* page = box().frame()->page();
     return page && page->focusController().isActive();
 }
 
@@ -281,53 +286,53 @@
     // (b) Both scrollbars are present.
     bool hasHorizontalBar = horizontalScrollbar();
     bool hasVerticalBar = verticalScrollbar();
-    bool hasResizer = m_box.style()->resize() != RESIZE_NONE;
+    bool hasResizer = box().style()->resize() != RESIZE_NONE;
     if ((hasHorizontalBar && hasVerticalBar) || (hasResizer && (hasHorizontalBar || hasVerticalBar)))
-        return cornerRect(m_box.style(), horizontalScrollbar(), verticalScrollbar(), m_box.pixelSnappedBorderBoxRect());
+        return cornerRect(box().style(), horizontalScrollbar(), verticalScrollbar(), box().pixelSnappedBorderBoxRect());
     return IntRect();
 }
 
 IntRect RenderLayerScrollableArea::convertFromScrollbarToContainingView(const Scrollbar* scrollbar, const IntRect& scrollbarRect) const
 {
-    RenderView* view = m_box.view();
+    RenderView* view = box().view();
     if (!view)
         return scrollbarRect;
 
     IntRect rect = scrollbarRect;
     rect.move(scrollbarOffset(scrollbar));
 
-    return view->frameView()->convertFromRenderer(m_box, rect);
+    return view->frameView()->convertFromRenderer(box(), rect);
 }
 
 IntRect RenderLayerScrollableArea::convertFromContainingViewToScrollbar(const Scrollbar* scrollbar, const IntRect& parentRect) const
 {
-    RenderView* view = m_box.view();
+    RenderView* view = box().view();
     if (!view)
         return parentRect;
 
-    IntRect rect = view->frameView()->convertToRenderer(m_box, parentRect);
+    IntRect rect = view->frameView()->convertToRenderer(box(), parentRect);
     rect.move(-scrollbarOffset(scrollbar));
     return rect;
 }
 
 IntPoint RenderLayerScrollableArea::convertFromScrollbarToContainingView(const Scrollbar* scrollbar, const IntPoint& scrollbarPoint) const
 {
-    RenderView* view = m_box.view();
+    RenderView* view = box().view();
     if (!view)
         return scrollbarPoint;
 
     IntPoint point = scrollbarPoint;
     point.move(scrollbarOffset(scrollbar));
-    return view->frameView()->convertFromRenderer(m_box, point);
+    return view->frameView()->convertFromRenderer(box(), point);
 }
 
 IntPoint RenderLayerScrollableArea::convertFromContainingViewToScrollbar(const Scrollbar* scrollbar, const IntPoint& parentPoint) const
 {
-    RenderView* view = m_box.view();
+    RenderView* view = box().view();
     if (!view)
         return parentPoint;
 
-    IntPoint point = view->frameView()->convertToRenderer(m_box, parentPoint);
+    IntPoint point = view->frameView()->convertToRenderer(box(), parentPoint);
 
     point.move(-scrollbarOffset(scrollbar));
     return point;
@@ -341,7 +346,7 @@
 
 void RenderLayerScrollableArea::setScrollOffset(const IntPoint& newScrollOffset)
 {
-    if (!m_box.isMarquee()) {
+    if (!box().isMarquee()) {
         // Ensure that the dimensions will be computed if they need to be (for overflow:hidden blocks).
         if (m_scrollDimensionsDirty)
             computeScrollDimensions();
@@ -352,14 +357,14 @@
 
     setScrollOffset(toIntSize(newScrollOffset));
 
-    LocalFrame* frame = m_box.frame();
+    LocalFrame* frame = box().frame();
     ASSERT(frame);
 
-    RefPtr<FrameView> frameView = m_box.frameView();
+    RefPtr<FrameView> frameView = box().frameView();
 
-    TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "ScrollLayer", "data", InspectorScrollLayerEvent::data(&m_box));
+    TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "ScrollLayer", "data", InspectorScrollLayerEvent::data(&box()));
     // FIXME(361045): remove InspectorInstrumentation calls once DevTools Timeline migrates to tracing.
-    InspectorInstrumentation::willScrollLayer(&m_box);
+    InspectorInstrumentation::willScrollLayer(&box());
 
     // Update the positions of our child layers (if needed as only fixed layers should be impacted by a scroll).
     // We don't update compositing layers, because we need to do a deep update from the compositing ancestor.
@@ -375,7 +380,7 @@
         updateCompositingLayersAfterScroll();
     }
 
-    RenderLayerModelObject* repaintContainer = m_box.containerForRepaint();
+    const RenderLayerModelObject* repaintContainer = box().containerForRepaint();
     // The caret rect needs to be invalidated after scrolling
     frame->selection().setCaretRectNeedsUpdate();
 
@@ -390,14 +395,14 @@
 
     bool requiresRepaint = true;
 
-    if (m_box.view()->compositor()->inCompositingMode()) {
+    if (box().view()->compositor()->inCompositingMode()) {
         // Hits in virtual/gpu/fast/canvas/canvas-scroll-path-into-view.html.
         DisableCompositingQueryAsserts disabler;
         bool onlyScrolledCompositedLayers = scrollsOverflow()
             && !layer()->hasVisibleNonLayerContent()
             && !layer()->hasNonCompositedChild()
             && !layer()->hasBlockSelectionGapBounds()
-            && !m_box.isMarquee();
+            && !box().isMarquee();
 
         if (usesCompositedScrolling() || onlyScrolledCompositedLayers)
             requiresRepaint = false;
@@ -406,23 +411,23 @@
     // Just schedule a full repaint of our object.
     if (requiresRepaint) {
         if (RuntimeEnabledFeatures::repaintAfterLayoutEnabled()) {
-            if (m_box.frameView()->isInPerformLayout())
-                m_box.setShouldDoFullRepaintAfterLayout(true);
+            if (box().frameView()->isInPerformLayout())
+                box().setShouldDoFullRepaintAfterLayout(true);
             else
-                m_box.repaintUsingContainer(repaintContainer, pixelSnappedIntRect(layer()->renderer()->previousRepaintRect()), InvalidationScroll);
+                box().repaintUsingContainer(repaintContainer, pixelSnappedIntRect(layer()->renderer()->previousRepaintRect()), InvalidationScroll);
         } else {
-            m_box.repaintUsingContainer(repaintContainer, pixelSnappedIntRect(layer()->repainter().repaintRect()), InvalidationScroll);
+            box().repaintUsingContainer(repaintContainer, pixelSnappedIntRect(layer()->repainter().repaintRect()), InvalidationScroll);
         }
     }
 
     // Schedule the scroll DOM event.
-    if (m_box.node())
-        m_box.node()->document().enqueueScrollEventForNode(m_box.node());
+    if (box().node())
+        box().node()->document().enqueueScrollEventForNode(box().node());
 
-    if (AXObjectCache* cache = m_box.document().existingAXObjectCache())
-        cache->handleScrollPositionChanged(&m_box);
+    if (AXObjectCache* cache = box().document().existingAXObjectCache())
+        cache->handleScrollPositionChanged(&box());
 
-    InspectorInstrumentation::didScrollLayer(&m_box);
+    InspectorInstrumentation::didScrollLayer(&box());
 }
 
 IntPoint RenderLayerScrollableArea::scrollPosition() const
@@ -437,10 +442,10 @@
 
 IntPoint RenderLayerScrollableArea::maximumScrollPosition() const
 {
-    if (!m_box.hasOverflowClip())
+    if (!box().hasOverflowClip())
         return -scrollOrigin();
 
-    return -scrollOrigin() + enclosingIntRect(m_overflowRect).size() - enclosingIntRect(m_box.clientBoxRect()).size();
+    return -scrollOrigin() + enclosingIntRect(m_overflowRect).size() - enclosingIntRect(box().clientBoxRect()).size();
 }
 
 IntRect RenderLayerScrollableArea::visibleContentRect(IncludeScrollbarsInRect scrollbarInclusion) const
@@ -478,17 +483,17 @@
 
 IntPoint RenderLayerScrollableArea::lastKnownMousePosition() const
 {
-    return m_box.frame() ? m_box.frame()->eventHandler().lastKnownMousePosition() : IntPoint();
+    return box().frame() ? box().frame()->eventHandler().lastKnownMousePosition() : IntPoint();
 }
 
 bool RenderLayerScrollableArea::scrollAnimatorEnabled() const
 {
-    return m_box.frame()->settings() && m_box.frame()->settings()->scrollAnimatorEnabled();
+    return box().frame()->settings() && box().frame()->settings()->scrollAnimatorEnabled();
 }
 
 bool RenderLayerScrollableArea::scheduleAnimation()
 {
-    if (HostWindow* window = m_box.frameView()->hostWindow()) {
+    if (HostWindow* window = box().frameView()->hostWindow()) {
         window->scheduleAnimation();
         return true;
     }
@@ -497,7 +502,7 @@
 
 bool RenderLayerScrollableArea::shouldSuspendScrollAnimations() const
 {
-    RenderView* view = m_box.view();
+    RenderView* view = box().view();
     if (!view)
         return true;
     return view->frameView()->shouldSuspendScrollAnimations();
@@ -505,7 +510,7 @@
 
 bool RenderLayerScrollableArea::scrollbarsCanBeActive() const
 {
-    RenderView* view = m_box.view();
+    RenderView* view = box().view();
     if (!view)
         return false;
     return view->frameView()->scrollbarsCanBeActive();
@@ -513,62 +518,67 @@
 
 IntRect RenderLayerScrollableArea::scrollableAreaBoundingBox() const
 {
-    return m_box.absoluteBoundingBoxRect();
+    return box().absoluteBoundingBoxRect();
 }
 
 bool RenderLayerScrollableArea::userInputScrollable(ScrollbarOrientation orientation) const
 {
-    if (m_box.isIntristicallyScrollable(orientation))
+    if (box().isIntristicallyScrollable(orientation))
         return true;
 
     EOverflow overflowStyle = (orientation == HorizontalScrollbar) ?
-        m_box.style()->overflowX() : m_box.style()->overflowY();
+        box().style()->overflowX() : box().style()->overflowY();
     return (overflowStyle == OSCROLL || overflowStyle == OAUTO || overflowStyle == OOVERLAY);
 }
 
 bool RenderLayerScrollableArea::shouldPlaceVerticalScrollbarOnLeft() const
 {
-    return m_box.style()->shouldPlaceBlockDirectionScrollbarOnLogicalLeft();
+    return box().style()->shouldPlaceBlockDirectionScrollbarOnLogicalLeft();
 }
 
 int RenderLayerScrollableArea::pageStep(ScrollbarOrientation orientation) const
 {
     int length = (orientation == HorizontalScrollbar) ?
-        m_box.pixelSnappedClientWidth() : m_box.pixelSnappedClientHeight();
+        box().pixelSnappedClientWidth() : box().pixelSnappedClientHeight();
     int minPageStep = static_cast<float>(length) * ScrollableArea::minFractionToStepWhenPaging();
     int pageStep = max(minPageStep, length - ScrollableArea::maxOverlapBetweenPages());
 
     return max(pageStep, 1);
 }
 
+RenderBox& RenderLayerScrollableArea::box() const
+{
+    return *m_layer.renderBox();
+}
+
 RenderLayer* RenderLayerScrollableArea::layer() const
 {
-    return m_box.layer();
+    return &m_layer;
 }
 
 int RenderLayerScrollableArea::scrollWidth() const
 {
     if (m_scrollDimensionsDirty)
         const_cast<RenderLayerScrollableArea*>(this)->computeScrollDimensions();
-    return snapSizeToPixel(m_overflowRect.width(), m_box.clientLeft() + m_box.x());
+    return snapSizeToPixel(m_overflowRect.width(), box().clientLeft() + box().x());
 }
 
 int RenderLayerScrollableArea::scrollHeight() const
 {
     if (m_scrollDimensionsDirty)
         const_cast<RenderLayerScrollableArea*>(this)->computeScrollDimensions();
-    return snapSizeToPixel(m_overflowRect.height(), m_box.clientTop() + m_box.y());
+    return snapSizeToPixel(m_overflowRect.height(), box().clientTop() + box().y());
 }
 
 void RenderLayerScrollableArea::computeScrollDimensions()
 {
     m_scrollDimensionsDirty = false;
 
-    m_overflowRect = m_box.layoutOverflowRect();
-    m_box.flipForWritingMode(m_overflowRect);
+    m_overflowRect = box().layoutOverflowRect();
+    box().flipForWritingMode(m_overflowRect);
 
-    int scrollableLeftOverflow = m_overflowRect.x() - m_box.borderLeft() - (m_box.style()->shouldPlaceBlockDirectionScrollbarOnLogicalLeft() ? m_box.verticalScrollbarWidth() : 0);
-    int scrollableTopOverflow = m_overflowRect.y() - m_box.borderTop();
+    int scrollableLeftOverflow = m_overflowRect.x() - box().borderLeft() - (box().style()->shouldPlaceBlockDirectionScrollbarOnLogicalLeft() ? box().verticalScrollbarWidth() : 0);
+    int scrollableTopOverflow = m_overflowRect.y() - box().borderTop();
     setScrollOrigin(IntPoint(-scrollableLeftOverflow, -scrollableTopOverflow));
 }
 
@@ -582,7 +592,7 @@
 void RenderLayerScrollableArea::updateAfterLayout()
 {
     // List box parts handle the scrollbars by themselves so we have nothing to do.
-    if (m_box.style()->appearance() == ListboxPart)
+    if (box().style()->appearance() == ListboxPart)
         return;
 
     m_scrollDimensionsDirty = true;
@@ -590,7 +600,7 @@
 
     computeScrollDimensions();
 
-    if (!m_box.isMarquee()) {
+    if (!box().isMarquee()) {
         // Layout may cause us to be at an invalid scroll position. In this case we need
         // to pull our scroll offsets back to the max (or push them up to the min).
         IntSize clampedScrollOffset = clampScrollOffset(adjustedScrollOffset());
@@ -609,20 +619,20 @@
         DisableCompositingQueryAsserts disabler;
 
         // overflow:scroll should just enable/disable.
-        if (m_box.style()->overflowX() == OSCROLL)
+        if (box().style()->overflowX() == OSCROLL)
             horizontalScrollbar()->setEnabled(hasHorizontalOverflow);
-        if (m_box.style()->overflowY() == OSCROLL)
+        if (box().style()->overflowY() == OSCROLL)
             verticalScrollbar()->setEnabled(hasVerticalOverflow);
     }
 
     // overflow:auto may need to lay out again if scrollbars got added/removed.
-    bool autoHorizontalScrollBarChanged = m_box.hasAutoHorizontalScrollbar() && (hasHorizontalScrollbar() != hasHorizontalOverflow);
-    bool autoVerticalScrollBarChanged = m_box.hasAutoVerticalScrollbar() && (hasVerticalScrollbar() != hasVerticalOverflow);
+    bool autoHorizontalScrollBarChanged = box().hasAutoHorizontalScrollbar() && (hasHorizontalScrollbar() != hasHorizontalOverflow);
+    bool autoVerticalScrollBarChanged = box().hasAutoVerticalScrollbar() && (hasVerticalScrollbar() != hasVerticalOverflow);
 
     if (autoHorizontalScrollBarChanged || autoVerticalScrollBarChanged) {
-        if (m_box.hasAutoHorizontalScrollbar())
+        if (box().hasAutoHorizontalScrollbar())
             setHasHorizontalScrollbar(hasHorizontalOverflow);
-        if (m_box.hasAutoVerticalScrollbar())
+        if (box().hasAutoVerticalScrollbar())
             setHasVerticalScrollbar(hasVerticalOverflow);
 
         if (hasVerticalOverflow || hasHorizontalOverflow)
@@ -631,24 +641,24 @@
         layer()->updateSelfPaintingLayer();
 
         // Force an update since we know the scrollbars have changed things.
-        if (m_box.document().hasAnnotatedRegions())
-            m_box.document().setAnnotatedRegionsDirty(true);
+        if (box().document().hasAnnotatedRegions())
+            box().document().setAnnotatedRegionsDirty(true);
 
         if (!RuntimeEnabledFeatures::repaintAfterLayoutEnabled())
-            m_box.repaint();
+            box().repaint();
 
-        if (m_box.style()->overflowX() == OAUTO || m_box.style()->overflowY() == OAUTO) {
+        if (box().style()->overflowX() == OAUTO || box().style()->overflowY() == OAUTO) {
             if (!m_inOverflowRelayout) {
                 // Our proprietary overflow: overlay value doesn't trigger a layout.
                 m_inOverflowRelayout = true;
-                SubtreeLayoutScope layoutScope(m_box);
-                layoutScope.setNeedsLayout(&m_box);
-                if (m_box.isRenderBlock()) {
-                    RenderBlock& block = toRenderBlock(m_box);
+                SubtreeLayoutScope layoutScope(box());
+                layoutScope.setNeedsLayout(&box());
+                if (box().isRenderBlock()) {
+                    RenderBlock& block = toRenderBlock(box());
                     block.scrollbarsChanged(autoHorizontalScrollBarChanged, autoVerticalScrollBarChanged);
                     block.layoutBlock(true);
                 } else {
-                    m_box.layout();
+                    box().layout();
                 }
                 m_inOverflowRelayout = false;
             }
@@ -661,11 +671,11 @@
 
         // Set up the range (and page step/line step).
         if (Scrollbar* horizontalScrollbar = this->horizontalScrollbar()) {
-            int clientWidth = m_box.pixelSnappedClientWidth();
+            int clientWidth = box().pixelSnappedClientWidth();
             horizontalScrollbar->setProportion(clientWidth, overflowRect().width());
         }
         if (Scrollbar* verticalScrollbar = this->verticalScrollbar()) {
-            int clientHeight = m_box.pixelSnappedClientHeight();
+            int clientHeight = box().pixelSnappedClientHeight();
             verticalScrollbar->setProportion(clientHeight, overflowRect().height());
         }
     }
@@ -674,12 +684,12 @@
 
     {
         // FIXME: We should not be allowing repaint during layout. crbug.com/336251
-        AllowRepaintScope scoper(m_box.view()->frameView());
+        AllowRepaintScope scoper(box().view()->frameView());
 
         // FIXME: Remove incremental compositing updates after fixing the chicken/egg issues
         // https://code.google.com/p/chromium/issues/detail?id=343756
         DisableCompositingQueryAsserts disabler;
-        m_box.view()->compositor()->updateLayerCompositingState(m_box.layer());
+        box().view()->compositor()->updateLayerCompositingState(box().layer());
     }
 }
 
@@ -687,24 +697,24 @@
 {
     ASSERT(!m_scrollDimensionsDirty);
 
-    return scrollWidth() > m_box.pixelSnappedClientWidth();
+    return scrollWidth() > box().pixelSnappedClientWidth();
 }
 
 bool RenderLayerScrollableArea::hasVerticalOverflow() const
 {
     ASSERT(!m_scrollDimensionsDirty);
 
-    return scrollHeight() > m_box.pixelSnappedClientHeight();
+    return scrollHeight() > box().pixelSnappedClientHeight();
 }
 
 bool RenderLayerScrollableArea::hasScrollableHorizontalOverflow() const
 {
-    return hasHorizontalOverflow() && m_box.scrollsOverflowX();
+    return hasHorizontalOverflow() && box().scrollsOverflowX();
 }
 
 bool RenderLayerScrollableArea::hasScrollableVerticalOverflow() const
 {
-    return hasVerticalOverflow() && m_box.scrollsOverflowY();
+    return hasVerticalOverflow() && box().scrollsOverflowY();
 }
 
 static bool overflowRequiresScrollbar(EOverflow overflow)
@@ -717,21 +727,31 @@
     return overflow == OAUTO || overflow == OOVERLAY;
 }
 
+IntSize RenderLayerScrollableArea::minimumSizeForResizing()
+{
+    int minimumWidth = intValueForLength(box().style()->logicalMinWidth(), box().containingBlock()->logicalWidth());
+    int minimumHeight = intValueForLength(box().style()->logicalMinHeight(), box().containingBlock()->logicalHeight());
+
+    minimumWidth = std::max(minimumWidth, defaultMinimumWidthForResizing);
+    minimumHeight = std::max(minimumHeight, defaultMinimumHeightForResizing);
+    return IntSize(minimumWidth, minimumHeight);
+}
+
 void RenderLayerScrollableArea::updateAfterStyleChange(const RenderStyle* oldStyle)
 {
     // List box parts handle the scrollbars by themselves so we have nothing to do.
-    if (m_box.style()->appearance() == ListboxPart)
+    if (box().style()->appearance() == ListboxPart)
         return;
 
     // RenderView shouldn't provide scrollbars on its own.
-    if (m_box.isRenderView())
+    if (box().isRenderView())
         return;
 
     if (!m_scrollDimensionsDirty)
         updateScrollableAreaSet(hasScrollableHorizontalOverflow() || hasScrollableVerticalOverflow());
 
-    EOverflow overflowX = m_box.style()->overflowX();
-    EOverflow overflowY = m_box.style()->overflowY();
+    EOverflow overflowX = box().style()->overflowX();
+    EOverflow overflowY = box().style()->overflowY();
 
     // To avoid doing a relayout in updateScrollbarsAfterLayout, we try to keep any automatic scrollbar that was already present.
     bool needsHorizontalScrollbar = (hasHorizontalScrollbar() && overflowDefinesAutomaticScrollbar(overflowX)) || overflowRequiresScrollbar(overflowX);
@@ -778,26 +798,26 @@
 {
     computeScrollDimensions();
     if (Scrollbar* horizontalScrollbar = this->horizontalScrollbar()) {
-        int clientWidth = m_box.pixelSnappedClientWidth();
+        int clientWidth = box().pixelSnappedClientWidth();
         horizontalScrollbar->setProportion(clientWidth, overflowRect().width());
     }
     if (Scrollbar* verticalScrollbar = this->verticalScrollbar()) {
-        int clientHeight = m_box.pixelSnappedClientHeight();
+        int clientHeight = box().pixelSnappedClientHeight();
         verticalScrollbar->setProportion(clientHeight, overflowRect().height());
     }
 
     bool hasHorizontalOverflow = this->hasHorizontalOverflow();
     bool hasVerticalOverflow = this->hasVerticalOverflow();
-    bool autoHorizontalScrollBarChanged = m_box.hasAutoHorizontalScrollbar() && (hasHorizontalScrollbar() != hasHorizontalOverflow);
-    bool autoVerticalScrollBarChanged = m_box.hasAutoVerticalScrollbar() && (hasVerticalScrollbar() != hasVerticalOverflow);
+    bool autoHorizontalScrollBarChanged = box().hasAutoHorizontalScrollbar() && (hasHorizontalScrollbar() != hasHorizontalOverflow);
+    bool autoVerticalScrollBarChanged = box().hasAutoVerticalScrollbar() && (hasVerticalScrollbar() != hasVerticalOverflow);
     if (autoHorizontalScrollBarChanged || autoVerticalScrollBarChanged)
-        m_box.setNeedsLayout();
+        box().setNeedsLayout();
 }
 
 IntSize RenderLayerScrollableArea::clampScrollOffset(const IntSize& scrollOffset) const
 {
-    int maxX = scrollWidth() - m_box.pixelSnappedClientWidth();
-    int maxY = scrollHeight() - m_box.pixelSnappedClientHeight();
+    int maxX = scrollWidth() - box().pixelSnappedClientWidth();
+    int maxY = scrollHeight() - box().pixelSnappedClientHeight();
 
     int x = std::max(std::min(scrollOffset.width(), maxX), 0);
     int y = std::max(std::min(scrollOffset.height(), maxY), 0);
@@ -812,8 +832,8 @@
     const IntRect& scrollCorner = scrollCornerRect();
 
     return IntRect(horizontalScrollbarStart(borderBoxRect.x()),
-        borderBoxRect.maxY() - m_box.borderBottom() - m_hBar->height(),
-        borderBoxRect.width() - (m_box.borderLeft() + m_box.borderRight()) - scrollCorner.width(),
+        borderBoxRect.maxY() - box().borderBottom() - m_hBar->height(),
+        borderBoxRect.width() - (box().borderLeft() + box().borderRight()) - scrollCorner.width(),
         m_hBar->height());
 }
 
@@ -825,33 +845,33 @@
     const IntRect& scrollCorner = scrollCornerRect();
 
     return IntRect(verticalScrollbarStart(borderBoxRect.x(), borderBoxRect.maxX()),
-        borderBoxRect.y() + m_box.borderTop(),
+        borderBoxRect.y() + box().borderTop(),
         m_vBar->width(),
-        borderBoxRect.height() - (m_box.borderTop() + m_box.borderBottom()) - scrollCorner.height());
+        borderBoxRect.height() - (box().borderTop() + box().borderBottom()) - scrollCorner.height());
 }
 
 LayoutUnit RenderLayerScrollableArea::verticalScrollbarStart(int minX, int maxX) const
 {
-    if (m_box.style()->shouldPlaceBlockDirectionScrollbarOnLogicalLeft())
-        return minX + m_box.borderLeft();
-    return maxX - m_box.borderRight() - m_vBar->width();
+    if (box().style()->shouldPlaceBlockDirectionScrollbarOnLogicalLeft())
+        return minX + box().borderLeft();
+    return maxX - box().borderRight() - m_vBar->width();
 }
 
 LayoutUnit RenderLayerScrollableArea::horizontalScrollbarStart(int minX) const
 {
-    int x = minX + m_box.borderLeft();
-    if (m_box.style()->shouldPlaceBlockDirectionScrollbarOnLogicalLeft())
-        x += m_vBar ? m_vBar->width() : resizerCornerRect(m_box.pixelSnappedBorderBoxRect(), ResizerForPointer).width();
+    int x = minX + box().borderLeft();
+    if (box().style()->shouldPlaceBlockDirectionScrollbarOnLogicalLeft())
+        x += m_vBar ? m_vBar->width() : resizerCornerRect(box().pixelSnappedBorderBoxRect(), ResizerForPointer).width();
     return x;
 }
 
 IntSize RenderLayerScrollableArea::scrollbarOffset(const Scrollbar* scrollbar) const
 {
     if (scrollbar == m_vBar.get())
-        return IntSize(verticalScrollbarStart(0, m_box.width()), m_box.borderTop());
+        return IntSize(verticalScrollbarStart(0, box().width()), box().borderTop());
 
     if (scrollbar == m_hBar.get())
-        return IntSize(horizontalScrollbarStart(0), m_box.height() - m_box.borderBottom() - scrollbar->height());
+        return IntSize(horizontalScrollbarStart(0), box().height() - box().borderBottom() - scrollbar->height());
 
     ASSERT_NOT_REACHED();
     return IntSize();
@@ -872,7 +892,7 @@
 PassRefPtr<Scrollbar> RenderLayerScrollableArea::createScrollbar(ScrollbarOrientation orientation)
 {
     RefPtr<Scrollbar> widget;
-    RenderObject* actualRenderer = rendererForScrollbar(m_box);
+    RenderObject* actualRenderer = rendererForScrollbar(box());
     bool hasCustomScrollbarStyle = actualRenderer->isBox() && actualRenderer->style()->hasPseudoStyle(SCROLLBAR);
     if (hasCustomScrollbarStyle) {
         widget = RenderScrollbar::createCustomScrollbar(this, orientation, actualRenderer->node());
@@ -883,7 +903,7 @@
         else
             didAddScrollbar(widget.get(), VerticalScrollbar);
     }
-    m_box.document().view()->addChild(widget.get());
+    box().document().view()->addChild(widget.get());
     return widget.release();
 }
 
@@ -922,8 +942,8 @@
         m_vBar->styleChanged();
 
     // Force an update since we know the scrollbars have changed things.
-    if (m_box.document().hasAnnotatedRegions())
-        m_box.document().setAnnotatedRegionsDirty(true);
+    if (box().document().hasAnnotatedRegions())
+        box().document().setAnnotatedRegionsDirty(true);
 }
 
 void RenderLayerScrollableArea::setHasVerticalScrollbar(bool hasScrollbar)
@@ -946,8 +966,8 @@
         m_vBar->styleChanged();
 
     // Force an update since we know the scrollbars have changed things.
-    if (m_box.document().hasAnnotatedRegions())
-        m_box.document().setAnnotatedRegionsDirty(true);
+    if (box().document().hasAnnotatedRegions())
+        box().document().setAnnotatedRegionsDirty(true);
 }
 
 int RenderLayerScrollableArea::verticalScrollbarWidth(OverlayScrollbarSizeRelevancy relevancy) const
@@ -967,9 +987,9 @@
 void RenderLayerScrollableArea::positionOverflowControls()
 {
     RenderGeometryMap geometryMap(UseTransforms);
-    RenderView* view = m_box.view();
-    if (m_box.layer() != view->layer() && m_box.layer()->parent())
-        geometryMap.pushMappingsToAncestor(m_box.layer()->parent(), 0);
+    RenderView* view = box().view();
+    if (box().layer() != view->layer() && box().layer()->parent())
+        geometryMap.pushMappingsToAncestor(box().layer()->parent(), 0);
 
     LayoutPoint offsetFromRoot = LayoutPoint(geometryMap.absolutePoint(FloatPoint()));
     positionOverflowControls(toIntSize(roundedIntPoint(offsetFromRoot)));
@@ -977,10 +997,10 @@
 
 void RenderLayerScrollableArea::positionOverflowControls(const IntSize& offsetFromRoot)
 {
-    if (!hasScrollbar() && !m_box.canResize())
+    if (!hasScrollbar() && !box().canResize())
         return;
 
-    const IntRect borderBox = m_box.pixelSnappedBorderBoxRect();
+    const IntRect borderBox = box().pixelSnappedBorderBoxRect();
     if (Scrollbar* verticalScrollbar = this->verticalScrollbar()) {
         IntRect vBarRect = rectForVerticalScrollbar(borderBox);
         vBarRect.move(offsetFromRoot);
@@ -1003,8 +1023,8 @@
     // FIXME, this should eventually be removed, once we are certain that composited
     // controls get correctly positioned on a compositor update. For now, conservatively
     // leaving this unchanged.
-    if (m_box.hasCompositedLayerMapping())
-        m_box.compositedLayerMapping()->positionOverflowControlsLayers(offsetFromRoot);
+    if (box().hasCompositedLayerMapping())
+        box().compositedLayerMapping()->positionOverflowControlsLayers(offsetFromRoot);
 }
 
 void RenderLayerScrollableArea::updateScrollCornerStyle()
@@ -1014,12 +1034,12 @@
     if (!m_scrollCorner && hasOverlayScrollbars())
         return;
 
-    RenderObject* actualRenderer = rendererForScrollbar(m_box);
-    RefPtr<RenderStyle> corner = m_box.hasOverflowClip() ? actualRenderer->getUncachedPseudoStyle(PseudoStyleRequest(SCROLLBAR_CORNER), actualRenderer->style()) : PassRefPtr<RenderStyle>(nullptr);
+    RenderObject* actualRenderer = rendererForScrollbar(box());
+    RefPtr<RenderStyle> corner = box().hasOverflowClip() ? actualRenderer->getUncachedPseudoStyle(PseudoStyleRequest(SCROLLBAR_CORNER), actualRenderer->style()) : PassRefPtr<RenderStyle>(nullptr);
     if (corner) {
         if (!m_scrollCorner) {
-            m_scrollCorner = RenderScrollbarPart::createAnonymous(&m_box.document());
-            m_scrollCorner->setParent(&m_box);
+            m_scrollCorner = RenderScrollbarPart::createAnonymous(&box().document());
+            m_scrollCorner->setParent(&box());
         }
         m_scrollCorner->setStyle(corner.release());
     } else if (m_scrollCorner) {
@@ -1031,7 +1051,7 @@
 void RenderLayerScrollableArea::paintOverflowControls(GraphicsContext* context, const IntPoint& paintOffset, const IntRect& damageRect, bool paintingOverlayControls)
 {
     // Don't do anything if we have no overflow.
-    if (!m_box.hasOverflowClip())
+    if (!box().hasOverflowClip())
         return;
 
     IntPoint adjustedPaintOffset = paintOffset;
@@ -1059,7 +1079,7 @@
         if (!overflowControlsIntersectRect(localDamgeRect))
             return;
 
-        RenderView* renderView = m_box.view();
+        RenderView* renderView = box().view();
 
         RenderLayer* paintingRoot = layer()->enclosingCompositingLayer();
         if (!paintingRoot)
@@ -1115,22 +1135,22 @@
 
 bool RenderLayerScrollableArea::hitTestOverflowControls(HitTestResult& result, const IntPoint& localPoint)
 {
-    if (!hasScrollbar() && !m_box.canResize())
+    if (!hasScrollbar() && !box().canResize())
         return false;
 
     IntRect resizeControlRect;
-    if (m_box.style()->resize() != RESIZE_NONE) {
-        resizeControlRect = resizerCornerRect(m_box.pixelSnappedBorderBoxRect(), ResizerForPointer);
+    if (box().style()->resize() != RESIZE_NONE) {
+        resizeControlRect = resizerCornerRect(box().pixelSnappedBorderBoxRect(), ResizerForPointer);
         if (resizeControlRect.contains(localPoint))
             return true;
     }
 
     int resizeControlSize = max(resizeControlRect.height(), 0);
     if (m_vBar && m_vBar->shouldParticipateInHitTesting()) {
-        LayoutRect vBarRect(verticalScrollbarStart(0, m_box.width()),
-            m_box.borderTop(),
+        LayoutRect vBarRect(verticalScrollbarStart(0, box().width()),
+            box().borderTop(),
             m_vBar->width(),
-            m_box.height() - (m_box.borderTop() + m_box.borderBottom()) - (m_hBar ? m_hBar->height() : resizeControlSize));
+            box().height() - (box().borderTop() + box().borderBottom()) - (m_hBar ? m_hBar->height() : resizeControlSize));
         if (vBarRect.contains(localPoint)) {
             result.setScrollbar(m_vBar.get());
             return true;
@@ -1140,8 +1160,8 @@
     resizeControlSize = max(resizeControlRect.width(), 0);
     if (m_hBar && m_hBar->shouldParticipateInHitTesting()) {
         LayoutRect hBarRect(horizontalScrollbarStart(0),
-            m_box.height() - m_box.borderBottom() - m_hBar->height(),
-            m_box.width() - (m_box.borderLeft() + m_box.borderRight()) - (m_vBar ? m_vBar->width() : resizeControlSize),
+            box().height() - box().borderBottom() - m_hBar->height(),
+            box().width() - (box().borderLeft() + box().borderRight()) - (m_vBar ? m_vBar->width() : resizeControlSize),
             m_hBar->height());
         if (hBarRect.contains(localPoint)) {
             result.setScrollbar(m_hBar.get());
@@ -1156,9 +1176,9 @@
 
 IntRect RenderLayerScrollableArea::resizerCornerRect(const IntRect& bounds, ResizerHitTestType resizerHitTestType) const
 {
-    if (m_box.style()->resize() == RESIZE_NONE)
+    if (box().style()->resize() == RESIZE_NONE)
         return IntRect();
-    IntRect corner = cornerRect(m_box.style(), horizontalScrollbar(), verticalScrollbar(), bounds);
+    IntRect corner = cornerRect(box().style(), horizontalScrollbar(), verticalScrollbar(), bounds);
 
     if (resizerHitTestType == ResizerForTouch) {
         // We make the resizer virtually larger for touch hit testing. With the
@@ -1177,13 +1197,13 @@
 {
     IntRect scrollCornerAndResizer = scrollCornerRect();
     if (scrollCornerAndResizer.isEmpty())
-        scrollCornerAndResizer = resizerCornerRect(m_box.pixelSnappedBorderBoxRect(), ResizerForPointer);
+        scrollCornerAndResizer = resizerCornerRect(box().pixelSnappedBorderBoxRect(), ResizerForPointer);
     return scrollCornerAndResizer;
 }
 
 bool RenderLayerScrollableArea::overflowControlsIntersectRect(const IntRect& localRect) const
 {
-    const IntRect borderBox = m_box.pixelSnappedBorderBoxRect();
+    const IntRect borderBox = box().pixelSnappedBorderBoxRect();
 
     if (rectForHorizontalScrollbar(borderBox).intersects(localRect))
         return true;
@@ -1202,10 +1222,10 @@
 
 void RenderLayerScrollableArea::paintResizer(GraphicsContext* context, const IntPoint& paintOffset, const IntRect& damageRect)
 {
-    if (m_box.style()->resize() == RESIZE_NONE)
+    if (box().style()->resize() == RESIZE_NONE)
         return;
 
-    IntRect absRect = resizerCornerRect(m_box.pixelSnappedBorderBoxRect(), ResizerForPointer);
+    IntRect absRect = resizerCornerRect(box().pixelSnappedBorderBoxRect(), ResizerForPointer);
     absRect.moveBy(paintOffset);
     if (!absRect.intersects(damageRect))
         return;
@@ -1238,17 +1258,17 @@
 
 bool RenderLayerScrollableArea::isPointInResizeControl(const IntPoint& absolutePoint, ResizerHitTestType resizerHitTestType) const
 {
-    if (!m_box.canResize())
+    if (!box().canResize())
         return false;
 
-    IntPoint localPoint = roundedIntPoint(m_box.absoluteToLocal(absolutePoint, UseTransforms));
-    IntRect localBounds(0, 0, m_box.pixelSnappedWidth(), m_box.pixelSnappedHeight());
+    IntPoint localPoint = roundedIntPoint(box().absoluteToLocal(absolutePoint, UseTransforms));
+    IntRect localBounds(0, 0, box().pixelSnappedWidth(), box().pixelSnappedHeight());
     return resizerCornerRect(localBounds, resizerHitTestType).contains(localPoint);
 }
 
 bool RenderLayerScrollableArea::hitTestResizerInFragments(const LayerFragments& layerFragments, const HitTestLocation& hitTestLocation) const
 {
-    if (!m_box.canResize())
+    if (!box().canResize())
         return false;
 
     if (layerFragments.isEmpty())
@@ -1265,29 +1285,29 @@
 
 void RenderLayerScrollableArea::updateResizerAreaSet()
 {
-    LocalFrame* frame = m_box.frame();
+    LocalFrame* frame = box().frame();
     if (!frame)
         return;
     FrameView* frameView = frame->view();
     if (!frameView)
         return;
-    if (m_box.canResize())
-        frameView->addResizerArea(m_box);
+    if (box().canResize())
+        frameView->addResizerArea(box());
     else
-        frameView->removeResizerArea(m_box);
+        frameView->removeResizerArea(box());
 }
 
 void RenderLayerScrollableArea::updateResizerStyle()
 {
-    if (!m_resizer && !m_box.canResize())
+    if (!m_resizer && !box().canResize())
         return;
 
-    RenderObject* actualRenderer = rendererForScrollbar(m_box);
-    RefPtr<RenderStyle> resizer = m_box.hasOverflowClip() ? actualRenderer->getUncachedPseudoStyle(PseudoStyleRequest(RESIZER), actualRenderer->style()) : PassRefPtr<RenderStyle>(nullptr);
+    RenderObject* actualRenderer = rendererForScrollbar(box());
+    RefPtr<RenderStyle> resizer = box().hasOverflowClip() ? actualRenderer->getUncachedPseudoStyle(PseudoStyleRequest(RESIZER), actualRenderer->style()) : PassRefPtr<RenderStyle>(nullptr);
     if (resizer) {
         if (!m_resizer) {
-            m_resizer = RenderScrollbarPart::createAnonymous(&m_box.document());
-            m_resizer->setParent(&m_box);
+            m_resizer = RenderScrollbarPart::createAnonymous(&box().document());
+            m_resizer->setParent(&box());
         }
         m_resizer->setStyle(resizer.release());
     } else if (m_resizer) {
@@ -1298,7 +1318,7 @@
 
 void RenderLayerScrollableArea::drawPlatformResizerImage(GraphicsContext* context, IntRect resizerCornerRect)
 {
-    float deviceScaleFactor = WebCore::deviceScaleFactor(m_box.frame());
+    float deviceScaleFactor = WebCore::deviceScaleFactor(box().frame());
 
     RefPtr<Image> resizeCornerImage;
     IntSize cornerResizerSize;
@@ -1313,7 +1333,7 @@
         cornerResizerSize = resizeCornerImage->size();
     }
 
-    if (m_box.style()->shouldPlaceBlockDirectionScrollbarOnLogicalLeft()) {
+    if (box().style()->shouldPlaceBlockDirectionScrollbarOnLogicalLeft()) {
         context->save();
         context->translate(resizerCornerRect.x() + cornerResizerSize.width(), resizerCornerRect.y() + resizerCornerRect.height() - cornerResizerSize.height());
         context->scale(FloatSize(-1.0, 1.0));
@@ -1330,21 +1350,21 @@
     // Currently the resize corner is either the bottom right corner or the bottom left corner.
     // FIXME: This assumes the location is 0, 0. Is this guaranteed to always be the case?
     IntSize elementSize = layer()->size();
-    if (m_box.style()->shouldPlaceBlockDirectionScrollbarOnLogicalLeft())
+    if (box().style()->shouldPlaceBlockDirectionScrollbarOnLogicalLeft())
         elementSize.setWidth(0);
     IntPoint resizerPoint = IntPoint(elementSize);
-    IntPoint localPoint = roundedIntPoint(m_box.absoluteToLocal(absolutePoint, UseTransforms));
+    IntPoint localPoint = roundedIntPoint(box().absoluteToLocal(absolutePoint, UseTransforms));
     return localPoint - resizerPoint;
 }
 
 void RenderLayerScrollableArea::resize(const PlatformEvent& evt, const LayoutSize& oldOffset)
 {
     // FIXME: This should be possible on generated content but is not right now.
-    if (!inResizeMode() || !m_box.canResize() || !m_box.node())
+    if (!inResizeMode() || !box().canResize() || !box().node())
         return;
 
-    ASSERT(m_box.node()->isElementNode());
-    Element* element = toElement(m_box.node());
+    ASSERT(box().node()->isElementNode());
+    Element* element = toElement(box().node());
 
     Document& document = element->document();
 
@@ -1368,34 +1388,32 @@
         ASSERT_NOT_REACHED();
     }
 
-    float zoomFactor = m_box.style()->effectiveZoom();
+    float zoomFactor = box().style()->effectiveZoom();
 
     LayoutSize newOffset = offsetFromResizeCorner(document.view()->windowToContents(pos));
     newOffset.setWidth(newOffset.width() / zoomFactor);
     newOffset.setHeight(newOffset.height() / zoomFactor);
 
-    LayoutSize currentSize = LayoutSize(m_box.width() / zoomFactor, m_box.height() / zoomFactor);
-    LayoutSize minimumSize = element->minimumSizeForResizing().shrunkTo(currentSize);
-    element->setMinimumSizeForResizing(minimumSize);
+    LayoutSize currentSize = LayoutSize(box().width() / zoomFactor, box().height() / zoomFactor);
 
     LayoutSize adjustedOldOffset = LayoutSize(oldOffset.width() / zoomFactor, oldOffset.height() / zoomFactor);
-    if (m_box.style()->shouldPlaceBlockDirectionScrollbarOnLogicalLeft()) {
+    if (box().style()->shouldPlaceBlockDirectionScrollbarOnLogicalLeft()) {
         newOffset.setWidth(-newOffset.width());
         adjustedOldOffset.setWidth(-adjustedOldOffset.width());
     }
 
-    LayoutSize difference = (currentSize + newOffset - adjustedOldOffset).expandedTo(minimumSize) - currentSize;
+    LayoutSize difference = (currentSize + newOffset - adjustedOldOffset).expandedTo(minimumSizeForResizing()) - currentSize;
 
-    bool isBoxSizingBorder = m_box.style()->boxSizing() == BORDER_BOX;
+    bool isBoxSizingBorder = box().style()->boxSizing() == BORDER_BOX;
 
-    EResize resize = m_box.style()->resize();
+    EResize resize = box().style()->resize();
     if (resize != RESIZE_VERTICAL && difference.width()) {
         if (element->isFormControlElement()) {
             // Make implicit margins from the theme explicit (see <http://bugs.webkit.org/show_bug.cgi?id=9547>).
-            element->setInlineStyleProperty(CSSPropertyMarginLeft, m_box.marginLeft() / zoomFactor, CSSPrimitiveValue::CSS_PX);
-            element->setInlineStyleProperty(CSSPropertyMarginRight, m_box.marginRight() / zoomFactor, CSSPrimitiveValue::CSS_PX);
+            element->setInlineStyleProperty(CSSPropertyMarginLeft, box().marginLeft() / zoomFactor, CSSPrimitiveValue::CSS_PX);
+            element->setInlineStyleProperty(CSSPropertyMarginRight, box().marginRight() / zoomFactor, CSSPrimitiveValue::CSS_PX);
         }
-        LayoutUnit baseWidth = m_box.width() - (isBoxSizingBorder ? LayoutUnit() : m_box.borderAndPaddingWidth());
+        LayoutUnit baseWidth = box().width() - (isBoxSizingBorder ? LayoutUnit() : box().borderAndPaddingWidth());
         baseWidth = baseWidth / zoomFactor;
         element->setInlineStyleProperty(CSSPropertyWidth, roundToInt(baseWidth + difference.width()), CSSPrimitiveValue::CSS_PX);
     }
@@ -1403,10 +1421,10 @@
     if (resize != RESIZE_HORIZONTAL && difference.height()) {
         if (element->isFormControlElement()) {
             // Make implicit margins from the theme explicit (see <http://bugs.webkit.org/show_bug.cgi?id=9547>).
-            element->setInlineStyleProperty(CSSPropertyMarginTop, m_box.marginTop() / zoomFactor, CSSPrimitiveValue::CSS_PX);
-            element->setInlineStyleProperty(CSSPropertyMarginBottom, m_box.marginBottom() / zoomFactor, CSSPrimitiveValue::CSS_PX);
+            element->setInlineStyleProperty(CSSPropertyMarginTop, box().marginTop() / zoomFactor, CSSPrimitiveValue::CSS_PX);
+            element->setInlineStyleProperty(CSSPropertyMarginBottom, box().marginBottom() / zoomFactor, CSSPrimitiveValue::CSS_PX);
         }
-        LayoutUnit baseHeight = m_box.height() - (isBoxSizingBorder ? LayoutUnit() : m_box.borderAndPaddingHeight());
+        LayoutUnit baseHeight = box().height() - (isBoxSizingBorder ? LayoutUnit() : box().borderAndPaddingHeight());
         baseHeight = baseHeight / zoomFactor;
         element->setInlineStyleProperty(CSSPropertyHeight, roundToInt(baseHeight + difference.height()), CSSPrimitiveValue::CSS_PX);
     }
@@ -1418,8 +1436,8 @@
 
 LayoutRect RenderLayerScrollableArea::exposeRect(const LayoutRect& rect, const ScrollAlignment& alignX, const ScrollAlignment& alignY)
 {
-    LayoutRect localExposeRect(m_box.absoluteToLocalQuad(FloatQuad(FloatRect(rect)), UseTransforms).boundingBox());
-    LayoutRect layerBounds(0, 0, m_box.clientWidth(), m_box.clientHeight());
+    LayoutRect localExposeRect(box().absoluteToLocalQuad(FloatQuad(FloatRect(rect)), UseTransforms).boundingBox());
+    LayoutRect layerBounds(0, 0, box().clientWidth(), box().clientHeight());
     LayoutRect r = ScrollAlignment::getRectToExpose(layerBounds, localExposeRect, alignX, alignY);
 
     IntSize clampedScrollOffset = clampScrollOffset(adjustedScrollOffset() + toIntSize(roundedIntRect(r).location()));
@@ -1430,12 +1448,12 @@
     scrollToOffset(clampedScrollOffset);
     IntSize scrollOffsetDifference = adjustedScrollOffset() - oldScrollOffset;
     localExposeRect.move(-scrollOffsetDifference);
-    return LayoutRect(m_box.localToAbsoluteQuad(FloatQuad(FloatRect(localExposeRect)), UseTransforms).boundingBox());
+    return LayoutRect(box().localToAbsoluteQuad(FloatQuad(FloatRect(localExposeRect)), UseTransforms).boundingBox());
 }
 
 void RenderLayerScrollableArea::updateScrollableAreaSet(bool hasOverflow)
 {
-    LocalFrame* frame = m_box.frame();
+    LocalFrame* frame = box().frame();
     if (!frame)
         return;
 
@@ -1443,7 +1461,7 @@
     if (!frameView)
         return;
 
-    bool isVisibleToHitTest = m_box.visibleToHitTesting();
+    bool isVisibleToHitTest = box().visibleToHitTesting();
     if (HTMLFrameOwnerElement* owner = frame->ownerElement())
         isVisibleToHitTest &= owner->renderer() && owner->renderer()->visibleToHitTesting();
 
@@ -1462,7 +1480,7 @@
         // We always want composited scrolling if compositor driven accelerated
         // scrolling is enabled. Since we will not update needs composited scrolling
         // in this case, we must force our state to update.
-        RenderLayerCompositor* compositor = m_box.view()->compositor();
+        RenderLayerCompositor* compositor = box().view()->compositor();
         if (compositor->acceleratedCompositingForOverflowScrollEnabled())
             layer()->didUpdateNeedsCompositedScrolling();
         else if (m_scrollsOverflow)
@@ -1475,7 +1493,7 @@
 void RenderLayerScrollableArea::updateNeedsCompositedScrolling()
 {
     TRACE_EVENT0("comp-scroll", "RenderLayer::updateNeedsCompositedScrolling");
-    RenderLayerCompositor* compositor = m_box.view()->compositor();
+    RenderLayerCompositor* compositor = box().view()->compositor();
     bool needsToBeStackingContainerDidChange = false;
     bool needsCompositedScrolling = compositor->acceleratedCompositingForOverflowScrollEnabled();
     ASSERT(scrollsOverflow());
@@ -1499,27 +1517,28 @@
 
 void RenderLayerScrollableArea::updateCompositingLayersAfterScroll()
 {
-    RenderLayerCompositor* compositor = m_box.view()->compositor();
+    RenderLayerCompositor* compositor = box().view()->compositor();
     if (compositor->inCompositingMode()) {
-        // FIXME: Our stacking container is guaranteed to contain all of our descendants that may need
-        // repositioning, so we should be able to enqueue a partial update compositing layers from there.
-        // this feature was overridden for now by deferred compositing updates.
-        if (usesCompositedScrolling())
+        if (usesCompositedScrolling()) {
+            DisableCompositingQueryAsserts disabler;
+            ASSERT(box().hasCompositedLayerMapping());
+            box().compositedLayerMapping()->setNeedsGraphicsLayerUpdate();
             compositor->setNeedsCompositingUpdate(CompositingUpdateOnCompositedScroll);
-        else
+        } else {
             compositor->setNeedsCompositingUpdate(CompositingUpdateOnScroll);
+        }
     }
 }
 
 bool RenderLayerScrollableArea::usesCompositedScrolling() const
 {
     // Scroll form controls on the main thread so they exhibit correct touch scroll event bubbling
-    if (m_box.isIntristicallyScrollable(VerticalScrollbar) || m_box.isIntristicallyScrollable(HorizontalScrollbar))
+    if (box().isIntristicallyScrollable(VerticalScrollbar) || box().isIntristicallyScrollable(HorizontalScrollbar))
         return false;
 
     // See https://codereview.chromium.org/176633003/ for the tests that fail without this disabler.
     DisableCompositingQueryAsserts disabler;
-    return m_box.hasCompositedLayerMapping() && m_box.compositedLayerMapping()->scrollingLayer();
+    return box().hasCompositedLayerMapping() && box().compositedLayerMapping()->scrollingLayer();
 }
 
 bool RenderLayerScrollableArea::adjustForForceCompositedScrollingMode(bool value) const
diff --git a/Source/core/rendering/RenderLayerScrollableArea.h b/Source/core/rendering/RenderLayerScrollableArea.h
index d94a406..3bda1dd 100644
--- a/Source/core/rendering/RenderLayerScrollableArea.h
+++ b/Source/core/rendering/RenderLayerScrollableArea.h
@@ -68,7 +68,9 @@
     friend class Internals;
 
 public:
-    RenderLayerScrollableArea(RenderBox&);
+    // FIXME: We should pass in the RenderBox but this opens a window
+    // for crashers during RenderLayer setup (see crbug.com/368062).
+    RenderLayerScrollableArea(RenderLayer&);
     virtual ~RenderLayerScrollableArea();
 
     bool hasHorizontalScrollbar() const { return horizontalScrollbar(); }
@@ -210,6 +212,7 @@
     void setHasVerticalScrollbar(bool hasScrollbar);
 
     void updateScrollCornerStyle();
+    IntSize minimumSizeForResizing();
 
     // See comments on isPointInResizeControl.
     IntRect resizerCornerRect(const IntRect&, ResizerHitTestType) const;
@@ -218,6 +221,7 @@
     void updateResizerStyle();
     void drawPlatformResizerImage(GraphicsContext*, IntRect resizerCornerRect);
 
+    RenderBox& box() const;
     RenderLayer* layer() const;
 
     void updateScrollableAreaSet(bool hasOverflow);
@@ -228,7 +232,7 @@
 
     void setForceNeedsCompositedScrolling(ForceNeedsCompositedScrollingMode);
 
-    RenderBox& m_box;
+    RenderLayer& m_layer;
 
     // Keeps track of whether the layer is currently resizing, so events can cause resizing to start and stop.
     unsigned m_inResizeMode : 1;
diff --git a/Source/core/rendering/RenderListItem.cpp b/Source/core/rendering/RenderListItem.cpp
index c08a8bf..241c771 100644
--- a/Source/core/rendering/RenderListItem.cpp
+++ b/Source/core/rendering/RenderListItem.cpp
@@ -287,6 +287,10 @@
         }
 
         if (markerParent != lineBoxParent || m_marker->preferredLogicalWidthsDirty()) {
+            // FIXME: We should not modify the structure of the render tree
+            // during layout. crbug.com/370461
+            DeprecatedDisableModifyRenderTreeStructureAsserts disabler;
+
             // Removing and adding the marker can trigger repainting in
             // containers other than ourselves, so we need to disable LayoutState.
             LayoutStateDisabler layoutStateDisabler(*this);
diff --git a/Source/core/rendering/RenderMedia.h b/Source/core/rendering/RenderMedia.h
index b79c0ae..1e134e2 100644
--- a/Source/core/rendering/RenderMedia.h
+++ b/Source/core/rendering/RenderMedia.h
@@ -52,6 +52,8 @@
     virtual RenderObjectChildList* virtualChildren() OVERRIDE FINAL { return children(); }
     virtual const RenderObjectChildList* virtualChildren() const OVERRIDE FINAL { return children(); }
 
+    virtual LayerType layerTypeRequired() const OVERRIDE { return NormalLayer; }
+
     // FIXME: RenderMedia::layout makes assumptions about what children are allowed
     // so we can't support generated content.
     virtual bool canHaveGeneratedChildren() const OVERRIDE FINAL { return false; }
diff --git a/Source/core/rendering/RenderMenuList.cpp b/Source/core/rendering/RenderMenuList.cpp
index b86a698..21aa136 100644
--- a/Source/core/rendering/RenderMenuList.cpp
+++ b/Source/core/rendering/RenderMenuList.cpp
@@ -235,6 +235,9 @@
 {
     if (s.isEmpty()) {
         if (!m_buttonText || !m_buttonText->isBR()) {
+            // FIXME: We should not modify the structure of the render tree
+            // during layout. crbug.com/370462
+            DeprecatedDisableModifyRenderTreeStructureAsserts disabler;
             if (m_buttonText)
                 m_buttonText->destroy();
             m_buttonText = new RenderBR(&document());
@@ -245,6 +248,9 @@
         if (m_buttonText && !m_buttonText->isBR())
             m_buttonText->setText(s.impl(), true);
         else {
+            // FIXME: We should not modify the structure of the render tree
+            // during layout. crbug.com/370462
+            DeprecatedDisableModifyRenderTreeStructureAsserts disabler;
             if (m_buttonText)
                 m_buttonText->destroy();
             m_buttonText = new RenderText(&document(), s.impl());
diff --git a/Source/core/rendering/RenderMultiColumnFlowThread.cpp b/Source/core/rendering/RenderMultiColumnFlowThread.cpp
index e93c68a..070b2f3 100644
--- a/Source/core/rendering/RenderMultiColumnFlowThread.cpp
+++ b/Source/core/rendering/RenderMultiColumnFlowThread.cpp
@@ -35,7 +35,7 @@
     , m_columnWidth(0)
     , m_columnHeightAvailable(0)
     , m_inBalancingPass(false)
-    , m_needsRebalancing(false)
+    , m_needsColumnHeightsRecalculation(false)
 {
     setFlowThreadState(InsideInFlowThread);
 }
@@ -166,7 +166,7 @@
         // are actually required to guarantee this. The calculation of implicit breaks needs to be
         // preceded by a proper layout pass, since it's layout that sets up content runs, and the
         // runs get deleted right after every pass.
-        m_needsRebalancing = shouldInvalidateRegions || needsLayout();
+        m_needsColumnHeightsRecalculation = shouldInvalidateRegions || needsLayout();
     }
 
     layoutIfNeeded();
@@ -205,7 +205,7 @@
 
 bool RenderMultiColumnFlowThread::recalculateColumnHeights()
 {
-    if (!m_needsRebalancing)
+    if (!m_needsColumnHeightsRecalculation)
         return false;
 
     // Column heights may change here because of balancing. We may have to do multiple layout
@@ -215,7 +215,7 @@
     // columns, unless we have a bug.
     bool needsRelayout = false;
     for (RenderMultiColumnSet* multicolSet = firstMultiColumnSet(); multicolSet; multicolSet = multicolSet->nextSiblingMultiColumnSet()) {
-        if (multicolSet->recalculateBalancedHeight(!m_inBalancingPass)) {
+        if (multicolSet->recalculateColumnHeight(!m_inBalancingPass)) {
             multicolSet->setChildNeedsLayout(MarkOnlyThis);
             needsRelayout = true;
         }
@@ -264,9 +264,16 @@
     computedValues.m_position = logicalTop;
 }
 
-LayoutUnit RenderMultiColumnFlowThread::initialLogicalWidth() const
+void RenderMultiColumnFlowThread::updateLogicalWidth()
 {
-    return columnWidth();
+    setLogicalWidth(columnWidth());
+}
+
+void RenderMultiColumnFlowThread::layout()
+{
+    RenderFlowThread::layout();
+    if (RenderMultiColumnSet* lastSet = lastMultiColumnSet())
+        lastSet->expandToEncompassFlowThreadContentsIfNeeded();
 }
 
 void RenderMultiColumnFlowThread::setPageBreak(LayoutUnit offset, LayoutUnit spaceShortage)
diff --git a/Source/core/rendering/RenderMultiColumnFlowThread.h b/Source/core/rendering/RenderMultiColumnFlowThread.h
index 3d668dc..a341db8 100644
--- a/Source/core/rendering/RenderMultiColumnFlowThread.h
+++ b/Source/core/rendering/RenderMultiColumnFlowThread.h
@@ -93,7 +93,8 @@
     virtual void addRegionToThread(RenderRegion*) OVERRIDE;
     virtual void willBeRemovedFromTree() OVERRIDE;
     virtual void computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logicalTop, LogicalExtentComputedValues&) const OVERRIDE;
-    virtual LayoutUnit initialLogicalWidth() const OVERRIDE;
+    virtual void updateLogicalWidth() OVERRIDE FINAL;
+    virtual void layout() OVERRIDE FINAL;
     virtual void setPageBreak(LayoutUnit offset, LayoutUnit spaceShortage) OVERRIDE;
     virtual void updateMinimumPageHeight(LayoutUnit offset, LayoutUnit minHeight) OVERRIDE;
     virtual RenderRegion* regionAtBlockOffset(LayoutUnit) const OVERRIDE;
@@ -104,7 +105,7 @@
     LayoutUnit m_columnWidth; // The used value of column-width
     LayoutUnit m_columnHeightAvailable; // Total height available to columns, or 0 if auto.
     bool m_inBalancingPass; // Set when relayouting for column balancing.
-    bool m_needsRebalancing;
+    bool m_needsColumnHeightsRecalculation; // Set when we need to recalculate the column set heights after layout.
 };
 
 } // namespace WebCore
diff --git a/Source/core/rendering/RenderMultiColumnSet.cpp b/Source/core/rendering/RenderMultiColumnSet.cpp
index 0171112..24dffef 100644
--- a/Source/core/rendering/RenderMultiColumnSet.cpp
+++ b/Source/core/rendering/RenderMultiColumnSet.cpp
@@ -35,7 +35,7 @@
 namespace WebCore {
 
 RenderMultiColumnSet::RenderMultiColumnSet(RenderFlowThread* flowThread)
-    : RenderRegionSet(0, flowThread)
+    : RenderRegion(0, flowThread)
     , m_computedColumnCount(1)
     , m_computedColumnWidth(0)
     , m_computedColumnHeight(0)
@@ -118,17 +118,16 @@
 
 void RenderMultiColumnSet::distributeImplicitBreaks()
 {
-    unsigned breakCount = forcedBreaksCount();
-
 #ifndef NDEBUG
     // There should be no implicit breaks assumed at this point.
-    for (unsigned i = 0; i < breakCount; i++)
+    for (unsigned i = 0; i < forcedBreaksCount(); i++)
         ASSERT(!m_contentRuns[i].assumedImplicitBreaks());
 #endif // NDEBUG
 
-    // There will always be at least one break, since the flow thread reports a "forced break" at
-    // end of content.
-    ASSERT(breakCount >= 1);
+    // Insert a final content run to encompass all content. This will include overflow if this is
+    // the last set.
+    addForcedBreak(logicalBottomInFlowThread());
+    unsigned breakCount = forcedBreaksCount();
 
     // If there is room for more breaks (to reach the used value of column-count), imagine that we
     // insert implicit breaks at suitable locations. At any given time, the content run with the
@@ -143,7 +142,7 @@
     }
 }
 
-LayoutUnit RenderMultiColumnSet::calculateBalancedHeight(bool initial) const
+LayoutUnit RenderMultiColumnSet::calculateColumnHeight(bool initial) const
 {
     if (initial) {
         // Start with the lowest imaginable column height.
@@ -191,14 +190,14 @@
         m_contentRuns.append(ContentRun(offsetFromFirstPage));
 }
 
-bool RenderMultiColumnSet::recalculateBalancedHeight(bool initial)
+bool RenderMultiColumnSet::recalculateColumnHeight(bool initial)
 {
     ASSERT(multiColumnFlowThread()->requiresBalancing());
 
     LayoutUnit oldColumnHeight = m_computedColumnHeight;
     if (initial)
         distributeImplicitBreaks();
-    LayoutUnit newColumnHeight = calculateBalancedHeight(initial);
+    LayoutUnit newColumnHeight = calculateColumnHeight(initial);
     setAndConstrainColumnHeight(newColumnHeight);
 
     // After having calculated an initial column height, the multicol container typically needs at
@@ -286,6 +285,23 @@
     m_minimumColumnHeight = 0;
 }
 
+void RenderMultiColumnSet::expandToEncompassFlowThreadContentsIfNeeded()
+{
+    ASSERT(multiColumnFlowThread()->lastMultiColumnSet() == this);
+    LayoutRect rect(flowThreadPortionRect());
+
+    // Get the offset within the flow thread in its block progression direction. Then get the
+    // flow thread's remaining logical height including its overflow and expand our rect
+    // to encompass that remaining height and overflow. The idea is that we will generate
+    // additional columns and pages to hold that overflow, since people do write bad
+    // content like <body style="height:0px"> in multi-column layouts.
+    bool isHorizontal = flowThread()->isHorizontalWritingMode();
+    LayoutUnit logicalTopOffset = isHorizontal ? rect.y() : rect.x();
+    LayoutRect layoutRect = flowThread()->layoutOverflowRect();
+    LayoutUnit logicalHeightWithOverflow = (isHorizontal ? layoutRect.maxY() : layoutRect.maxX()) - logicalTopOffset;
+    setFlowThreadPortionRect(LayoutRect(rect.x(), rect.y(), isHorizontal ? rect.width() : logicalHeightWithOverflow, isHorizontal ? logicalHeightWithOverflow : rect.height()));
+}
+
 void RenderMultiColumnSet::computeLogicalHeight(LayoutUnit, LayoutUnit logicalTop, LogicalExtentComputedValues& computedValues) const
 {
     computedValues.m_extent = m_computedColumnHeight;
diff --git a/Source/core/rendering/RenderMultiColumnSet.h b/Source/core/rendering/RenderMultiColumnSet.h
index 57b09aa..e7079dc 100644
--- a/Source/core/rendering/RenderMultiColumnSet.h
+++ b/Source/core/rendering/RenderMultiColumnSet.h
@@ -28,7 +28,7 @@
 #define RenderMultiColumnSet_h
 
 #include "core/rendering/RenderMultiColumnFlowThread.h"
-#include "core/rendering/RenderRegionSet.h"
+#include "core/rendering/RenderRegion.h"
 #include "wtf/Vector.h"
 
 namespace WebCore {
@@ -50,7 +50,7 @@
 //
 // Column spans result in the creation of new column sets, since a spanning renderer has to be
 // placed in between the column sets that come before and after the span.
-class RenderMultiColumnSet FINAL : public RenderRegionSet {
+class RenderMultiColumnSet FINAL : public RenderRegion {
 public:
     static RenderMultiColumnSet* createAnonymous(RenderFlowThread*, RenderStyle* parentStyle);
 
@@ -65,6 +65,8 @@
 
     RenderMultiColumnSet* nextSiblingMultiColumnSet() const;
 
+    LayoutUnit logicalBottomInFlowThread() const { return isHorizontalWritingMode() ? flowThreadPortionRect().maxY() : flowThreadPortionRect().maxX(); }
+
     unsigned computedColumnCount() const { return m_computedColumnCount; }
     LayoutUnit computedColumnWidth() const { return m_computedColumnWidth; }
     LayoutUnit computedColumnHeight() const { return m_computedColumnHeight; }
@@ -88,10 +90,10 @@
     void clearForcedBreaks();
     void addForcedBreak(LayoutUnit offsetFromFirstPage);
 
-    // (Re-)calculate the column height when contents are supposed to be balanced. If 'initial' is
-    // set, guess an initial column height; otherwise, stretch the column height a tad. Return true
-    // if column height changed and another layout pass is required.
-    bool recalculateBalancedHeight(bool initial);
+    // (Re-)calculate the column height if it's auto. If 'initial' is set, guess an initial column
+    // height; otherwise, stretch the column height a tad. Return true if column height changed and
+    // another layout pass is required.
+    bool recalculateColumnHeight(bool initial);
 
     // Record space shortage (the amount of space that would have been enough to prevent some
     // element from being moved to the next column) at a column break. The smallest amount of space
@@ -103,6 +105,10 @@
 
     void prepareForLayout();
 
+    // Expand this set's flow thread portion rectangle to contain all trailing flow thread
+    // overflow. Only to be called on the last set.
+    void expandToEncompassFlowThreadContentsIfNeeded();
+
 private:
     RenderMultiColumnSet(RenderFlowThread*);
 
@@ -150,7 +156,7 @@
     // and store the results. This is needed in order to balance the columns.
     void distributeImplicitBreaks();
 
-    LayoutUnit calculateBalancedHeight(bool initial) const;
+    LayoutUnit calculateColumnHeight(bool initial) const;
 
     unsigned m_computedColumnCount; // Used column count (the resulting 'N' from the pseudo-algorithm in the multicol spec)
     LayoutUnit m_computedColumnWidth; // Used column width (the resulting 'W' from the pseudo-algorithm in the multicol spec)
diff --git a/Source/core/rendering/RenderObject.cpp b/Source/core/rendering/RenderObject.cpp
index 920e80e..5c5b178 100644
--- a/Source/core/rendering/RenderObject.cpp
+++ b/Source/core/rendering/RenderObject.cpp
@@ -33,6 +33,7 @@
 #include "core/animation/ActiveAnimations.h"
 #include "core/css/resolver/StyleResolver.h"
 #include "core/dom/ElementTraversal.h"
+#include "core/dom/shadow/ShadowRoot.h"
 #include "core/editing/EditingBoundary.h"
 #include "core/editing/FrameSelection.h"
 #include "core/editing/htmlediting.h"
@@ -95,6 +96,12 @@
 
 namespace WebCore {
 
+namespace {
+
+static bool gModifyRenderTreeStructureAnyState = false;
+
+} // namespace
+
 using namespace HTMLNames;
 
 #ifndef NDEBUG
@@ -121,6 +128,7 @@
     unsigned m_bitfields;
     unsigned m_bitfields2;
     LayoutRect rect; // Stores the previous repaint rect.
+    LayoutPoint position; // Stores the previous position from the repaint container.
 };
 
 COMPILE_ASSERT(sizeof(RenderObject) == sizeof(SameSizeAsRenderObject), RenderObject_should_stay_small);
@@ -141,6 +149,8 @@
 
 RenderObject* RenderObject::createObject(Element* element, RenderStyle* style)
 {
+    ASSERT(isAllowedToModifyRenderTreeStructure(element->document()));
+
     // Minimal support for content properties replacing an entire element.
     // Works only if we have exactly one piece of content and it's a URL.
     // Otherwise acts as if we didn't support this feature.
@@ -294,6 +304,8 @@
 
 void RenderObject::addChild(RenderObject* newChild, RenderObject* beforeChild)
 {
+    ASSERT(isAllowedToModifyRenderTreeStructure(document()));
+
     RenderObjectChildList* children = virtualChildren();
     ASSERT(children);
     if (!children)
@@ -332,6 +344,8 @@
 
 void RenderObject::removeChild(RenderObject* oldChild)
 {
+    ASSERT(isAllowedToModifyRenderTreeStructure(document()));
+
     RenderObjectChildList* children = virtualChildren();
     ASSERT(children);
     if (!children)
@@ -736,15 +750,6 @@
     }
 }
 
-void RenderObject::setLayerNeedsFullRepaint()
-{
-    ASSERT(hasLayer());
-    if (RuntimeEnabledFeatures::repaintAfterLayoutEnabled())
-        setShouldDoFullRepaintAfterLayout(true);
-    else
-        toRenderLayerModelObject(this)->layer()->repainter().setRepaintStatus(NeedsFullRepaint);
-}
-
 void RenderObject::setLayerNeedsFullRepaintForPositionedMovementLayout()
 {
     ASSERT(hasLayer());
@@ -1244,6 +1249,18 @@
         graphicsContext->endLayer();
 }
 
+// FIXME: In repaint-after-layout, we should be able to change the logic to remove the need for this function. See crbug.com/368416.
+LayoutPoint RenderObject::positionFromRepaintContainer(const RenderLayerModelObject* repaintContainer) const
+{
+    ASSERT(containerForRepaint() == repaintContainer);
+
+    LayoutPoint offset = isBox() ? toRenderBox(this)->location() : LayoutPoint();
+    if (repaintContainer == this)
+        return offset;
+
+    return roundedIntPoint(localToContainerPoint(offset, repaintContainer));
+}
+
 IntRect RenderObject::absoluteBoundingBoxRect() const
 {
     Vector<FloatQuad> quads;
@@ -1330,12 +1347,12 @@
 {
 }
 
-RenderLayerModelObject* RenderObject::containerForRepaint() const
+const RenderLayerModelObject* RenderObject::containerForRepaint() const
 {
     if (!isRooted())
         return 0;
 
-    RenderLayerModelObject* repaintContainer = 0;
+    const RenderLayerModelObject* repaintContainer = 0;
 
     RenderView* renderView = view();
     if (renderView->usesCompositing()) {
@@ -1444,7 +1461,7 @@
     // FIXME: really, we're in the repaint phase here, and the following queries are legal.
     // Until those states are fully fledged, I'll just disable the ASSERTS.
     DisableCompositingQueryAsserts disabler;
-    RenderLayerModelObject* repaintContainer = containerForRepaint();
+    const RenderLayerModelObject* repaintContainer = containerForRepaint();
     repaintUsingContainer(repaintContainer, pixelSnappedIntRect(clippedOverflowRectForRepaint(repaintContainer)), InvalidationRepaint);
 }
 
@@ -1464,7 +1481,7 @@
         dirtyRect.move(view()->layoutDelta());
     }
 
-    RenderLayerModelObject* repaintContainer = containerForRepaint();
+    const RenderLayerModelObject* repaintContainer = containerForRepaint();
     computeRectForRepaint(repaintContainer, dirtyRect);
     repaintUsingContainer(repaintContainer, pixelSnappedIntRect(dirtyRect), InvalidationRepaintRectangle);
 }
@@ -1489,6 +1506,8 @@
         return "bounds change with background";
     case InvalidationBoundsChange:
         return "bounds change";
+    case InvalidationLocationChange:
+        return "location change";
     case InvalidationScroll:
         return "scroll";
     case InvalidationSelection:
@@ -1506,6 +1525,11 @@
 
 void RenderObject::repaintTreeAfterLayout()
 {
+    // If we didn't need invalidation then our children don't need as well.
+    // Skip walking down the tree as everything should be fine below us.
+    if (!shouldCheckForInvalidationAfterLayout())
+        return;
+
     clearRepaintState();
 
     for (RenderObject* child = firstChild(); child; child = child->nextSibling()) {
@@ -1524,7 +1548,7 @@
 }
 
 bool RenderObject::repaintAfterLayoutIfNeeded(const RenderLayerModelObject* repaintContainer, bool wasSelfLayout,
-    const LayoutRect& oldBounds, const LayoutRect* newBoundsPtr)
+    const LayoutRect& oldBounds, const LayoutPoint& oldLocation, const LayoutRect* newBoundsPtr, const LayoutPoint* newLocationPtr)
 {
     RenderView* v = view();
     if (v->document().printing())
@@ -1533,6 +1557,7 @@
     // This ASSERT fails due to animations.  See https://bugs.webkit.org/show_bug.cgi?id=37048
     // ASSERT(!newBoundsPtr || *newBoundsPtr == clippedOverflowRectForRepaint(repaintContainer));
     LayoutRect newBounds = newBoundsPtr ? *newBoundsPtr : clippedOverflowRectForRepaint(repaintContainer);
+    LayoutPoint newLocation = newLocationPtr ? *newLocationPtr : positionFromRepaintContainer(repaintContainer);
 
     // FIXME: This should use a ConvertableToTraceFormat when they are available in Blink.
     TRACE_EVENT2(TRACE_DISABLED_BY_DEFAULT("blink.invalidation"), "RenderObject::repaintAfterLayoutIfNeeded()",
@@ -1554,6 +1579,9 @@
             invalidationReason = InvalidationBorderRadius;
     }
 
+    if (invalidationReason == InvalidationIncremental && compositingState() != PaintsIntoOwnBacking && newLocation != oldLocation)
+        invalidationReason = InvalidationLocationChange;
+
     // If the bounds are the same then we know that none of the statements below
     // can match, so we can early out since we will not need to do any
     // invalidation.
@@ -1674,10 +1702,7 @@
 
 bool RenderObject::checkForRepaint() const
 {
-    if (RuntimeEnabledFeatures::repaintAfterLayoutEnabled())
-        return !document().view()->needsFullRepaint() && everHadLayout();
-
-    return !document().view()->needsFullRepaint() && !hasLayer() && everHadLayout();
+    return !document().view()->needsFullRepaint() && everHadLayout();
 }
 
 bool RenderObject::checkForRepaintDuringLayout() const
@@ -3022,9 +3047,12 @@
     if (!node())
         return nullptr;
 
-    if (Element* shadowHost = node()->shadowHost()) {
-        if (shadowHost->isFormControlElement())
-            return shadowHost->renderer()->getUncachedPseudoStyle(PseudoStyleRequest(SELECTION));
+    if (ShadowRoot* root = node()->containingShadowRoot()) {
+        if (root->type() == ShadowRoot::UserAgentShadowRoot) {
+            if (Element* shadowHost = node()->shadowHost()) {
+                return shadowHost->renderer()->getUncachedPseudoStyle(PseudoStyleRequest(SELECTION));
+            }
+        }
     }
 
     return getUncachedPseudoStyle(PseudoStyleRequest(SELECTION));
@@ -3389,8 +3417,26 @@
 {
     setShouldDoFullRepaintAfterLayout(false);
     setShouldDoFullRepaintIfSelfPaintingLayer(false);
+    setOnlyNeededPositionedMovementLayout(false);
     setShouldRepaintOverflow(false);
     setLayoutDidGetCalled(false);
+    setMayNeedInvalidation(false);
+}
+
+bool RenderObject::isAllowedToModifyRenderTreeStructure(Document& document)
+{
+    return DeprecatedDisableModifyRenderTreeStructureAsserts::canModifyRenderTreeStateInAnyState()
+        || document.lifecycle().stateAllowsRenderTreeMutations();
+}
+
+DeprecatedDisableModifyRenderTreeStructureAsserts::DeprecatedDisableModifyRenderTreeStructureAsserts()
+    : m_disabler(gModifyRenderTreeStructureAnyState, true)
+{
+}
+
+bool DeprecatedDisableModifyRenderTreeStructureAsserts::canModifyRenderTreeStateInAnyState()
+{
+    return gModifyRenderTreeStructureAnyState;
 }
 
 } // namespace WebCore
diff --git a/Source/core/rendering/RenderObject.h b/Source/core/rendering/RenderObject.h
index 027e923..708a0ec 100644
--- a/Source/core/rendering/RenderObject.h
+++ b/Source/core/rendering/RenderObject.h
@@ -120,6 +120,7 @@
     InvalidationBorderRadius,
     InvalidationBoundsChangeWithBackground,
     InvalidationBoundsChange,
+    InvalidationLocationChange,
     InvalidationScroll,
     InvalidationSelection,
     InvalidationLayer,
@@ -301,7 +302,6 @@
 #endif
 
     void addAbsoluteRectForLayer(LayoutRect& result);
-    void setLayerNeedsFullRepaint();
     void setLayerNeedsFullRepaintForPositionedMovementLayout();
     bool requiresAnonymousTableWrappers(const RenderObject*) const;
 
@@ -759,6 +759,8 @@
 
     virtual void absoluteRects(Vector<IntRect>&, const LayoutPoint&) const { }
 
+    LayoutPoint positionFromRepaintContainer(const RenderLayerModelObject* repaintContainer) const;
+
     IntRect absoluteBoundingBoxRect() const;
     // FIXME: This function should go away eventually
     IntRect absoluteBoundingBoxRectIgnoringTransforms() const;
@@ -811,7 +813,7 @@
     // Return the RenderLayerModelObject in the container chain which is responsible for painting this object, or 0
     // if painting is root-relative. This is the container that should be passed to the 'forRepaint'
     // methods.
-    RenderLayerModelObject* containerForRepaint() const;
+    const RenderLayerModelObject* containerForRepaint() const;
 
     // Actually do the repaint of rect r for this object which has been computed in the coordinate space
     // of repaintContainer. If repaintContainer is 0, repaint via the view.
@@ -826,7 +828,7 @@
 
     // Repaint only if our old bounds and new bounds are different. The caller may pass in newBounds if they are known.
     bool repaintAfterLayoutIfNeeded(const RenderLayerModelObject* repaintContainer, bool wasSelfLayout,
-        const LayoutRect& oldBounds, const LayoutRect* newBoundsPtr = 0);
+        const LayoutRect& oldBounds, const LayoutPoint& oldPositionFromRepaintContainer, const LayoutRect* newBoundsPtr = 0, const LayoutPoint* newPositionFromRepaintContainer = 0);
 
     // Walk the tree after layout repainting renderers that have changed or moved, updating bounds that have changed, and clearing repaint state.
     virtual void repaintTreeAfterLayout();
@@ -982,6 +984,9 @@
     const LayoutRect& previousRepaintRect() const { return m_previousRepaintRect; }
     void setPreviousRepaintRect(const LayoutRect& rect) { m_previousRepaintRect = rect; }
 
+    const LayoutPoint& previousPositionFromRepaintContainer() const { return m_previousPositionFromRepaintContainer; }
+    void setPreviousPositionFromRepaintContainer(const LayoutPoint& location) { m_previousPositionFromRepaintContainer = location; }
+
     LayoutRect newOutlineRect();
     void setNewOutlineRect(const LayoutRect&);
 
@@ -1005,6 +1010,21 @@
     bool layoutDidGetCalled() { return m_bitfields.layoutDidGetCalled(); }
     void setLayoutDidGetCalled(bool b) { m_bitfields.setLayoutDidGetCalled(b); }
 
+    bool mayNeedInvalidation() { return m_bitfields.mayNeedInvalidation(); }
+    void setMayNeedInvalidation(bool b)
+    {
+        m_bitfields.setMayNeedInvalidation(b);
+
+        // Make sure our parent is marked as needing invalidation.
+        if (b && parent() && !parent()->mayNeedInvalidation())
+            parent()->setMayNeedInvalidation(b);
+    }
+
+    bool shouldCheckForInvalidationAfterLayout()
+    {
+        return layoutDidGetCalled() || mayNeedInvalidation();
+    }
+
     bool shouldDisableLayoutState() const { return hasColumns() || hasTransform() || hasReflection() || style()->isFlippedBlocksWritingMode(); }
 
     void setNeedsOverflowRecalcAfterStyleChange();
@@ -1082,6 +1102,8 @@
 #endif
     const char* invalidationReasonToString(InvalidationReason) const;
 
+    static bool isAllowedToModifyRenderTreeStructure(Document&);
+
     RefPtr<RenderStyle> m_style;
 
     Node* m_node;
@@ -1120,6 +1142,9 @@
             , m_shouldDoFullRepaintAfterLayout(false)
             , m_shouldRepaintOverflow(false)
             , m_shouldDoFullRepaintIfSelfPaintingLayer(false)
+            // FIXME: We should remove mayNeedInvalidation once we are able to
+            // use the other layout flags to detect the same cases. crbug.com/370118
+            , m_mayNeedInvalidation(false)
             , m_onlyNeededPositionedMovementLayout(false)
             , m_needsPositionedMovementLayout(false)
             , m_normalChildNeedsLayout(false)
@@ -1154,11 +1179,12 @@
         {
         }
 
-        // 32 bits have been used in the first word, and 5 in the second.
+        // 32 bits have been used in the first word, and 6 in the second.
         ADD_BOOLEAN_BITFIELD(selfNeedsLayout, SelfNeedsLayout);
         ADD_BOOLEAN_BITFIELD(shouldDoFullRepaintAfterLayout, ShouldDoFullRepaintAfterLayout);
         ADD_BOOLEAN_BITFIELD(shouldRepaintOverflow, ShouldRepaintOverflow);
         ADD_BOOLEAN_BITFIELD(shouldDoFullRepaintIfSelfPaintingLayer, ShouldDoFullRepaintIfSelfPaintingLayer);
+        ADD_BOOLEAN_BITFIELD(mayNeedInvalidation, MayNeedInvalidation);
         ADD_BOOLEAN_BITFIELD(onlyNeededPositionedMovementLayout, OnlyNeededPositionedMovementLayout);
         ADD_BOOLEAN_BITFIELD(needsPositionedMovementLayout, NeedsPositionedMovementLayout);
         ADD_BOOLEAN_BITFIELD(normalChildNeedsLayout, NormalChildNeedsLayout);
@@ -1245,6 +1271,22 @@
 
     // This stores the repaint rect from the previous layout.
     LayoutRect m_previousRepaintRect;
+
+    // This stores the position in the repaint container's coordinate.
+    // It is used to detect renderer shifts that forces a full invalidation.
+    LayoutPoint m_previousPositionFromRepaintContainer;
+};
+
+// FIXME: remove this once the render object lifecycle ASSERTS are no longer hit.
+class DeprecatedDisableModifyRenderTreeStructureAsserts {
+    WTF_MAKE_NONCOPYABLE(DeprecatedDisableModifyRenderTreeStructureAsserts);
+public:
+    DeprecatedDisableModifyRenderTreeStructureAsserts();
+
+    static bool canModifyRenderTreeStateInAnyState();
+
+private:
+    TemporaryChange<bool> m_disabler;
 };
 
 // Allow equality comparisons of RenderObject's by reference or pointer, interchangeably.
@@ -1293,8 +1335,6 @@
     if (!alreadyNeededLayout) {
         if (markParents == MarkContainingBlockChain && (!layouter || layouter->root() != this))
             markContainingBlocksForLayout(true, 0, layouter);
-        if (hasLayer())
-            setLayerNeedsFullRepaint();
     }
 }
 
diff --git a/Source/core/rendering/RenderRegion.h b/Source/core/rendering/RenderRegion.h
index 66f3985..c25cebb 100644
--- a/Source/core/rendering/RenderRegion.h
+++ b/Source/core/rendering/RenderRegion.h
@@ -62,9 +62,9 @@
     bool isFirstRegion() const;
     bool isLastRegion() const;
 
-    // These methods represent the width and height of a "page" and for a RenderRegion they are just the
-    // content width and content height of a region. For RenderRegionSets, however, they will be the width and
-    // height of a single column or page in the set.
+    // These methods represent the width and height of a "page" and for a RenderRegion they are just
+    // the content width and content height of a region. For RenderMultiColumnSets, however, they
+    // will be the width and height of a single column or page in the set.
     virtual LayoutUnit pageLogicalWidth() const;
     virtual LayoutUnit pageLogicalHeight() const;
 
@@ -83,8 +83,6 @@
     // page.
     virtual LayoutUnit pageLogicalTopForOffset(LayoutUnit offset) const;
 
-    virtual void expandToEncompassFlowThreadContentsIfNeeded() { };
-
     virtual void repaintFlowThreadContent(const LayoutRect& repaintRect) const;
 
     virtual void collectLayerFragments(LayerFragments&, const LayoutRect&, const LayoutRect&) { }
diff --git a/Source/core/rendering/RenderRegionSet.cpp b/Source/core/rendering/RenderRegionSet.cpp
deleted file mode 100644
index 9aaf5ed..0000000
--- a/Source/core/rendering/RenderRegionSet.cpp
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (C) 2012 Apple Inc.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "core/rendering/RenderRegionSet.h"
-
-#include "core/rendering/RenderFlowThread.h"
-
-namespace WebCore {
-
-RenderRegionSet::RenderRegionSet(Element* element, RenderFlowThread* flowThread)
-    : RenderRegion(element, flowThread)
-{
-}
-
-void RenderRegionSet::expandToEncompassFlowThreadContentsIfNeeded()
-{
-    // Whenever the last region is a set, it always expands its region rect to consume all
-    // of the flow thread content. This is because it is always capable of generating an
-    // infinite number of boxes in order to hold all of the remaining content.
-    LayoutRect rect(flowThreadPortionRect());
-
-    // Get the offset within the flow thread in its block progression direction. Then get the
-    // flow thread's remaining logical height including its overflow and expand our rect
-    // to encompass that remaining height and overflow. The idea is that we will generate
-    // additional columns and pages to hold that overflow, since people do write bad
-    // content like <body style="height:0px"> in multi-column layouts.
-    bool isHorizontal = flowThread()->isHorizontalWritingMode();
-    LayoutUnit logicalTopOffset = isHorizontal ? rect.y() : rect.x();
-    LayoutRect layoutRect = flowThread()->layoutOverflowRect();
-    LayoutUnit logicalHeightWithOverflow = (isHorizontal ? layoutRect.maxY() : layoutRect.maxX()) - logicalTopOffset;
-    setFlowThreadPortionRect(LayoutRect(rect.x(), rect.y(), isHorizontal ? rect.width() : logicalHeightWithOverflow, isHorizontal ? logicalHeightWithOverflow : rect.height()));
-}
-
-}
diff --git a/Source/core/rendering/RenderRegionSet.h b/Source/core/rendering/RenderRegionSet.h
deleted file mode 100644
index fc2151b..0000000
--- a/Source/core/rendering/RenderRegionSet.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (C) 2012 Apple Inc.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-
-#ifndef RenderRegionSet_h
-#define RenderRegionSet_h
-
-#include "core/rendering/RenderRegion.h"
-
-namespace WebCore {
-
-class RenderFlowThread;
-
-// RenderRegionSet represents a set of regions that all have the same width and height. It is a "composite region box" that
-// can be used to represent a single run of contiguous regions.
-//
-// By combining runs of same-size columns or pages into a single object, we significantly reduce the number of unique RenderObjects
-// required to represent those objects.
-//
-// This class is abstract and is only intended for use by renderers that generate anonymous runs of identical regions, i.e.,
-// columns and printing. RenderMultiColumnSet and RenderPageSet represent runs of columns and pages respectively.
-//
-// FIXME: For now we derive from RenderRegion, but this may change at some point.
-
-class RenderRegionSet : public RenderRegion {
-public:
-    RenderRegionSet(Element*, RenderFlowThread*);
-
-private:
-    virtual void expandToEncompassFlowThreadContentsIfNeeded() OVERRIDE FINAL;
-
-    virtual const char* renderName() const = 0;
-};
-
-} // namespace WebCore
-
-#endif // RenderRegionSet_h
-
diff --git a/Source/core/rendering/RenderSelectionInfo.h b/Source/core/rendering/RenderSelectionInfo.h
index b5a1bad..da73ebe 100644
--- a/Source/core/rendering/RenderSelectionInfo.h
+++ b/Source/core/rendering/RenderSelectionInfo.h
@@ -48,12 +48,12 @@
     }
 
     RenderObject* object() const { return m_object; }
-    RenderLayerModelObject* repaintContainer() const { return m_repaintContainer; }
+    const RenderLayerModelObject* repaintContainer() const { return m_repaintContainer; }
     RenderObject::SelectionState state() const { return m_state; }
 
 protected:
     RenderObject* m_object;
-    RenderLayerModelObject* m_repaintContainer;
+    const RenderLayerModelObject* m_repaintContainer;
     RenderObject::SelectionState m_state;
 };
 
diff --git a/Source/core/rendering/RenderTable.cpp b/Source/core/rendering/RenderTable.cpp
index b1dfd7e..cb7d532 100644
--- a/Source/core/rendering/RenderTable.cpp
+++ b/Source/core/rendering/RenderTable.cpp
@@ -83,20 +83,20 @@
     RenderBlock::styleDidChange(diff, oldStyle);
     propagateStyleToAnonymousChildren();
 
-    ETableLayout oldTableLayout = oldStyle ? oldStyle->tableLayout() : TAUTO;
+    bool oldFixedTableLayout = oldStyle ? oldStyle->isFixedTableLayout() : false;
 
     // In the collapsed border model, there is no cell spacing.
     m_hSpacing = collapseBorders() ? 0 : style()->horizontalBorderSpacing();
     m_vSpacing = collapseBorders() ? 0 : style()->verticalBorderSpacing();
     m_columnPos[0] = m_hSpacing;
 
-    if (!m_tableLayout || style()->tableLayout() != oldTableLayout) {
+    if (!m_tableLayout || style()->isFixedTableLayout() != oldFixedTableLayout) {
         if (m_tableLayout)
             m_tableLayout->willChangeTableLayout();
 
         // According to the CSS2 spec, you only use fixed table layout if an
         // explicit width is specified on the table.  Auto width implies auto table layout.
-        if (style()->tableLayout() == TFIXED && !style()->logicalWidth().isAuto())
+        if (style()->isFixedTableLayout())
             m_tableLayout = adoptPtr(new FixedTableLayout(this));
         else
             m_tableLayout = adoptPtr(new AutoTableLayout(this));
diff --git a/Source/core/rendering/RenderTable.h b/Source/core/rendering/RenderTable.h
index 536c00f..1315dba 100644
--- a/Source/core/rendering/RenderTable.h
+++ b/Source/core/rendering/RenderTable.h
@@ -277,8 +277,6 @@
 
     virtual bool isTable() const OVERRIDE { return true; }
 
-    virtual bool avoidsFloats() const OVERRIDE { return true; }
-
     virtual void paint(PaintInfo&, const LayoutPoint&) OVERRIDE;
     virtual void paintObject(PaintInfo&, const LayoutPoint&) OVERRIDE;
     virtual void paintBoxDecorations(PaintInfo&, const LayoutPoint&) OVERRIDE;
diff --git a/Source/core/rendering/RenderTableRow.h b/Source/core/rendering/RenderTableRow.h
index ce1aa2f..24bd496 100644
--- a/Source/core/rendering/RenderTableRow.h
+++ b/Source/core/rendering/RenderTableRow.h
@@ -104,7 +104,7 @@
 
     virtual LayerType layerTypeRequired() const OVERRIDE
     {
-        if (hasTransform() || hasHiddenBackface() || hasClipPath() || createsGroup() || isStickyPositioned() || style()->hasWillChangeCompositingHint() || style()->hasWillChangeGpuRasterizationHint() || style()->shouldCompositeForCurrentAnimations())
+        if (hasTransform() || hasHiddenBackface() || hasClipPath() || createsGroup() || isStickyPositioned() || style()->shouldCompositeForCurrentAnimations())
             return NormalLayer;
 
         if (hasOverflowClip())
diff --git a/Source/core/rendering/RenderText.cpp b/Source/core/rendering/RenderText.cpp
index 1fe720b..4243c39 100644
--- a/Source/core/rendering/RenderText.cpp
+++ b/Source/core/rendering/RenderText.cpp
@@ -40,6 +40,7 @@
 #include "core/rendering/RenderView.h"
 #include "core/rendering/break_lines.h"
 #include "platform/fonts/Character.h"
+#include "platform/fonts/FontCache.h"
 #include "platform/geometry/FloatQuad.h"
 #include "platform/text/BidiResolver.h"
 #include "platform/text/TextBreakIterator.h"
@@ -751,6 +752,7 @@
     run.setCharacterScanForCodePath(!canUseSimpleFontCodePath());
     run.setTabSize(!style()->collapseWhiteSpace(), style()->tabSize());
     run.setXPos(xPos);
+    FontCachePurgePreventer fontCachePurgePreventer;
     return f.width(run, fallbackFonts, glyphOverflow);
 }
 
diff --git a/Source/core/rendering/RenderTextFragment.cpp b/Source/core/rendering/RenderTextFragment.cpp
index 91d9546..f2eb3ff 100644
--- a/Source/core/rendering/RenderTextFragment.cpp
+++ b/Source/core/rendering/RenderTextFragment.cpp
@@ -92,6 +92,10 @@
     m_start = 0;
     m_end = textLength();
     if (m_firstLetter) {
+        // FIXME: We should not modify the structure of the render tree during
+        // layout. crbug.com/370458
+        DeprecatedDisableModifyRenderTreeStructureAsserts disabler;
+
         ASSERT(!m_contentString);
         m_firstLetter->destroy();
         m_firstLetter = 0;
diff --git a/Source/core/rendering/RenderTheme.cpp b/Source/core/rendering/RenderTheme.cpp
index 843b932..a050bc4 100644
--- a/Source/core/rendering/RenderTheme.cpp
+++ b/Source/core/rendering/RenderTheme.cpp
@@ -60,10 +60,6 @@
 #include "public/platform/WebRect.h"
 #include "wtf/text/StringBuilder.h"
 
-#if ENABLE(INPUT_SPEECH)
-#include "core/rendering/RenderInputSpeech.h"
-#endif
-
 // The methods in this file are shared by all themes on every platform.
 
 namespace WebCore {
@@ -226,10 +222,6 @@
         return adjustSearchFieldDecorationStyle(style, e);
     case SearchFieldResultsDecorationPart:
         return adjustSearchFieldResultsDecorationStyle(style, e);
-#if ENABLE(INPUT_SPEECH)
-    case InputSpeechButtonPart:
-        return adjustInputFieldSpeechButtonStyle(style, e);
-#endif
     default:
         break;
     }
@@ -339,10 +331,6 @@
         return paintSearchFieldDecoration(o, paintInfo, r);
     case SearchFieldResultsDecorationPart:
         return paintSearchFieldResultsDecoration(o, paintInfo, r);
-#if ENABLE(INPUT_SPEECH)
-    case InputSpeechButtonPart:
-        return paintInputFieldSpeechButton(o, paintInfo, r);
-#endif
     default:
         break;
     }
@@ -381,9 +369,6 @@
     case SearchFieldCancelButtonPart:
     case SearchFieldDecorationPart:
     case SearchFieldResultsDecorationPart:
-#if ENABLE(INPUT_SPEECH)
-    case InputSpeechButtonPart:
-#endif
     default:
         break;
     }
@@ -420,9 +405,6 @@
     case SearchFieldCancelButtonPart:
     case SearchFieldDecorationPart:
     case SearchFieldResultsDecorationPart:
-#if ENABLE(INPUT_SPEECH)
-    case InputSpeechButtonPart:
-#endif
     default:
         break;
     }
@@ -825,18 +807,6 @@
 {
 }
 
-#if ENABLE(INPUT_SPEECH)
-void RenderTheme::adjustInputFieldSpeechButtonStyle(RenderStyle* style, Element* element) const
-{
-    RenderInputSpeech::adjustInputFieldSpeechButtonStyle(style, element);
-}
-
-bool RenderTheme::paintInputFieldSpeechButton(RenderObject* object, const PaintInfo& paintInfo, const IntRect& rect)
-{
-    return RenderInputSpeech::paintInputFieldSpeechButton(object, paintInfo, rect);
-}
-#endif
-
 IntSize RenderTheme::meterSizeForBounds(const RenderMeter*, const IntRect& bounds) const
 {
     return bounds.size();
diff --git a/Source/core/rendering/RenderTheme.h b/Source/core/rendering/RenderTheme.h
index 8ecd331..a3ec3f6 100644
--- a/Source/core/rendering/RenderTheme.h
+++ b/Source/core/rendering/RenderTheme.h
@@ -243,11 +243,6 @@
 
     virtual bool paintProgressBar(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
 
-#if ENABLE(INPUT_SPEECH)
-    virtual void adjustInputFieldSpeechButtonStyle(RenderStyle*, Element*) const;
-    virtual bool paintInputFieldSpeechButton(RenderObject*, const PaintInfo&, const IntRect&);
-#endif
-
     virtual bool paintSliderTrack(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
 
     virtual void adjustSliderThumbStyle(RenderStyle*, Element*) const;
diff --git a/Source/core/rendering/RenderVideo.h b/Source/core/rendering/RenderVideo.h
index bf02dbf..10a9070 100644
--- a/Source/core/rendering/RenderVideo.h
+++ b/Source/core/rendering/RenderVideo.h
@@ -58,7 +58,6 @@
 
     virtual const char* renderName() const OVERRIDE { return "RenderVideo"; }
 
-    virtual LayerType layerTypeRequired() const OVERRIDE { return NormalLayer; }
     virtual bool isVideo() const OVERRIDE { return true; }
 
     virtual void paintReplaced(PaintInfo&, const LayoutPoint&) OVERRIDE;
diff --git a/Source/core/rendering/RenderView.cpp b/Source/core/rendering/RenderView.cpp
index 690bbe7..68db630 100644
--- a/Source/core/rendering/RenderView.cpp
+++ b/Source/core/rendering/RenderView.cpp
@@ -534,7 +534,7 @@
         RenderSelectionInfo* info = i->value.get();
         // RenderSelectionInfo::rect() is in the coordinates of the repaintContainer, so map to page coordinates.
         LayoutRect currRect = info->rect();
-        if (RenderLayerModelObject* repaintContainer = info->repaintContainer()) {
+        if (const RenderLayerModelObject* repaintContainer = info->repaintContainer()) {
             FloatQuad absQuad = repaintContainer->localToAbsoluteQuad(FloatRect(currRect));
             currRect = absQuad.enclosingBoundingBox();
         }
diff --git a/Source/core/rendering/RenderView.h b/Source/core/rendering/RenderView.h
index 3592378..c6d129f 100644
--- a/Source/core/rendering/RenderView.h
+++ b/Source/core/rendering/RenderView.h
@@ -363,7 +363,7 @@
 class LayoutStateDisabler {
     WTF_MAKE_NONCOPYABLE(LayoutStateDisabler);
 public:
-    LayoutStateDisabler(const RenderBox& root)
+    LayoutStateDisabler(const RenderObject& root)
         : m_view(*root.view())
     {
         m_view.disableLayoutState();
diff --git a/Source/core/rendering/compositing/CompositedLayerMapping.cpp b/Source/core/rendering/compositing/CompositedLayerMapping.cpp
index 2e0126a..680285f 100644
--- a/Source/core/rendering/compositing/CompositedLayerMapping.cpp
+++ b/Source/core/rendering/compositing/CompositedLayerMapping.cpp
@@ -233,7 +233,6 @@
     updateOpacity(renderer()->style());
     updateTransform(renderer()->style());
     updateFilters(renderer()->style());
-    updateHasGpuRasterizationHint(renderer()->style());
 
     if (RuntimeEnabledFeatures::cssCompositingEnabled()) {
         updateLayerBlendMode(renderer()->style());
@@ -271,7 +270,7 @@
     TransformationMatrix t;
     if (m_owningLayer.hasTransform()) {
         style->applyTransform(t, toRenderBox(renderer())->pixelSnappedBorderBoxRect().size(), RenderStyle::ExcludeTransformOrigin);
-        makeMatrixRenderable(t, compositor()->canRender3DTransforms());
+        makeMatrixRenderable(t, compositor()->hasAcceleratedCompositing());
     }
 
     m_graphicsLayer->setTransform(t);
@@ -311,11 +310,6 @@
     m_graphicsLayer->setIsRootForIsolatedGroup(isolate);
 }
 
-void CompositedLayerMapping::updateHasGpuRasterizationHint(const RenderStyle* style)
-{
-    m_graphicsLayer->setHasGpuRasterizationHint(style->hasWillChangeGpuRasterizationHint());
-}
-
 void CompositedLayerMapping::updateContentsOpaque()
 {
     // For non-root layers, background is always painted by the primary graphics layer.
@@ -601,7 +595,11 @@
         // FIXME: find a better design to avoid this redundant value - most likely it will make
         // sense to move the paint task info into RenderLayer's m_compositingProperties.
         m_squashedLayers[i].renderLayer->setOffsetFromSquashingLayerOrigin(m_squashedLayers[i].offsetFromRenderer);
+
     }
+
+    for (size_t i = 0; i < m_squashedLayers.size(); ++i)
+        m_squashedLayers[i].localClipRectForSquashedLayer = localClipRectForSquashedLayer(m_squashedLayers[i]);
 }
 
 void CompositedLayerMapping::updateGraphicsLayerGeometry(GraphicsLayerUpdater::UpdateType updateType, const RenderLayer* compositingContainer)
@@ -843,7 +841,6 @@
         updateIsRootForIsolatedGroup();
     }
 
-    updateHasGpuRasterizationHint(renderer()->style());
     updateContentsRect();
     updateBackgroundColor();
     updateDrawsContent();
@@ -865,8 +862,6 @@
     if (!scrollingCoordinator)
         return;
 
-    compositor()->updateViewportConstraintStatus(&m_owningLayer);
-
     scrollingCoordinator->updateLayerPositionConstraint(&m_owningLayer);
 
     // Page scale is applied as a transform on the root render view layer. Because the scroll
@@ -1834,6 +1829,40 @@
     ApplyToGraphicsLayers(this, functor, ApplyToContentLayers);
 }
 
+const GraphicsLayerPaintInfo* CompositedLayerMapping::containingSquashedLayer(const RenderObject* renderObject) const
+{
+    for (size_t i = 0; i < m_squashedLayers.size(); ++i) {
+        if (renderObject->isDescendantOf(m_squashedLayers[i].renderLayer->renderer())) {
+            return &m_squashedLayers[i];
+            break;
+        }
+    }
+    return 0;
+}
+
+IntRect CompositedLayerMapping::localClipRectForSquashedLayer(const GraphicsLayerPaintInfo& paintInfo) const
+{
+    const RenderObject* clippingContainer = paintInfo.renderLayer->renderer()->clippingContainer();
+    if (clippingContainer == m_owningLayer.renderer()->clippingContainer())
+        return PaintInfo::infiniteRect();
+
+    ASSERT(clippingContainer);
+
+    const GraphicsLayerPaintInfo* ancestorPaintInfo = containingSquashedLayer(clippingContainer);
+    // Must be there, otherwise CompositingLayerAssigner::canSquashIntoCurrentSquashingOwner would have disallowed squashing.
+    ASSERT(ancestorPaintInfo);
+
+    // FIXME: this is a potential performance issue. We shoudl consider caching these clip rects or otherwise optimizing.
+    ClipRectsContext clipRectsContext(ancestorPaintInfo->renderLayer, TemporaryClipRects);
+    IntRect parentClipRect = pixelSnappedIntRect(paintInfo.renderLayer->clipper().backgroundClipRect(clipRectsContext).rect());
+    ASSERT(parentClipRect != PaintInfo::infiniteRect());
+
+    // Convert from ancestor to local coordinates.
+    IntSize ancestorToLocalOffset = paintInfo.offsetFromRenderer - ancestorPaintInfo->offsetFromRenderer;
+    parentClipRect.move(ancestorToLocalOffset);
+    return parentClipRect;
+}
+
 void CompositedLayerMapping::doPaintTask(GraphicsLayerPaintInfo& paintInfo, GraphicsContext* context,
     const IntRect& clip) // In the coords of rootLayer.
 {
@@ -1900,7 +1929,15 @@
     } else {
         ASSERT(compositor()->layerSquashingEnabled());
         LayerPaintingInfo paintingInfo(paintInfo.renderLayer, dirtyRect, PaintBehaviorNormal, paintInfo.renderLayer->subpixelAccumulation());
+
+        // RenderLayer::paintLayer assumes that the caller clips to the passed rect. Squashed layers need to do this clipping in software,
+        // since there is no graphics layer to clip them precisely. Furthermore, in some cases we squash layers that need clipping in software
+        // from clipping ancestors (see CompositedLayerMapping::localClipRectForSquashedLayer()).
+        context->save();
+        dirtyRect.intersect(paintInfo.localClipRectForSquashedLayer);
+        context->clip(dirtyRect);
         paintInfo.renderLayer->paintLayer(context, paintingInfo, paintFlags);
+        context->restore();
     }
 
     ASSERT(!paintInfo.renderLayer->usedTransparency());
@@ -1934,6 +1971,7 @@
         page->setIsPainting(true);
 #endif
     TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "Paint", "data", InspectorPaintEvent::data(m_owningLayer.renderer(), clip, graphicsLayer));
+    TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline.stack"), "CallStack", "stack", InspectorCallStackEvent::currentCallStack());
     // FIXME(361045): remove InspectorInstrumentation calls once DevTools Timeline migrates to tracing.
     InspectorInstrumentation::willPaint(m_owningLayer.renderer(), graphicsLayer);
 
@@ -2034,8 +2072,8 @@
     if (nextSquashedLayerIndex < m_squashedLayers.size()) {
         if (!paintInfo.isEquivalentForSquashing(m_squashedLayers[nextSquashedLayerIndex])) {
             updatedAssignment = true;
+            m_squashedLayers[nextSquashedLayerIndex] = paintInfo;
         }
-        m_squashedLayers[nextSquashedLayerIndex] = paintInfo;
     } else {
         m_squashedLayers.append(paintInfo);
         updatedAssignment = true;
diff --git a/Source/core/rendering/compositing/CompositedLayerMapping.h b/Source/core/rendering/compositing/CompositedLayerMapping.h
index dcb0253..a5f6bcb 100644
--- a/Source/core/rendering/compositing/CompositedLayerMapping.h
+++ b/Source/core/rendering/compositing/CompositedLayerMapping.h
@@ -51,6 +51,9 @@
     // known, then we can trivially convert this offset to m_squashingLayer's space.
     LayoutSize offsetFromSquashingCLM;
 
+    // The clip rect to apply, in the local coordinate space of the squashed layer, when painting it.
+    IntRect localClipRectForSquashedLayer;
+
     // Offset describing where this squashed RenderLayer paints into the shared GraphicsLayer backing.
     IntSize offsetFromRenderer;
     LayoutSize subpixelAccumulation;
@@ -205,6 +208,9 @@
         return m_squashingLayerOffsetFromTransformedAncestor;
     }
 
+    // If there is a squashed layer painting into this CLM that is an ancestor of the given RenderObject, return it. Otherwise return 0.
+    const GraphicsLayerPaintInfo* containingSquashedLayer(const RenderObject*) const;
+
 private:
     void createPrimaryGraphicsLayer();
     void destroyGraphicsLayers();
@@ -250,7 +256,6 @@
     void updateTransform(const RenderStyle*);
     void updateLayerBlendMode(const RenderStyle*);
     void updateIsRootForIsolatedGroup();
-    void updateHasGpuRasterizationHint(const RenderStyle*);
     // Return the opacity value that this layer should use for compositing.
     float compositingOpacity(float rendererOpacity) const;
 
@@ -276,6 +281,13 @@
 
     void doPaintTask(GraphicsLayerPaintInfo&, GraphicsContext*, const IntRect& clip);
 
+    // Computes the background clip rect for the given squashed layer, up to any containing layer that is squashed into the
+    // same squashing layer and contains this squashed layer's clipping ancestor.
+    // The clip rect is returned in the coordinate space of the given squashed layer.
+    // If there is no such containing layer, returns the infinite rect.
+    // FIXME: unify this code with the code that sets up m_ancestorClippingLayer. They are doing very similar things.
+    IntRect localClipRectForSquashedLayer(const GraphicsLayerPaintInfo&) const;
+
     RenderLayer& m_owningLayer;
 
     // The hierarchy of layers that is maintained by the CompositedLayerMapping looks like this:
diff --git a/Source/core/rendering/compositing/CompositingLayerAssigner.cpp b/Source/core/rendering/compositing/CompositingLayerAssigner.cpp
new file mode 100644
index 0000000..41e8986
--- /dev/null
+++ b/Source/core/rendering/compositing/CompositingLayerAssigner.cpp
@@ -0,0 +1,285 @@
+/*
+ * Copyright (C) 2009, 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "core/rendering/compositing/CompositingLayerAssigner.h"
+
+#include "core/rendering/compositing/CompositedLayerMapping.h"
+
+namespace WebCore {
+
+// We will only allow squashing if the bbox-area:squashed-area doesn't exceed
+// the ratio |gSquashingSparsityTolerance|:1.
+static uint64_t gSquashingSparsityTolerance = 6;
+
+CompositingLayerAssigner::CompositingLayerAssigner(RenderLayerCompositor* compositor)
+    : m_compositor(compositor)
+    , m_layerSquashingEnabled(compositor->layerSquashingEnabled())
+{
+}
+
+CompositingLayerAssigner::~CompositingLayerAssigner()
+{
+}
+
+void CompositingLayerAssigner::assign(RenderLayer* updateRoot, bool& layersChanged)
+{
+    SquashingState squashingState;
+    assignLayersToBackingsInternal(updateRoot, squashingState, layersChanged);
+    if (squashingState.hasMostRecentMapping)
+        squashingState.mostRecentMapping->finishAccumulatingSquashingLayers(squashingState.nextSquashedLayerIndex);
+}
+
+void CompositingLayerAssigner::SquashingState::updateSquashingStateForNewMapping(CompositedLayerMappingPtr newCompositedLayerMapping, bool hasNewCompositedLayerMapping, LayoutPoint newOffsetFromTransformedAncestorForSquashingCLM)
+{
+    // The most recent backing is done accumulating any more squashing layers.
+    if (hasMostRecentMapping)
+        mostRecentMapping->finishAccumulatingSquashingLayers(nextSquashedLayerIndex);
+
+    nextSquashedLayerIndex = 0;
+    mostRecentMapping = newCompositedLayerMapping;
+    hasMostRecentMapping = hasNewCompositedLayerMapping;
+    offsetFromTransformedAncestorForSquashingCLM = newOffsetFromTransformedAncestorForSquashingCLM;
+}
+
+bool CompositingLayerAssigner::squashingWouldExceedSparsityTolerance(const RenderLayer* candidate, const CompositingLayerAssigner::SquashingState& squashingState)
+{
+    IntRect bounds = candidate->ancestorDependentProperties().clippedAbsoluteBoundingBox;
+    IntRect newBoundingRect = squashingState.boundingRect;
+    newBoundingRect.unite(bounds);
+    const uint64_t newBoundingRectArea = newBoundingRect.size().area();
+    const uint64_t newSquashedArea = squashingState.totalAreaOfSquashedRects + bounds.size().area();
+    return newBoundingRectArea > gSquashingSparsityTolerance * newSquashedArea;
+}
+
+bool CompositingLayerAssigner::needsOwnBacking(const RenderLayer* layer) const
+{
+    if (!m_compositor->canBeComposited(layer))
+        return false;
+
+    // If squashing is disabled, then layers that would have been squashed should just be separately composited.
+    bool needsOwnBackingForDisabledSquashing = !m_layerSquashingEnabled && requiresSquashing(layer->compositingReasons());
+
+    return requiresCompositing(layer->compositingReasons()) || needsOwnBackingForDisabledSquashing || (m_compositor->staleInCompositingMode() && layer->isRootLayer());
+}
+
+CompositingStateTransitionType CompositingLayerAssigner::computeCompositedLayerUpdate(RenderLayer* layer)
+{
+    CompositingStateTransitionType update = NoCompositingStateChange;
+    if (!layer->subtreeIsInvisible() && needsOwnBacking(layer)) {
+        if (!layer->hasCompositedLayerMapping()) {
+            update = AllocateOwnCompositedLayerMapping;
+        }
+    } else {
+        if (layer->hasCompositedLayerMapping())
+            update = RemoveOwnCompositedLayerMapping;
+
+        if (m_layerSquashingEnabled) {
+            if (!layer->subtreeIsInvisible() && requiresSquashing(layer->compositingReasons())) {
+                // We can't compute at this time whether the squashing layer update is a no-op,
+                // since that requires walking the render layer tree.
+                update = PutInSquashingLayer;
+            } else if (layer->groupedMapping() || layer->lostGroupedMapping()) {
+                update = RemoveFromSquashingLayer;
+            }
+        }
+    }
+    return update;
+}
+
+bool CompositingLayerAssigner::canSquashIntoCurrentSquashingOwner(const RenderLayer* layer, const CompositingLayerAssigner::SquashingState& squashingState)
+{
+    // FIXME: this special case for video exists only to deal with corner cases
+    // where a RenderVideo does not report that it needs to be directly composited.
+    // Video does not currently support sharing a backing, but this could be
+    // generalized in the future. The following layout tests fail if we permit the
+    // video to share a backing with other layers.
+    //
+    // compositing/video/video-controls-layer-creation.html
+    // virtual/softwarecompositing/video/video-controls-layer-creation.html
+    if (layer->renderer()->isVideo())
+        return false;
+
+    if (squashingWouldExceedSparsityTolerance(layer, squashingState))
+        return false;
+
+    // FIXME: this is not efficient, since it walks up the tree . We should store these values on the AncestorDependentPropertiesCache.
+    ASSERT(squashingState.hasMostRecentMapping);
+    const RenderLayer& squashingLayer = squashingState.mostRecentMapping->owningLayer();
+
+    if (layer->renderer()->clippingContainer() != squashingLayer.renderer()->clippingContainer()) {
+        if (!squashingLayer.compositedLayerMapping()->containingSquashedLayer(layer->renderer()->clippingContainer()))
+            return false;
+    }
+
+    if (layer->compositingContainer() == &squashingLayer)
+        return false;
+
+    // Composited descendants need to be clipped by a child contianment graphics layer, which would not be available if the layer is
+    if (m_compositor->clipsCompositingDescendants(layer))
+        return false;
+
+    if (layer->scrollsWithRespectTo(&squashingLayer))
+        return false;
+
+    const RenderLayer::AncestorDependentProperties& ancestorDependentProperties = layer->ancestorDependentProperties();
+    const RenderLayer::AncestorDependentProperties& squashingLayerAncestorDependentProperties = squashingLayer.ancestorDependentProperties();
+
+    if (ancestorDependentProperties.opacityAncestor != squashingLayerAncestorDependentProperties.opacityAncestor)
+        return false;
+
+    if (ancestorDependentProperties.transformAncestor != squashingLayerAncestorDependentProperties.transformAncestor)
+        return false;
+
+    if (ancestorDependentProperties.filterAncestor != squashingLayerAncestorDependentProperties.filterAncestor)
+        return false;
+
+    return true;
+}
+
+bool CompositingLayerAssigner::updateSquashingAssignment(RenderLayer* layer, SquashingState& squashingState, const CompositingStateTransitionType compositedLayerUpdate)
+{
+    // NOTE: In the future as we generalize this, the background of this layer may need to be assigned to a different backing than
+    // the squashed RenderLayer's own primary contents. This would happen when we have a composited negative z-index element that needs
+    // to paint on top of the background, but below the layer's main contents. For now, because we always composite layers
+    // when they have a composited negative z-index child, such layers will never need squashing so it is not yet an issue.
+    if (compositedLayerUpdate == PutInSquashingLayer) {
+        // A layer that is squashed with other layers cannot have its own CompositedLayerMapping.
+        ASSERT(!layer->hasCompositedLayerMapping());
+        ASSERT(squashingState.hasMostRecentMapping);
+
+        LayoutPoint offsetFromTransformedAncestorForSquashedLayer = layer->computeOffsetFromTransformedAncestor();
+
+        // Compute the offset of this layer from the squashing owner. This computation is correct only because layers are allowed to squash only if they
+        // share a transformed ancestor (see canSquashIntoCurrentSquashingOwner).
+        LayoutSize offsetFromSquashingCLM(offsetFromTransformedAncestorForSquashedLayer.x() - squashingState.offsetFromTransformedAncestorForSquashingCLM.x(),
+            offsetFromTransformedAncestorForSquashedLayer.y() - squashingState.offsetFromTransformedAncestorForSquashingCLM.y());
+
+        bool changedSquashingLayer =
+            squashingState.mostRecentMapping->updateSquashingLayerAssignment(layer, offsetFromSquashingCLM, squashingState.nextSquashedLayerIndex);
+        if (!changedSquashingLayer)
+            return true;
+
+        // If we've modified the collection of squashed layers, we must update
+        // the graphics layer geometry.
+        squashingState.mostRecentMapping->setNeedsGraphicsLayerUpdate();
+
+        layer->clipper().clearClipRectsIncludingDescendants();
+
+        // If we need to repaint, do so before allocating the layer to the squashing layer.
+        m_compositor->repaintOnCompositingChange(layer);
+
+        // FIXME: it seems premature to compute this before all compositing state has been updated?
+        // This layer and all of its descendants have cached repaints rects that are relative to
+        // the repaint container, so change when compositing changes; we need to update them here.
+
+        // FIXME: what's up with parent()?
+        if (layer->parent())
+            layer->repainter().computeRepaintRectsIncludingDescendants();
+
+        return true;
+    }
+    if (compositedLayerUpdate == RemoveFromSquashingLayer) {
+        if (layer->groupedMapping()) {
+            layer->groupedMapping()->setNeedsGraphicsLayerUpdate();
+            layer->setGroupedMapping(0);
+        }
+
+        // This layer and all of its descendants have cached repaints rects that are relative to
+        // the repaint container, so change when compositing changes; we need to update them here.
+        layer->repainter().computeRepaintRectsIncludingDescendants();
+
+        // If we need to repaint, do so now that we've removed it from a squashed layer
+        m_compositor->repaintOnCompositingChange(layer);
+
+        layer->setLostGroupedMapping(false);
+        return true;
+    }
+
+    return false;
+}
+
+void CompositingLayerAssigner::assignLayersToBackingsForReflectionLayer(RenderLayer* reflectionLayer, bool& layersChanged)
+{
+    CompositingStateTransitionType compositedLayerUpdate = computeCompositedLayerUpdate(reflectionLayer);
+    if (compositedLayerUpdate != NoCompositingStateChange) {
+        layersChanged = true;
+        m_compositor->allocateOrClearCompositedLayerMapping(reflectionLayer, compositedLayerUpdate);
+    }
+    m_compositor->updateDirectCompositingReasons(reflectionLayer);
+    if (reflectionLayer->hasCompositedLayerMapping())
+        reflectionLayer->compositedLayerMapping()->updateGraphicsLayerConfiguration(GraphicsLayerUpdater::ForceUpdate);
+}
+
+void CompositingLayerAssigner::assignLayersToBackingsInternal(RenderLayer* layer, SquashingState& squashingState, bool& layersChanged)
+{
+    if (m_layerSquashingEnabled && requiresSquashing(layer->compositingReasons()) && !canSquashIntoCurrentSquashingOwner(layer, squashingState))
+        layer->setCompositingReasons(layer->compositingReasons() | CompositingReasonNoSquashingTargetFound);
+
+    CompositingStateTransitionType compositedLayerUpdate = computeCompositedLayerUpdate(layer);
+
+    if (m_compositor->allocateOrClearCompositedLayerMapping(layer, compositedLayerUpdate))
+        layersChanged = true;
+
+    // FIXME: special-casing reflection layers here is not right.
+    if (layer->reflectionInfo())
+        assignLayersToBackingsForReflectionLayer(layer->reflectionInfo()->reflectionLayer(), layersChanged);
+
+    // Add this layer to a squashing backing if needed.
+    if (m_layerSquashingEnabled) {
+        if (updateSquashingAssignment(layer, squashingState, compositedLayerUpdate))
+            layersChanged = true;
+
+        const bool layerIsSquashed = compositedLayerUpdate == PutInSquashingLayer || (compositedLayerUpdate == NoCompositingStateChange && layer->groupedMapping());
+        if (layerIsSquashed) {
+            squashingState.nextSquashedLayerIndex++;
+            IntRect layerBounds = layer->ancestorDependentProperties().clippedAbsoluteBoundingBox;
+            squashingState.totalAreaOfSquashedRects += layerBounds.size().area();
+            squashingState.boundingRect.unite(layerBounds);
+        }
+    }
+
+    if (layer->stackingNode()->isStackingContainer()) {
+        RenderLayerStackingNodeIterator iterator(*layer->stackingNode(), NegativeZOrderChildren);
+        while (RenderLayerStackingNode* curNode = iterator.next())
+            assignLayersToBackingsInternal(curNode->layer(), squashingState, layersChanged);
+    }
+
+    if (m_layerSquashingEnabled) {
+        // At this point, if the layer is to be "separately" composited, then its backing becomes the most recent in paint-order.
+        if (layer->compositingState() == PaintsIntoOwnBacking || layer->compositingState() == HasOwnBackingButPaintsIntoAncestor) {
+            ASSERT(!requiresSquashing(layer->compositingReasons()));
+            LayoutPoint offsetFromTransformedAncestorForSquashingCLM = layer->computeOffsetFromTransformedAncestor();
+            squashingState.updateSquashingStateForNewMapping(layer->compositedLayerMapping(), layer->hasCompositedLayerMapping(), offsetFromTransformedAncestorForSquashingCLM);
+        }
+    }
+
+    RenderLayerStackingNodeIterator iterator(*layer->stackingNode(), NormalFlowChildren | PositiveZOrderChildren);
+    while (RenderLayerStackingNode* curNode = iterator.next())
+        assignLayersToBackingsInternal(curNode->layer(), squashingState, layersChanged);
+}
+
+}
diff --git a/Source/core/rendering/compositing/CompositingLayerAssigner.h b/Source/core/rendering/compositing/CompositingLayerAssigner.h
new file mode 100644
index 0000000..eed719a
--- /dev/null
+++ b/Source/core/rendering/compositing/CompositingLayerAssigner.h
@@ -0,0 +1,91 @@
+/*
+ * Copyright (C) 2009, 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef CompositingLayerAssigner_h
+#define CompositingLayerAssigner_h
+
+#include "core/rendering/compositing/RenderLayerCompositor.h"
+#include "platform/geometry/IntRect.h"
+#include "platform/geometry/LayoutPoint.h"
+
+namespace WebCore {
+
+class RenderLayer;
+
+class CompositingLayerAssigner {
+public:
+    explicit CompositingLayerAssigner(RenderLayerCompositor*);
+    ~CompositingLayerAssigner();
+
+    void assign(RenderLayer* updateRoot, bool& layersChanged);
+
+    // FIXME: This function should be private. We should remove the one caller
+    // once we've fixed the compositing chicken/egg issues.
+    CompositingStateTransitionType computeCompositedLayerUpdate(RenderLayer*);
+
+private:
+    struct SquashingState {
+        SquashingState()
+            : mostRecentMapping(0)
+            , hasMostRecentMapping(false)
+            , nextSquashedLayerIndex(0)
+            , totalAreaOfSquashedRects(0) { }
+
+        void updateSquashingStateForNewMapping(CompositedLayerMappingPtr, bool hasNewCompositedLayerMapping, LayoutPoint newOffsetFromTransformedAncestorForSquashingCLM);
+
+        // The most recent composited backing that the layer should squash onto if needed.
+        CompositedLayerMappingPtr mostRecentMapping;
+        bool hasMostRecentMapping;
+
+        // Coordinates of the compositedLayerMapping's owning layer in the space of the transformed ancestor. This is used for computing the correct
+        // positions of renderlayers when they paint into the squashing layer.
+        LayoutPoint offsetFromTransformedAncestorForSquashingCLM;
+
+        // Counter that tracks what index the next RenderLayer would be if it gets squashed to the current squashing layer.
+        size_t nextSquashedLayerIndex;
+
+        // The absolute bounding rect of all the squashed layers.
+        IntRect boundingRect;
+
+        // This is simply the sum of the areas of the squashed rects. This can be very skewed if the rects overlap,
+        // but should be close enough to drive a heuristic.
+        uint64_t totalAreaOfSquashedRects;
+    };
+
+    void assignLayersToBackingsInternal(RenderLayer*, SquashingState&, bool& layersChanged);
+    void assignLayersToBackingsForReflectionLayer(RenderLayer* reflectionLayer, bool& layersChanged);
+    bool canSquashIntoCurrentSquashingOwner(const RenderLayer*, const SquashingState&);
+    bool squashingWouldExceedSparsityTolerance(const RenderLayer* candidate, const SquashingState&);
+    bool updateSquashingAssignment(RenderLayer*, SquashingState&, CompositingStateTransitionType);
+    bool needsOwnBacking(const RenderLayer*) const;
+
+    RenderLayerCompositor* m_compositor;
+    bool m_layerSquashingEnabled;
+};
+
+} // namespace WebCore
+
+#endif // CompositingLayerAssigner_h
diff --git a/Source/core/rendering/compositing/CompositingReasonFinder.cpp b/Source/core/rendering/compositing/CompositingReasonFinder.cpp
index f17e456..04e4fee 100644
--- a/Source/core/rendering/compositing/CompositingReasonFinder.cpp
+++ b/Source/core/rendering/compositing/CompositingReasonFinder.cpp
@@ -51,8 +51,6 @@
         m_compositingTriggers |= ScrollableInnerFrameTrigger;
     if (settings.acceleratedCompositingForFiltersEnabled())
         m_compositingTriggers |= FilterTrigger;
-    if (settings.acceleratedCompositingForGpuRasterizationHintEnabled())
-        m_compositingTriggers |= GPURasterizationTrigger;
 
     // We map both these settings to universal overlow scrolling.
     // FIXME: Replace these settings with a generic compositing setting for HighDPI.
@@ -84,19 +82,6 @@
     return !m_renderView.document().ownerElement();
 }
 
-CompositingReasons CompositingReasonFinder::suppressWillChangeAndAnimationForGpuRasterization(const RenderLayer* layer, CompositingReasons styleReasons) const
-{
-    CompositingReasons adjustedReasons = styleReasons;
-    adjustedReasons &= ~(CompositingReasonWillChangeCompositingHint | CompositingReasonWillChangeGpuRasterizationHint);
-
-    // We can suppress layer creation for animations before animations start, but not
-    // once they're already running on the compositor.
-    if (!layer->renderer()->style()->isRunningAnimationOnCompositor())
-        adjustedReasons &= ~CompositingReasonActiveAnimation;
-
-    return adjustedReasons;
-}
-
 CompositingReasons CompositingReasonFinder::directReasons(const RenderLayer* layer, bool* needToRecomputeCompositingRequirements) const
 {
     CompositingReasons styleReasons = layer->styleDeterminedCompositingReasons();
@@ -138,9 +123,6 @@
     if (requiresCompositingForWillChangeCompositingHint(renderer))
         directReasons |= CompositingReasonWillChangeCompositingHint;
 
-    if (requiresCompositingForWillChangeGpuRasterizationHint(renderer))
-        directReasons |= CompositingReasonWillChangeGpuRasterizationHint;
-
     ASSERT(!(directReasons & ~CompositingReasonComboAllStyleDeterminedReasons));
     return directReasons;
 }
@@ -170,14 +152,6 @@
     return renderer->style()->hasWillChangeCompositingHint();
 }
 
-bool CompositingReasonFinder::requiresCompositingForWillChangeGpuRasterizationHint(const RenderObject* renderer) const
-{
-    if (!(m_compositingTriggers & GPURasterizationTrigger))
-        return false;
-
-    return renderer->style()->hasWillChangeGpuRasterizationHint();
-}
-
 CompositingReasons CompositingReasonFinder::nonStyleDeterminedDirectReasons(const RenderLayer* layer, bool* needToRecomputeCompositingRequirements) const
 {
     CompositingReasons directReasons = CompositingReasonNone;
@@ -228,30 +202,6 @@
     return layer->needsCompositedScrolling();
 }
 
-static bool isViewportConstrainedStickyLayer(const RenderLayer* layer)
-{
-    ASSERT(layer->renderer()->isStickyPositioned());
-    return !layer->enclosingOverflowClipLayer(ExcludeSelf);
-}
-
-bool CompositingReasonFinder::isViewportConstrainedFixedOrStickyLayer(const RenderLayer* layer)
-{
-    if (layer->renderer()->isStickyPositioned())
-        return isViewportConstrainedStickyLayer(layer);
-
-    if (layer->renderer()->style()->position() != FixedPosition)
-        return false;
-
-    for (const RenderLayerStackingNode* stackingContainer = layer->stackingNode(); stackingContainer;
-        stackingContainer = stackingContainer->ancestorStackingContainerNode()) {
-        if (stackingContainer->layer()->compositingState() != NotComposited
-            && stackingContainer->layer()->renderer()->style()->position() == FixedPosition)
-            return false;
-    }
-
-    return true;
-}
-
 bool CompositingReasonFinder::requiresCompositingForPosition(RenderObject* renderer, const RenderLayer* layer, RenderLayer::ViewportConstrainedNotCompositedReason* viewportConstrainedNotCompositedReason, bool* needToRecomputeCompositingRequirements) const
 {
     return requiresCompositingForPositionSticky(renderer, layer) || requiresCompositingForPositionFixed(renderer, layer, viewportConstrainedNotCompositedReason, needToRecomputeCompositingRequirements);
@@ -265,7 +215,7 @@
         return false;
     // FIXME: This probably isn't correct for accelerated overflow scrolling. crbug.com/361723
     // Instead it should return false only if the layer is not inside a scrollable region.
-    return isViewportConstrainedStickyLayer(layer);
+    return !layer->enclosingOverflowClipLayer(ExcludeSelf);
 }
 
 bool CompositingReasonFinder::requiresCompositingForPositionFixed(RenderObject* renderer, const RenderLayer* layer, RenderLayer::ViewportConstrainedNotCompositedReason* viewportConstrainedNotCompositedReason, bool* needToRecomputeCompositingRequirements) const
diff --git a/Source/core/rendering/compositing/CompositingReasonFinder.h b/Source/core/rendering/compositing/CompositingReasonFinder.h
index 4f78d91..aa415bd 100644
--- a/Source/core/rendering/compositing/CompositingReasonFinder.h
+++ b/Source/core/rendering/compositing/CompositingReasonFinder.h
@@ -21,9 +21,7 @@
     explicit CompositingReasonFinder(RenderView&);
 
     CompositingReasons styleDeterminedReasons(RenderObject*) const;
-    CompositingReasons directReasons(const RenderLayer*, bool* needToRecomputeCompositingRequirements) const;
-
-    CompositingReasons suppressWillChangeAndAnimationForGpuRasterization(const RenderLayer*, CompositingReasons styleReasons) const;
+    CompositingReasons directReasons(const RenderLayer*, bool* needToRecomputeCompositingRequirements = 0) const;
 
     void updateTriggers();
 
@@ -33,8 +31,6 @@
     bool requiresCompositingForScrollableFrame() const;
     bool requiresCompositingForPosition(RenderObject*, const RenderLayer*, RenderLayer::ViewportConstrainedNotCompositedReason*, bool* needToRecomputeCompositingRequirements) const;
 
-    static bool isViewportConstrainedFixedOrStickyLayer(const RenderLayer*);
-
 private:
     bool isMainFrame() const;
 
@@ -50,7 +46,6 @@
     bool requiresCompositingForPositionSticky(RenderObject*, const RenderLayer*) const;
     bool requiresCompositingForPositionFixed(RenderObject*, const RenderLayer*, RenderLayer::ViewportConstrainedNotCompositedReason*, bool* needToRecomputeCompositingRequirements) const;
     bool requiresCompositingForWillChangeCompositingHint(const RenderObject*) const;
-    bool requiresCompositingForWillChangeGpuRasterizationHint(const RenderObject*) const;
 
     RenderView& m_renderView;
     CompositingTriggerFlags m_compositingTriggers;
diff --git a/Source/core/rendering/compositing/CompositingRequirementsUpdater.cpp b/Source/core/rendering/compositing/CompositingRequirementsUpdater.cpp
index 980fd85..2bae299 100644
--- a/Source/core/rendering/compositing/CompositingRequirementsUpdater.cpp
+++ b/Source/core/rendering/compositing/CompositingRequirementsUpdater.cpp
@@ -163,7 +163,6 @@
         , m_subtreeIsCompositing(false)
         , m_hasUnisolatedCompositedBlendingDescendant(false)
         , m_testingOverlap(testOverlap)
-        , m_suppressLayerCreation(false)
 #ifndef NDEBUG
         , m_depth(0)
 #endif
@@ -175,7 +174,6 @@
         , m_subtreeIsCompositing(other.m_subtreeIsCompositing)
         , m_hasUnisolatedCompositedBlendingDescendant(other.m_hasUnisolatedCompositedBlendingDescendant)
         , m_testingOverlap(other.m_testingOverlap)
-        , m_suppressLayerCreation(other.m_suppressLayerCreation)
 #ifndef NDEBUG
         , m_depth(other.m_depth + 1)
 #endif
@@ -186,7 +184,6 @@
     bool m_subtreeIsCompositing;
     bool m_hasUnisolatedCompositedBlendingDescendant;
     bool m_testingOverlap;
-    bool m_suppressLayerCreation;
 #ifndef NDEBUG
     int m_depth;
 #endif
@@ -202,11 +199,6 @@
     return reasons != CompositingReasonNone;
 }
 
-static bool shouldMakeDescendantsSuppressCompositedLayerCreation(CompositingReasons reasons)
-{
-    return reasons & CompositingReasonWillChangeGpuRasterizationHint;
-}
-
 static CompositingReasons subtreeReasonsForCompositing(RenderObject* renderer, bool hasCompositedDescendants, bool has3DTransformedDescendants)
 {
     CompositingReasons subtreeReasons = CompositingReasonNone;
@@ -256,10 +248,9 @@
     return subtreeReasons;
 }
 
-CompositingRequirementsUpdater::CompositingRequirementsUpdater(RenderView& renderView, CompositingReasonFinder& compositingReasonFinder, bool* needsToRecomputeCompositingRequirements)
+CompositingRequirementsUpdater::CompositingRequirementsUpdater(RenderView& renderView, CompositingReasonFinder& compositingReasonFinder)
     : m_renderView(renderView)
     , m_compositingReasonFinder(compositingReasonFinder)
-    , m_needsToRecomputeCompositingRequirements(needsToRecomputeCompositingRequirements)
 {
 }
 
@@ -299,10 +290,7 @@
     CompositingReasons reasonsToComposite = CompositingReasonNone;
 
     // First accumulate the straightforward compositing reasons.
-    CompositingReasons directReasons = m_compositingReasonFinder.directReasons(layer, m_needsToRecomputeCompositingRequirements);
-    layer->setSuppressingCompositedLayerCreation(currentRecursionData.m_suppressLayerCreation);
-    if (layer->suppressingCompositedLayerCreation())
-        directReasons = m_compositingReasonFinder.suppressWillChangeAndAnimationForGpuRasterization(layer, directReasons);
+    CompositingReasons directReasons = m_compositingReasonFinder.directReasons(layer);
 
     // Video is special. It's the only RenderLayer type that can both have
     // RenderLayer children and whose children can't use its backing to render
@@ -357,7 +345,6 @@
     // ancestor with m_subtreeIsCompositing set to false.
     RecursionData childRecursionData(currentRecursionData);
     childRecursionData.m_subtreeIsCompositing = false;
-    childRecursionData.m_suppressLayerCreation = layer->suppressingCompositedLayerCreation() || shouldMakeDescendantsSuppressCompositedLayerCreation(directReasons);
 
     bool willBeCompositedOrSquashed = compositor->canBeComposited(layer) && requiresCompositingOrSquashing(reasonsToComposite);
     if (willBeCompositedOrSquashed) {
diff --git a/Source/core/rendering/compositing/CompositingRequirementsUpdater.h b/Source/core/rendering/compositing/CompositingRequirementsUpdater.h
index bb2ea71..9886444 100644
--- a/Source/core/rendering/compositing/CompositingRequirementsUpdater.h
+++ b/Source/core/rendering/compositing/CompositingRequirementsUpdater.h
@@ -41,7 +41,7 @@
 
 class CompositingRequirementsUpdater {
 public:
-    CompositingRequirementsUpdater(RenderView&, CompositingReasonFinder&, bool* needsToRecomputeCompositingRequirements);
+    CompositingRequirementsUpdater(RenderView&, CompositingReasonFinder&);
     ~CompositingRequirementsUpdater();
 
     //  Recurse through the layers in z-index and overflow order (which is equivalent to painting order)
@@ -64,9 +64,6 @@
 
     RenderView& m_renderView;
     CompositingReasonFinder& m_compositingReasonFinder;
-
-    // FIXME: CompositingRequirementsUpdater should not effect this state.
-    bool* m_needsToRecomputeCompositingRequirements;
 };
 
 } // namespace WebCore
diff --git a/Source/core/rendering/compositing/CompositingTriggers.h b/Source/core/rendering/compositing/CompositingTriggers.h
index 65f3aac..1d7e47f 100644
--- a/Source/core/rendering/compositing/CompositingTriggers.h
+++ b/Source/core/rendering/compositing/CompositingTriggers.h
@@ -29,17 +29,16 @@
     CanvasTrigger = 1 << 3,
     FilterTrigger = 1 << 5,
     ScrollableInnerFrameTrigger = 1 << 6,
-    GPURasterizationTrigger = 1 << 7,
 
     // FIXME: This is a temporary trigger for enabling the old, opt-in path for
     // accelerated overflow scroll. It should be removed once the "universal"
     // path is ready (crbug.com/254111).
     // Currently there is no way to enable this trigger, which means we can
     // remove it once we're confident in the current codepaths.
-    LegacyOverflowScrollTrigger = 1 << 8,
+    LegacyOverflowScrollTrigger = 1 << 7,
 
-    OverflowScrollTrigger = 1 << 9,
-    ViewportConstrainedPositionedTrigger = 1 << 10,
+    OverflowScrollTrigger = 1 << 8,
+    ViewportConstrainedPositionedTrigger = 1 << 9,
     AllCompositingTriggers = 0xFFFFFFFF,
 };
 
diff --git a/Source/core/rendering/compositing/RenderLayerCompositor.cpp b/Source/core/rendering/compositing/RenderLayerCompositor.cpp
index 74e252a..b18e586 100644
--- a/Source/core/rendering/compositing/RenderLayerCompositor.cpp
+++ b/Source/core/rendering/compositing/RenderLayerCompositor.cpp
@@ -59,6 +59,7 @@
 #include "core/rendering/RenderVideo.h"
 #include "core/rendering/RenderView.h"
 #include "core/rendering/compositing/CompositedLayerMapping.h"
+#include "core/rendering/compositing/CompositingLayerAssigner.h"
 #include "core/rendering/compositing/CompositingRequirementsUpdater.h"
 #include "core/rendering/compositing/GraphicsLayerUpdater.h"
 #include "platform/OverscrollTheme.h"
@@ -75,10 +76,6 @@
 
 namespace WebCore {
 
-// We will only allow squashing if the bbox-area:squashed-area doesn't exceed
-// the ratio |gSquashingSparsityTolerance|:1.
-static uint64_t gSquashingSparsityTolerance = 6;
-
 using namespace HTMLNames;
 
 class DeprecatedDirtyCompositingDuringCompositingUpdate {
@@ -231,11 +228,6 @@
     return m_compositingReasonFinder.hasOverflowScrollTrigger();
 }
 
-bool RenderLayerCompositor::canRender3DTransforms() const
-{
-    return hasAcceleratedCompositing();
-}
-
 void RenderLayerCompositor::setCompositingLayersNeedRebuild()
 {
     // FIXME: crbug.com/332248 ideally this could be merged with setNeedsCompositingUpdate().
@@ -322,28 +314,14 @@
 
     // FIXME: This function should only set dirty bits. We shouldn't
     // enable compositing mode here.
-    enableCompositingModeIfNeeded();
+    // We check needsLayout here because we don't know if we need to enable
+    // compositing mode until layout is up-to-date because we need to know
+    // if this frame scrolls.
+    if (!m_renderView.needsLayout())
+        enableCompositingModeIfNeeded();
 
     m_pendingUpdateType = std::max(m_pendingUpdateType, updateType);
 
-    switch (updateType) {
-    case CompositingUpdateNone:
-        ASSERT_NOT_REACHED();
-        break;
-    case CompositingUpdateAfterStyleChange:
-        m_needsToRecomputeCompositingRequirements = true;
-        break;
-    case CompositingUpdateAfterLayout:
-        m_needsToRecomputeCompositingRequirements = true;
-        break;
-    case CompositingUpdateOnScroll:
-        m_needsToRecomputeCompositingRequirements = true; // Overlap can change with scrolling, so need to check for hierarchy updates.
-        break;
-    case CompositingUpdateOnCompositedScroll:
-    case CompositingUpdateAfterCanvasContextChange:
-        break;
-    }
-
     page()->animator().scheduleVisualUpdate();
     lifecycle().ensureStateAtMost(DocumentLifecycle::LayoutClean);
 }
@@ -364,7 +342,7 @@
 
 bool RenderLayerCompositor::hasUnresolvedDirtyBits()
 {
-    return m_needsToRecomputeCompositingRequirements || compositingLayersNeedRebuild() || m_needsUpdateCompositingRequirementsState || m_pendingUpdateType > CompositingUpdateNone;
+    return m_needsToRecomputeCompositingRequirements || compositingLayersNeedRebuild() || m_needsUpdateCompositingRequirementsState || m_pendingUpdateType != CompositingUpdateNone;
 }
 
 void RenderLayerCompositor::updateIfNeeded()
@@ -382,7 +360,7 @@
     }
 
     CompositingUpdateType updateType = m_pendingUpdateType;
-    bool needCompositingRequirementsUpdate = m_needsToRecomputeCompositingRequirements;
+    bool needCompositingRequirementsUpdate = m_needsToRecomputeCompositingRequirements || updateType >= CompositingUpdateAfterCompositingInputChange;
     bool needHierarchyAndGeometryUpdate = compositingLayersNeedRebuild();
 
     m_pendingUpdateType = CompositingUpdateNone;
@@ -413,16 +391,16 @@
         {
             TRACE_EVENT0("blink_rendering", "CompositingPropertyUpdater::updateAncestorDependentProperties");
             CompositingPropertyUpdater(updateRoot).updateAncestorDependentProperties(updateRoot, compositingPropertyUpdateType, 0);
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
             CompositingPropertyUpdater::assertNeedsToUpdateAncestorDependantPropertiesBitsCleared(updateRoot);
 #endif
         }
 
-        CompositingRequirementsUpdater(m_renderView, m_compositingReasonFinder, &m_needsToRecomputeCompositingRequirements).update(updateRoot);
+        CompositingRequirementsUpdater(m_renderView, m_compositingReasonFinder).update(updateRoot);
 
         {
-            TRACE_EVENT0("blink_rendering", "RenderLayerCompositor::assignLayersToBackings");
-            assignLayersToBackings(updateRoot, layersChanged);
+            TRACE_EVENT0("blink_rendering", "CompositingLayerAssigner::assign");
+            CompositingLayerAssigner(this).assign(updateRoot, layersChanged);
         }
 
         {
@@ -438,7 +416,7 @@
             needHierarchyAndGeometryUpdate = true;
     }
 
-    if (updateType >= CompositingUpdateAfterStyleChange || needHierarchyAndGeometryUpdate) {
+    if (updateType != CompositingUpdateNone || needHierarchyAndGeometryUpdate) {
         TRACE_EVENT0("blink_rendering", "GraphicsLayerUpdater::updateRecursive");
         GraphicsLayerUpdater updater;
         updater.update(*updateRoot, graphicsLayerUpdateType);
@@ -568,8 +546,6 @@
                 }
             }
 
-            removeViewportConstrainedLayer(layer);
-
             layer->clearCompositedLayerMapping();
             compositedLayerMappingChanged = true;
 
@@ -610,60 +586,6 @@
     return compositedLayerMappingChanged || nonCompositedReasonChanged;
 }
 
-bool RenderLayerCompositor::updateSquashingAssignment(RenderLayer* layer, SquashingState& squashingState, const CompositingStateTransitionType compositedLayerUpdate)
-{
-    // NOTE: In the future as we generalize this, the background of this layer may need to be assigned to a different backing than
-    // the squashed RenderLayer's own primary contents. This would happen when we have a composited negative z-index element that needs
-    // to paint on top of the background, but below the layer's main contents. For now, because we always composite layers
-    // when they have a composited negative z-index child, such layers will never need squashing so it is not yet an issue.
-    if (compositedLayerUpdate == PutInSquashingLayer) {
-        // A layer that is squashed with other layers cannot have its own CompositedLayerMapping.
-        ASSERT(!layer->hasCompositedLayerMapping());
-        ASSERT(squashingState.hasMostRecentMapping);
-
-        LayoutPoint offsetFromTransformedAncestorForSquashedLayer = layer->computeOffsetFromTransformedAncestor();
-
-        // Compute the offset of this layer from the squashing owner. This computation is correct only because layers are allowed to squash only if they
-        // share a transformed ancestor (see canSquashIntoCurrentSquashingOwner).
-        LayoutSize offsetFromSquashingCLM(offsetFromTransformedAncestorForSquashedLayer.x() - squashingState.offsetFromTransformedAncestorForSquashingCLM.x(),
-            offsetFromTransformedAncestorForSquashedLayer.y() - squashingState.offsetFromTransformedAncestorForSquashingCLM.y());
-
-        bool changedSquashingLayer =
-            squashingState.mostRecentMapping->updateSquashingLayerAssignment(layer, offsetFromSquashingCLM, squashingState.nextSquashedLayerIndex);
-        if (!changedSquashingLayer)
-            return true;
-
-        layer->clipper().clearClipRectsIncludingDescendants();
-
-        // If we need to repaint, do so before allocating the layer to the squashing layer.
-        repaintOnCompositingChange(layer);
-
-        // FIXME: it seems premature to compute this before all compositing state has been updated?
-        // This layer and all of its descendants have cached repaints rects that are relative to
-        // the repaint container, so change when compositing changes; we need to update them here.
-
-        // FIXME: what's up with parent()?
-        if (layer->parent())
-            layer->repainter().computeRepaintRectsIncludingDescendants();
-
-        return true;
-    } else if (compositedLayerUpdate == RemoveFromSquashingLayer) {
-        layer->setGroupedMapping(0);
-
-        // This layer and all of its descendants have cached repaints rects that are relative to
-        // the repaint container, so change when compositing changes; we need to update them here.
-        layer->repainter().computeRepaintRectsIncludingDescendants();
-
-        // If we need to repaint, do so now that we've removed it from a squashed layer
-        repaintOnCompositingChange(layer);
-
-        layer->setLostGroupedMapping(false);
-        return true;
-    }
-
-    return false;
-}
-
 bool RenderLayerCompositor::updateLayerIfViewportConstrained(RenderLayer* layer)
 {
     RenderLayer::ViewportConstrainedNotCompositedReason viewportConstrainedNotCompositedReason = RenderLayer::NoNotCompositedReason;
@@ -677,86 +599,6 @@
     return false;
 }
 
-bool RenderLayerCompositor::squashingWouldExceedSparsityTolerance(const RenderLayer* candidate, const RenderLayerCompositor::SquashingState& squashingState)
-{
-    IntRect bounds = candidate->ancestorDependentProperties().clippedAbsoluteBoundingBox;
-    IntRect newBoundingRect = squashingState.boundingRect;
-    newBoundingRect.unite(bounds);
-    const uint64_t newBoundingRectArea = newBoundingRect.size().area();
-    const uint64_t newSquashedArea = squashingState.totalAreaOfSquashedRects + bounds.size().area();
-    return newBoundingRectArea > gSquashingSparsityTolerance * newSquashedArea;
-}
-
-bool RenderLayerCompositor::canSquashIntoCurrentSquashingOwner(const RenderLayer* layer, const RenderLayerCompositor::SquashingState& squashingState)
-{
-    // FIXME: this special case for video exists only to deal with corner cases
-    // where a RenderVideo does not report that it needs to be directly composited.
-    // Video does not currently support sharing a backing, but this could be
-    // generalized in the future. The following layout tests fail if we permit the
-    // video to share a backing with other layers.
-    //
-    // compositing/video/video-controls-layer-creation.html
-    // virtual/softwarecompositing/video/video-controls-layer-creation.html
-    if (layer->renderer()->isVideo())
-        return false;
-
-    if (squashingWouldExceedSparsityTolerance(layer, squashingState))
-        return false;
-
-    // FIXME: this is not efficient, since it walks up the tree . We should store these values on the AncestorDependentPropertiesCache.
-    ASSERT(squashingState.hasMostRecentMapping);
-    const RenderLayer& squashingLayer = squashingState.mostRecentMapping->owningLayer();
-
-    if (layer->renderer()->clippingContainer() != squashingLayer.renderer()->clippingContainer())
-        return false;
-
-    // FIXME: this seems to be overly aggressive. clipsCompositingDescendants() should suffice. However, it does not fix all testcases,
-    // in particular crbug.com/366101.
-    if (layer->renderer()->hasClipOrOverflowClip())
-        return false;
-
-    if (layer->scrollsWithRespectTo(&squashingLayer))
-        return false;
-
-    const RenderLayer::AncestorDependentProperties& ancestorDependentProperties = layer->ancestorDependentProperties();
-    const RenderLayer::AncestorDependentProperties& squashingLayerAncestorDependentProperties = squashingLayer.ancestorDependentProperties();
-
-    if (ancestorDependentProperties.opacityAncestor != squashingLayerAncestorDependentProperties.opacityAncestor)
-        return false;
-
-    if (ancestorDependentProperties.transformAncestor != squashingLayerAncestorDependentProperties.transformAncestor)
-        return false;
-
-    if (ancestorDependentProperties.filterAncestor != squashingLayerAncestorDependentProperties.filterAncestor)
-        return false;
-
-    return true;
-}
-
-RenderLayerCompositor::CompositingStateTransitionType RenderLayerCompositor::computeCompositedLayerUpdate(RenderLayer* layer)
-{
-    CompositingStateTransitionType update = NoCompositingStateChange;
-    if (!layer->subtreeIsInvisible() && needsOwnBacking(layer)) {
-        if (!layer->hasCompositedLayerMapping()) {
-            update = AllocateOwnCompositedLayerMapping;
-        }
-    } else {
-        if (layer->hasCompositedLayerMapping())
-            update = RemoveOwnCompositedLayerMapping;
-
-        if (layerSquashingEnabled()) {
-            if (!layer->subtreeIsInvisible() && requiresSquashing(layer->compositingReasons())) {
-                // We can't compute at this time whether the squashing layer update is a no-op,
-                // since that requires walking the render layer tree.
-                update = PutInSquashingLayer;
-            } else if (layer->groupedMapping() || layer->lostGroupedMapping()) {
-                update = RemoveFromSquashingLayer;
-            }
-        }
-    }
-    return update;
-}
-
 // These are temporary hacks to work around chicken-egg issues while we continue to refactor the compositing code.
 // See crbug.com/339892 for a list of tests that fail if this method is removed.
 void RenderLayerCompositor::applyUpdateLayerCompositingStateChickenEggHacks(RenderLayer* layer, CompositingStateTransitionType compositedLayerUpdate)
@@ -768,7 +610,7 @@
 void RenderLayerCompositor::updateLayerCompositingState(RenderLayer* layer, UpdateLayerCompositingStateOptions options)
 {
     updateDirectCompositingReasons(layer);
-    CompositingStateTransitionType compositedLayerUpdate = computeCompositedLayerUpdate(layer);
+    CompositingStateTransitionType compositedLayerUpdate = CompositingLayerAssigner(this).computeCompositedLayerUpdate(layer);
 
     if (compositedLayerUpdate != NoCompositingStateChange) {
         setCompositingLayersNeedRebuild();
@@ -785,7 +627,7 @@
     if (layer->renderer() != &m_renderView && !layer->renderer()->parent())
         return;
 
-    RenderLayerModelObject* repaintContainer = layer->renderer()->containerForRepaint();
+    const RenderLayerModelObject* repaintContainer = layer->renderer()->containerForRepaint();
     ASSERT(repaintContainer);
     layer->repainter().repaintIncludingNonCompositingDescendants(repaintContainer);
 }
@@ -815,8 +657,6 @@
     if (!child->hasCompositedLayerMapping() || parent->renderer()->documentBeingDestroyed())
         return;
 
-    removeViewportConstrainedLayer(child);
-
     {
         // FIXME: This is called from within RenderLayer::removeChild, which is called from RenderObject::RemoveChild.
         // There's no guarantee that compositor state is up to date.
@@ -824,112 +664,9 @@
         repaintInCompositedAncestor(child, child->compositedLayerMapping()->compositedBounds());
     }
 
-    setCompositingParent(child, 0);
     setCompositingLayersNeedRebuild();
 }
 
-void RenderLayerCompositor::SquashingState::updateSquashingStateForNewMapping(CompositedLayerMappingPtr newCompositedLayerMapping, bool hasNewCompositedLayerMapping, LayoutPoint newOffsetFromTransformedAncestorForSquashingCLM)
-{
-    // The most recent backing is done accumulating any more squashing layers.
-    if (hasMostRecentMapping)
-        mostRecentMapping->finishAccumulatingSquashingLayers(nextSquashedLayerIndex);
-
-    nextSquashedLayerIndex = 0;
-    mostRecentMapping = newCompositedLayerMapping;
-    hasMostRecentMapping = hasNewCompositedLayerMapping;
-    offsetFromTransformedAncestorForSquashingCLM = newOffsetFromTransformedAncestorForSquashingCLM;
-}
-
-void RenderLayerCompositor::assignLayersToBackings(RenderLayer* updateRoot, bool& layersChanged)
-{
-    SquashingState squashingState;
-    assignLayersToBackingsInternal(updateRoot, squashingState, layersChanged);
-    if (squashingState.hasMostRecentMapping)
-        squashingState.mostRecentMapping->finishAccumulatingSquashingLayers(squashingState.nextSquashedLayerIndex);
-}
-
-void RenderLayerCompositor::assignLayersToBackingsForReflectionLayer(RenderLayer* reflectionLayer, bool& layersChanged)
-{
-    CompositingStateTransitionType compositedLayerUpdate = computeCompositedLayerUpdate(reflectionLayer);
-    if (compositedLayerUpdate != NoCompositingStateChange) {
-        layersChanged = true;
-        allocateOrClearCompositedLayerMapping(reflectionLayer, compositedLayerUpdate);
-    }
-    updateDirectCompositingReasons(reflectionLayer);
-    if (reflectionLayer->hasCompositedLayerMapping())
-        reflectionLayer->compositedLayerMapping()->updateGraphicsLayerConfiguration(GraphicsLayerUpdater::ForceUpdate);
-}
-
-void RenderLayerCompositor::assignLayersToBackingsInternal(RenderLayer* layer, SquashingState& squashingState, bool& layersChanged)
-{
-    if (layerSquashingEnabled() && requiresSquashing(layer->compositingReasons()) && !canSquashIntoCurrentSquashingOwner(layer, squashingState))
-        layer->setCompositingReasons(layer->compositingReasons() | CompositingReasonNoSquashingTargetFound);
-
-    CompositingStateTransitionType compositedLayerUpdate = computeCompositedLayerUpdate(layer);
-
-    if (allocateOrClearCompositedLayerMapping(layer, compositedLayerUpdate))
-        layersChanged = true;
-
-    // FIXME: special-casing reflection layers here is not right.
-    if (layer->reflectionInfo())
-        assignLayersToBackingsForReflectionLayer(layer->reflectionInfo()->reflectionLayer(), layersChanged);
-
-
-    // Add this layer to a squashing backing if needed.
-    if (layerSquashingEnabled()) {
-        if (updateSquashingAssignment(layer, squashingState, compositedLayerUpdate))
-            layersChanged = true;
-
-        const bool layerIsSquashed = compositedLayerUpdate == PutInSquashingLayer || (compositedLayerUpdate == NoCompositingStateChange && layer->groupedMapping());
-        if (layerIsSquashed) {
-            squashingState.nextSquashedLayerIndex++;
-            IntRect layerBounds = layer->ancestorDependentProperties().clippedAbsoluteBoundingBox;
-            squashingState.totalAreaOfSquashedRects += layerBounds.size().area();
-            squashingState.boundingRect.unite(layerBounds);
-        }
-    }
-
-    if (layer->stackingNode()->isStackingContainer()) {
-        RenderLayerStackingNodeIterator iterator(*layer->stackingNode(), NegativeZOrderChildren);
-        while (RenderLayerStackingNode* curNode = iterator.next())
-            assignLayersToBackingsInternal(curNode->layer(), squashingState, layersChanged);
-    }
-
-    if (layerSquashingEnabled()) {
-        // At this point, if the layer is to be "separately" composited, then its backing becomes the most recent in paint-order.
-        if (layer->compositingState() == PaintsIntoOwnBacking || layer->compositingState() == HasOwnBackingButPaintsIntoAncestor) {
-            ASSERT(!requiresSquashing(layer->compositingReasons()));
-            LayoutPoint offsetFromTransformedAncestorForSquashingCLM = layer->computeOffsetFromTransformedAncestor();
-            squashingState.updateSquashingStateForNewMapping(layer->compositedLayerMapping(), layer->hasCompositedLayerMapping(), offsetFromTransformedAncestorForSquashingCLM);
-        }
-    }
-
-    RenderLayerStackingNodeIterator iterator(*layer->stackingNode(), NormalFlowChildren | PositiveZOrderChildren);
-    while (RenderLayerStackingNode* curNode = iterator.next())
-        assignLayersToBackingsInternal(curNode->layer(), squashingState, layersChanged);
-}
-
-void RenderLayerCompositor::setCompositingParent(RenderLayer* childLayer, RenderLayer* parentLayer)
-{
-    ASSERT(!parentLayer || childLayer->ancestorCompositingLayer() == parentLayer);
-    ASSERT(childLayer->hasCompositedLayerMapping());
-
-    // It's possible to be called with a parent that isn't yet composited when we're doing
-    // partial updates as required by painting or hit testing. Just bail in that case;
-    // we'll do a full layer update soon.
-    if (!parentLayer || !parentLayer->hasCompositedLayerMapping())
-        return;
-
-    if (parentLayer) {
-        GraphicsLayer* hostingLayer = parentLayer->compositedLayerMapping()->parentForSublayers();
-        GraphicsLayer* hostedLayer = childLayer->compositedLayerMapping()->childForSuperlayers();
-
-        hostingLayer->addChild(hostedLayer);
-    } else {
-        childLayer->compositedLayerMapping()->childForSuperlayers()->removeFromParent();
-    }
-}
-
 void RenderLayerCompositor::frameViewDidChangeLocation(const IntPoint& contentsOffset)
 {
     if (m_overflowControlsHostLayer)
@@ -1181,22 +918,9 @@
 void RenderLayerCompositor::updateDirectCompositingReasons(RenderLayer* layer)
 {
     CompositingReasons reasons = m_compositingReasonFinder.directReasons(layer, &m_needsToRecomputeCompositingRequirements);
-    if (layer->suppressingCompositedLayerCreation())
-        reasons = m_compositingReasonFinder.suppressWillChangeAndAnimationForGpuRasterization(layer, reasons);
     layer->setCompositingReasons(reasons, CompositingReasonComboAllDirectReasons);
 }
 
-bool RenderLayerCompositor::needsOwnBacking(const RenderLayer* layer) const
-{
-    if (!canBeComposited(layer))
-        return false;
-
-    // If squashing is disabled, then layers that would have been squashed should just be separately composited.
-    bool needsOwnBackingForDisabledSquashing = !layerSquashingEnabled() && requiresSquashing(layer->compositingReasons());
-
-    return requiresCompositing(layer->compositingReasons()) || needsOwnBackingForDisabledSquashing || (staleInCompositingMode() && layer->isRootLayer());
-}
-
 bool RenderLayerCompositor::canBeComposited(const RenderLayer* layer) const
 {
     // FIXME: We disable accelerated compositing for elements in a RenderFlowThread as it doesn't work properly.
@@ -1409,6 +1133,9 @@
     if (requiresHorizontalScrollbarLayer()) {
         if (!m_layerForHorizontalScrollbar) {
             m_layerForHorizontalScrollbar = GraphicsLayer::create(graphicsLayerFactory(), this);
+        }
+
+        if (m_layerForHorizontalScrollbar->parent() != controlsParent) {
             controlsParent->addChild(m_layerForHorizontalScrollbar.get());
 
             if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator())
@@ -1425,6 +1152,9 @@
     if (requiresVerticalScrollbarLayer()) {
         if (!m_layerForVerticalScrollbar) {
             m_layerForVerticalScrollbar = GraphicsLayer::create(graphicsLayerFactory(), this);
+        }
+
+        if (m_layerForVerticalScrollbar->parent() != controlsParent) {
             controlsParent->addChild(m_layerForVerticalScrollbar.get());
 
             if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator())
@@ -1647,27 +1377,6 @@
     }
 }
 
-void RenderLayerCompositor::updateViewportConstraintStatus(RenderLayer* layer)
-{
-    if (CompositingReasonFinder::isViewportConstrainedFixedOrStickyLayer(layer))
-        addViewportConstrainedLayer(layer);
-    else
-        removeViewportConstrainedLayer(layer);
-}
-
-void RenderLayerCompositor::addViewportConstrainedLayer(RenderLayer* layer)
-{
-    m_viewportConstrainedLayers.add(layer);
-}
-
-void RenderLayerCompositor::removeViewportConstrainedLayer(RenderLayer* layer)
-{
-    if (!m_viewportConstrainedLayers.contains(layer))
-        return;
-
-    m_viewportConstrainedLayers.remove(layer);
-}
-
 ScrollingCoordinator* RenderLayerCompositor::scrollingCoordinator() const
 {
     if (Page* page = this->page())
diff --git a/Source/core/rendering/compositing/RenderLayerCompositor.h b/Source/core/rendering/compositing/RenderLayerCompositor.h
index b6c1ab6..d08fa0c 100644
--- a/Source/core/rendering/compositing/RenderLayerCompositor.h
+++ b/Source/core/rendering/compositing/RenderLayerCompositor.h
@@ -47,11 +47,19 @@
 
 enum CompositingUpdateType {
     CompositingUpdateNone,
+    CompositingUpdateOnCompositedScroll,
+    CompositingUpdateAfterCompositingInputChange,
     CompositingUpdateAfterStyleChange,
     CompositingUpdateAfterLayout,
     CompositingUpdateOnScroll,
-    CompositingUpdateOnCompositedScroll,
-    CompositingUpdateAfterCanvasContextChange,
+};
+
+enum CompositingStateTransitionType {
+    NoCompositingStateChange,
+    AllocateOwnCompositedLayerMapping,
+    RemoveOwnCompositedLayerMapping,
+    PutInSquashingLayer,
+    RemoveFromSquashingLayer
 };
 
 // RenderLayerCompositor manages the hierarchy of
@@ -87,8 +95,6 @@
 
     bool acceleratedCompositingForOverflowScrollEnabled() const;
 
-    bool canRender3DTransforms() const;
-
     bool rootShouldAlwaysComposite() const;
 
     // Copy the accelerated compositing related flags from Settings
@@ -178,9 +184,6 @@
     GraphicsLayer* layerForVerticalScrollbar() const { return m_layerForVerticalScrollbar.get(); }
     GraphicsLayer* layerForScrollCorner() const { return m_layerForScrollCorner.get(); }
 
-    void updateViewportConstraintStatus(RenderLayer*);
-    void removeViewportConstrainedLayer(RenderLayer*);
-
     void addOutOfFlowPositionedLayer(RenderLayer*);
     void removeOutOfFlowPositionedLayer(RenderLayer*);
 
@@ -198,51 +201,17 @@
     // Whether the layer could ever be composited.
     bool canBeComposited(const RenderLayer*) const;
 
+    // FIXME: Move allocateOrClearCompositedLayerMapping to CompositingLayerAssigner once we've fixed
+    // the compositing chicken/egg issues.
+    bool allocateOrClearCompositedLayerMapping(RenderLayer*, CompositingStateTransitionType compositedLayerUpdate);
+
+    void updateDirectCompositingReasons(RenderLayer*);
+
 private:
     class OverlapMap;
 
-    enum CompositingStateTransitionType {
-        NoCompositingStateChange,
-        AllocateOwnCompositedLayerMapping,
-        RemoveOwnCompositedLayerMapping,
-        PutInSquashingLayer,
-        RemoveFromSquashingLayer
-    };
-
-    struct SquashingState {
-        SquashingState()
-            : mostRecentMapping(0)
-            , hasMostRecentMapping(false)
-            , nextSquashedLayerIndex(0)
-            , totalAreaOfSquashedRects(0) { }
-
-        void updateSquashingStateForNewMapping(CompositedLayerMappingPtr, bool hasNewCompositedLayerMapping, LayoutPoint newOffsetFromTransformedAncestorForSquashingCLM);
-
-        // The most recent composited backing that the layer should squash onto if needed.
-        CompositedLayerMappingPtr mostRecentMapping;
-        bool hasMostRecentMapping;
-
-        // Coordinates of the compositedLayerMapping's owning layer in the space of the transformed ancestor. This is used for computing the correct
-        // positions of renderlayers when they paint into the squashing layer.
-        LayoutPoint offsetFromTransformedAncestorForSquashingCLM;
-
-        // Counter that tracks what index the next RenderLayer would be if it gets squashed to the current squashing layer.
-        size_t nextSquashedLayerIndex;
-
-        // The absolute bounding rect of all the squashed layers.
-        IntRect boundingRect;
-
-        // This is simply the sum of the areas of the squashed rects. This can be very skewed if the rects overlap,
-        // but should be close enough to drive a heuristic.
-        uint64_t totalAreaOfSquashedRects;
-    };
-
     bool hasUnresolvedDirtyBits();
 
-    bool squashingWouldExceedSparsityTolerance(const RenderLayer* candidate, const SquashingState&);
-    bool canSquashIntoCurrentSquashingOwner(const RenderLayer* candidate, const SquashingState&);
-
-    CompositingStateTransitionType computeCompositedLayerUpdate(RenderLayer*);
     // Make updates to the layer based on viewport-constrained properties such as position:fixed. This can in turn affect
     // compositing.
     bool updateLayerIfViewportConstrained(RenderLayer*);
@@ -256,25 +225,12 @@
     // Whether the given RL needs to paint into its own separate backing (and hence would need its own CompositedLayerMapping).
     bool needsOwnBacking(const RenderLayer*) const;
 
-    void updateDirectCompositingReasons(RenderLayer*);
-
     void updateIfNeeded();
 
-    // Make or destroy the CompositedLayerMapping for this layer; returns true if the compositedLayerMapping changed.
-    bool allocateOrClearCompositedLayerMapping(RenderLayer*, CompositingStateTransitionType compositedLayerUpdate);
-    bool updateSquashingAssignment(RenderLayer*, SquashingState&, CompositingStateTransitionType compositedLayerUpdate);
-
     void recursiveRepaintLayer(RenderLayer*);
 
     void computeCompositingRequirements(RenderLayer* ancestorLayer, RenderLayer*, OverlapMap&, struct CompositingRecursionData&, bool& descendantHas3DTransform, Vector<RenderLayer*>& unclippedDescendants, IntRect& absoluteDecendantBoundingBox);
 
-    // Defines which RenderLayers will paint into which composited backings, by allocating and destroying CompositedLayerMappings as needed.
-    void assignLayersToBackings(RenderLayer*, bool& layersChanged);
-    void assignLayersToBackingsInternal(RenderLayer*, SquashingState&, bool& layersChanged);
-
-    // Hook compositing layers together
-    void setCompositingParent(RenderLayer* childLayer, RenderLayer* parentLayer);
-
     bool hasAnyAdditionalCompositedLayers(const RenderLayer* rootLayer) const;
 
     void ensureRootLayer();
@@ -292,8 +248,6 @@
     GraphicsLayerFactory* graphicsLayerFactory() const;
     ScrollingCoordinator* scrollingCoordinator() const;
 
-    void addViewportConstrainedLayer(RenderLayer*);
-
     bool compositingLayersNeedRebuild();
 
     void enableCompositingModeIfNeeded();
@@ -306,7 +260,6 @@
 #endif
 
     void applyUpdateLayerCompositingStateChickenEggHacks(RenderLayer*, CompositingStateTransitionType compositedLayerUpdate);
-    void assignLayersToBackingsForReflectionLayer(RenderLayer* reflectionLayer, bool& layersChanged);
 
     DocumentLifecycle& lifecycle() const;
 
@@ -341,9 +294,6 @@
     OwnPtr<GraphicsLayer> m_containerLayer;
     OwnPtr<GraphicsLayer> m_scrollLayer;
 
-    HashSet<RenderLayer*> m_viewportConstrainedLayers;
-    HashSet<RenderLayer*> m_viewportConstrainedLayersNeedingUpdate;
-
     // This is used in updateCompositingRequirementsState to avoid full tree
     // walks while determining if layers have unclipped descendants.
     HashSet<RenderLayer*> m_outOfFlowPositionedLayers;
diff --git a/Source/core/rendering/shapes/BoxShape.cpp b/Source/core/rendering/shapes/BoxShape.cpp
index fe82e85..bba8027 100644
--- a/Source/core/rendering/shapes/BoxShape.cpp
+++ b/Source/core/rendering/shapes/BoxShape.cpp
@@ -100,4 +100,11 @@
     result.append(LineSegment(x1, x2));
 }
 
+void BoxShape::buildDisplayPaths(DisplayPaths& paths) const
+{
+    paths.shape.addRoundedRect(m_bounds.rect(), m_bounds.radii().topLeft(), m_bounds.radii().topRight(), m_bounds.radii().bottomLeft(), m_bounds.radii().bottomRight());
+    if (shapeMargin())
+        paths.marginShape.addRoundedRect(shapeMarginBounds().rect(), shapeMarginBounds().radii().topLeft(), shapeMarginBounds().radii().topRight(), shapeMarginBounds().radii().bottomLeft(), shapeMarginBounds().radii().bottomRight());
+}
+
 } // namespace WebCore
diff --git a/Source/core/rendering/shapes/BoxShape.h b/Source/core/rendering/shapes/BoxShape.h
index 42ce2e8..06a5148 100644
--- a/Source/core/rendering/shapes/BoxShape.h
+++ b/Source/core/rendering/shapes/BoxShape.h
@@ -46,6 +46,7 @@
     virtual LayoutRect shapeMarginLogicalBoundingBox() const OVERRIDE;
     virtual bool isEmpty() const OVERRIDE { return m_bounds.isEmpty(); }
     virtual void getExcludedIntervals(LayoutUnit logicalTop, LayoutUnit logicalHeight, SegmentList&) const OVERRIDE;
+    virtual void buildDisplayPaths(DisplayPaths&) const OVERRIDE;
 
 private:
     FloatRoundedRect shapeMarginBounds() const;
diff --git a/Source/core/rendering/shapes/PolygonShape.cpp b/Source/core/rendering/shapes/PolygonShape.cpp
index 0160f85..17f9df0 100644
--- a/Source/core/rendering/shapes/PolygonShape.cpp
+++ b/Source/core/rendering/shapes/PolygonShape.cpp
@@ -150,4 +150,14 @@
         result.append(LineSegment(excludedInterval.x1(), excludedInterval.x2()));
 }
 
+void PolygonShape::buildDisplayPaths(DisplayPaths& paths) const
+{
+    if (!m_polygon.numberOfVertices())
+        return;
+    paths.shape.moveTo(m_polygon.vertexAt(0));
+    for (size_t i = 1; i < m_polygon.numberOfVertices(); ++i)
+        paths.shape.addLineTo(m_polygon.vertexAt(i));
+    paths.shape.closeSubpath();
+}
+
 } // namespace WebCore
diff --git a/Source/core/rendering/shapes/PolygonShape.h b/Source/core/rendering/shapes/PolygonShape.h
index 35d7efe..f7171c9 100644
--- a/Source/core/rendering/shapes/PolygonShape.h
+++ b/Source/core/rendering/shapes/PolygonShape.h
@@ -69,6 +69,7 @@
     virtual LayoutRect shapeMarginLogicalBoundingBox() const OVERRIDE;
     virtual bool isEmpty() const OVERRIDE { return m_polygon.isEmpty(); }
     virtual void getExcludedIntervals(LayoutUnit logicalTop, LayoutUnit logicalHeight, SegmentList&) const OVERRIDE;
+    virtual void buildDisplayPaths(DisplayPaths&) const OVERRIDE;
 
 private:
     FloatPolygon m_polygon;
diff --git a/Source/core/rendering/shapes/RasterShape.cpp b/Source/core/rendering/shapes/RasterShape.cpp
index 4f2e6fc..be9d2ea 100644
--- a/Source/core/rendering/shapes/RasterShape.cpp
+++ b/Source/core/rendering/shapes/RasterShape.cpp
@@ -118,6 +118,24 @@
     }
 }
 
+void RasterShapeIntervals::buildBoundsPath(Path& path) const
+{
+    int maxY = bounds().maxY();
+    for (int y = bounds().y(); y < maxY; y++) {
+        if (intervalAt(y).isEmpty())
+            continue;
+
+        IntShapeInterval extent = intervalAt(y);
+        int endY = y + 1;
+        for (; endY < maxY; endY++) {
+            if (intervalAt(endY).isEmpty() || intervalAt(endY) != extent)
+                break;
+        }
+        path.addRect(FloatRect(extent.x1(), y, extent.width(), endY - y));
+        y = endY - 1;
+    }
+}
+
 const RasterShapeIntervals& RasterShape::marginIntervals() const
 {
     ASSERT(shapeMargin() >= 0);
diff --git a/Source/core/rendering/shapes/RasterShape.h b/Source/core/rendering/shapes/RasterShape.h
index c66de84..f5a09d3 100644
--- a/Source/core/rendering/shapes/RasterShape.h
+++ b/Source/core/rendering/shapes/RasterShape.h
@@ -90,6 +90,12 @@
     virtual LayoutRect shapeMarginLogicalBoundingBox() const OVERRIDE { return static_cast<LayoutRect>(marginIntervals().bounds()); }
     virtual bool isEmpty() const OVERRIDE { return m_intervals->isEmpty(); }
     virtual void getExcludedIntervals(LayoutUnit logicalTop, LayoutUnit logicalHeight, SegmentList&) const OVERRIDE;
+    virtual void buildDisplayPaths(DisplayPaths& paths) const OVERRIDE
+    {
+        m_intervals->buildBoundsPath(paths.shape);
+        if (shapeMargin())
+            marginIntervals().buildBoundsPath(paths.marginShape);
+    }
 
 private:
     const RasterShapeIntervals& marginIntervals() const;
diff --git a/Source/core/rendering/shapes/RectangleShape.cpp b/Source/core/rendering/shapes/RectangleShape.cpp
index 5cf74cb..eaf5142 100644
--- a/Source/core/rendering/shapes/RectangleShape.cpp
+++ b/Source/core/rendering/shapes/RectangleShape.cpp
@@ -88,4 +88,11 @@
     result.append(LineSegment(x1, x2));
 }
 
+void RectangleShape::buildDisplayPaths(DisplayPaths& paths) const
+{
+    paths.shape.addRoundedRect(m_bounds, m_radii);
+    if (shapeMargin())
+        paths.marginShape.addRoundedRect(shapeMarginBounds(), FloatSize(m_radii.width() + shapeMargin(), m_radii.height() + shapeMargin()));
+}
+
 } // namespace WebCore
diff --git a/Source/core/rendering/shapes/RectangleShape.h b/Source/core/rendering/shapes/RectangleShape.h
index 3ed2156..d47471d 100644
--- a/Source/core/rendering/shapes/RectangleShape.h
+++ b/Source/core/rendering/shapes/RectangleShape.h
@@ -51,6 +51,7 @@
     virtual LayoutRect shapeMarginLogicalBoundingBox() const OVERRIDE { return static_cast<LayoutRect>(shapeMarginBounds()); }
     virtual bool isEmpty() const OVERRIDE { return m_bounds.isEmpty(); }
     virtual void getExcludedIntervals(LayoutUnit logicalTop, LayoutUnit logicalHeight, SegmentList&) const OVERRIDE;
+    virtual void buildDisplayPaths(DisplayPaths&) const OVERRIDE;
 
 private:
     FloatRect shapeMarginBounds() const;
diff --git a/Source/core/rendering/shapes/Shape.h b/Source/core/rendering/shapes/Shape.h
index 3c51dab..fb64995 100644
--- a/Source/core/rendering/shapes/Shape.h
+++ b/Source/core/rendering/shapes/Shape.h
@@ -34,6 +34,7 @@
 #include "core/rendering/style/StyleImage.h"
 #include "platform/geometry/LayoutRect.h"
 #include "platform/geometry/RoundedRect.h"
+#include "platform/graphics/Path.h"
 #include "platform/text/WritingMode.h"
 #include "wtf/PassOwnPtr.h"
 #include "wtf/Vector.h"
@@ -61,6 +62,10 @@
 
 class Shape {
 public:
+    struct DisplayPaths {
+        Path shape;
+        Path marginShape;
+    };
     static PassOwnPtr<Shape> createShape(const BasicShape*, const LayoutSize& logicalBoxSize, WritingMode, float margin);
     static PassOwnPtr<Shape> createRasterShape(Image*, float threshold, const LayoutRect& imageRect, const LayoutRect& marginRect, WritingMode, float margin);
     static PassOwnPtr<Shape> createLayoutBoxShape(const RoundedRect&, WritingMode, float margin);
@@ -72,6 +77,7 @@
     virtual void getExcludedIntervals(LayoutUnit logicalTop, LayoutUnit logicalHeight, SegmentList&) const = 0;
 
     bool lineOverlapsShapeMarginBounds(LayoutUnit lineTop, LayoutUnit lineHeight) const { return lineOverlapsBoundingBox(lineTop, lineHeight, shapeMarginLogicalBoundingBox()); }
+    virtual void buildDisplayPaths(DisplayPaths&) const = 0;
 
 protected:
     float shapeMargin() const { return m_margin; }
diff --git a/Source/core/rendering/shapes/ShapeOutsideInfo.cpp b/Source/core/rendering/shapes/ShapeOutsideInfo.cpp
index 303ce29..fabf6fa 100644
--- a/Source/core/rendering/shapes/ShapeOutsideInfo.cpp
+++ b/Source/core/rendering/shapes/ShapeOutsideInfo.cpp
@@ -317,4 +317,39 @@
     }
 }
 
+LayoutRect ShapeOutsideInfo::computedShapePhysicalBoundingBox() const
+{
+    LayoutRect physicalBoundingBox = computedShape().shapeMarginLogicalBoundingBox();
+    physicalBoundingBox.setX(physicalBoundingBox.x() + logicalLeftOffset());
+
+    if (m_renderer.style()->isFlippedBlocksWritingMode())
+        physicalBoundingBox.setY(m_renderer.logicalHeight() - physicalBoundingBox.maxY());
+    else
+        physicalBoundingBox.setY(physicalBoundingBox.y() + logicalTopOffset());
+
+    if (!m_renderer.style()->isHorizontalWritingMode())
+        physicalBoundingBox = physicalBoundingBox.transposedRect();
+    else
+        physicalBoundingBox.setY(physicalBoundingBox.y() + logicalTopOffset());
+
+    return physicalBoundingBox;
+}
+
+FloatPoint ShapeOutsideInfo::shapeToRendererPoint(FloatPoint point) const
+{
+    FloatPoint result = FloatPoint(point.x() + logicalLeftOffset(), point.y() + logicalTopOffset());
+    if (m_renderer.style()->isFlippedBlocksWritingMode())
+        result.setY(m_renderer.logicalHeight() - result.y());
+    if (!m_renderer.style()->isHorizontalWritingMode())
+        result = result.transposedPoint();
+    return result;
+}
+
+FloatSize ShapeOutsideInfo::shapeToRendererSize(FloatSize size) const
+{
+    if (!m_renderer.style()->isHorizontalWritingMode())
+        return size.transposedSize();
+    return size;
+}
+
 }
diff --git a/Source/core/rendering/shapes/ShapeOutsideInfo.h b/Source/core/rendering/shapes/ShapeOutsideInfo.h
index 2ff53d9..cbc95ac 100644
--- a/Source/core/rendering/shapes/ShapeOutsideInfo.h
+++ b/Source/core/rendering/shapes/ShapeOutsideInfo.h
@@ -89,14 +89,18 @@
     bool isShapeDirty() { return !m_shape.get(); }
     LayoutSize shapeSize() const { return m_referenceBoxLogicalSize; }
 
-private:
+    LayoutRect computedShapePhysicalBoundingBox() const;
+    FloatPoint shapeToRendererPoint(FloatPoint) const;
+    FloatSize shapeToRendererSize(FloatSize) const;
+    const Shape& computedShape() const;
+
+protected:
     ShapeOutsideInfo(const RenderBox& renderer)
         : m_renderer(renderer)
         , m_lineOverlapsShape(false)
     { }
 
-    const Shape& computedShape() const;
-
+private:
     LayoutUnit logicalTopOffset() const;
     LayoutUnit logicalLeftOffset() const;
 
diff --git a/Source/core/rendering/style/DataEquivalency.h b/Source/core/rendering/style/DataEquivalency.h
new file mode 100644
index 0000000..87d9238
--- /dev/null
+++ b/Source/core/rendering/style/DataEquivalency.h
@@ -0,0 +1,49 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef DataEquivalency_h
+#define DataEquivalency_h
+
+#include "wtf/OwnPtr.h"
+#include "wtf/RefPtr.h"
+
+namespace WebCore {
+
+template <typename T>
+bool dataEquivalent(const T* a, const T* b)
+{
+    if (a == b)
+        return true;
+    if (!a || !b)
+        return false;
+    return *a == *b;
+}
+
+template <typename T>
+bool dataEquivalent(const RefPtr<T>& a, const RefPtr<T>& b)
+{
+    return dataEquivalent(a.get(), b.get());
+}
+
+template <typename T>
+bool dataEquivalent(const Persistent<T>& a, const Persistent<T>& b)
+{
+    return dataEquivalent(a.get(), b.get());
+}
+
+template <typename T>
+bool dataEquivalent(const Member<T>& a, const Member<T>& b)
+{
+    return dataEquivalent(a.get(), b.get());
+}
+
+template <typename T>
+bool dataEquivalent(const OwnPtr<T>& a, const OwnPtr<T>& b)
+{
+    return dataEquivalent(a.get(), b.get());
+}
+
+} // namespace WebCore
+
+#endif // DataEquivalency_h
diff --git a/Source/core/rendering/style/FillLayer.cpp b/Source/core/rendering/style/FillLayer.cpp
index 0df7e95..907a80d 100644
--- a/Source/core/rendering/style/FillLayer.cpp
+++ b/Source/core/rendering/style/FillLayer.cpp
@@ -22,6 +22,8 @@
 #include "config.h"
 #include "core/rendering/style/FillLayer.h"
 
+#include "core/rendering/style/DataEquivalency.h"
+
 namespace WebCore {
 
 struct SameSizeAsFillLayer {
@@ -159,7 +161,7 @@
 {
     // We do not check the "isSet" booleans for each property, since those are only used during initial construction
     // to propagate patterns into layers.  All layer comparisons happen after values have all been filled in anyway.
-    return StyleImage::imagesEquivalent(m_image.get(), o.m_image.get()) && m_xPosition == o.m_xPosition && m_yPosition == o.m_yPosition
+    return dataEquivalent(m_image, o.m_image) && m_xPosition == o.m_xPosition && m_yPosition == o.m_yPosition
             && m_backgroundXOrigin == o.m_backgroundXOrigin && m_backgroundYOrigin == o.m_backgroundYOrigin
             && m_attachment == o.m_attachment && m_clip == o.m_clip && m_composite == o.m_composite
             && m_blendMode == o.m_blendMode && m_origin == o.m_origin && m_repeatX == o.m_repeatX
diff --git a/Source/core/rendering/style/GridCoordinate.h b/Source/core/rendering/style/GridCoordinate.h
index b64eea4..196a7e3 100644
--- a/Source/core/rendering/style/GridCoordinate.h
+++ b/Source/core/rendering/style/GridCoordinate.h
@@ -82,10 +82,10 @@
         }
 
         size_t gridLineIndex = std::max<int>(0, firstLineBeforeOppositePositionIndex - position.spanPosition() + 1);
-        size_t resolvedGridLinePosition = gridLines[gridLineIndex];
-        if (resolvedGridLinePosition > resolvedOppositePosition.toInt())
-            resolvedGridLinePosition = resolvedOppositePosition.toInt();
-        return GridSpan::create(GridResolvedPosition(resolvedGridLinePosition), resolvedOppositePosition);
+        GridResolvedPosition resolvedGridLinePosition = GridResolvedPosition(gridLines[gridLineIndex]);
+        if (resolvedGridLinePosition > resolvedOppositePosition)
+            resolvedGridLinePosition = resolvedOppositePosition;
+        return GridSpan::create(resolvedGridLinePosition, resolvedOppositePosition);
     }
 
     static PassOwnPtr<GridSpan> createWithFinalNamedSpanAgainstOpposite(const GridResolvedPosition& resolvedOppositePosition, const GridPosition& position, const Vector<size_t>& gridLines)
@@ -96,10 +96,9 @@
             firstLineAfterOppositePositionIndex = firstLineAfterOppositePosition - gridLines.begin();
 
         size_t gridLineIndex = std::min(gridLines.size() - 1, firstLineAfterOppositePositionIndex + position.spanPosition() - 1);
-        size_t resolvedGridLinePositionInteger = GridResolvedPosition::adjustGridPositionForAfterEndSide(gridLines[gridLineIndex]);
-        GridResolvedPosition resolvedGridLinePosition = GridResolvedPosition(resolvedGridLinePositionInteger);
-        if (resolvedGridLinePosition < resolvedOppositePosition.toInt())
-            resolvedGridLinePosition = resolvedOppositePosition.toInt();
+        GridResolvedPosition resolvedGridLinePosition = GridResolvedPosition::adjustGridPositionForAfterEndSide(gridLines[gridLineIndex]);
+        if (resolvedGridLinePosition < resolvedOppositePosition)
+            resolvedGridLinePosition = resolvedOppositePosition;
         return GridSpan::create(resolvedOppositePosition, resolvedGridLinePosition);
     }
 
diff --git a/Source/core/rendering/style/GridResolvedPosition.h b/Source/core/rendering/style/GridResolvedPosition.h
index 9de016b..7a959cb 100644
--- a/Source/core/rendering/style/GridResolvedPosition.h
+++ b/Source/core/rendering/style/GridResolvedPosition.h
@@ -29,18 +29,18 @@
 // Wraps a size_t integer just for the purpose of knowing what we manipulate in the grid code.
 class GridResolvedPosition {
 public:
-    static size_t adjustGridPositionForAfterEndSide(size_t resolvedPosition)
+    static GridResolvedPosition adjustGridPositionForAfterEndSide(size_t resolvedPosition)
     {
-        return resolvedPosition ? resolvedPosition - 1 : 0;
+        return resolvedPosition ? GridResolvedPosition(resolvedPosition - 1) : GridResolvedPosition(0);
     }
 
-    static size_t adjustGridPositionForSide(size_t resolvedPosition, GridPositionSide side)
+    static GridResolvedPosition adjustGridPositionForSide(size_t resolvedPosition, GridPositionSide side)
     {
         // An item finishing on the N-th line belongs to the N-1-th cell.
         if (side == ColumnEndSide || side == RowEndSide)
             return adjustGridPositionForAfterEndSide(resolvedPosition);
 
-        return resolvedPosition;
+        return GridResolvedPosition(resolvedPosition);
     }
 
     static GridSpan resolveGridPositionsFromAutoPlacementPosition(const RenderBox&, GridTrackSizingDirection, const GridResolvedPosition&);
@@ -60,7 +60,7 @@
         ASSERT(position.integerPosition());
         size_t integerPosition = position.integerPosition() - 1;
 
-        m_integerPosition = adjustGridPositionForSide(integerPosition, side);
+        m_integerPosition = adjustGridPositionForSide(integerPosition, side).toInt();
     }
 
     GridResolvedPosition& operator++()
diff --git a/Source/core/rendering/style/NinePieceImage.cpp b/Source/core/rendering/style/NinePieceImage.cpp
index 7dc3446..12c0508 100644
--- a/Source/core/rendering/style/NinePieceImage.cpp
+++ b/Source/core/rendering/style/NinePieceImage.cpp
@@ -24,6 +24,8 @@
 #include "config.h"
 #include "core/rendering/style/NinePieceImage.h"
 
+#include "core/rendering/style/DataEquivalency.h"
+
 namespace WebCore {
 
 static DataRef<NinePieceImageData>& defaultData()
@@ -76,7 +78,7 @@
 
 bool NinePieceImageData::operator==(const NinePieceImageData& other) const
 {
-    return StyleImage::imagesEquivalent(image.get(), other.image.get())
+    return dataEquivalent(image, other.image)
         && imageSlices == other.imageSlices
         && fill == other.fill
         && borderSlices == other.borderSlices
diff --git a/Source/core/rendering/style/QuotesData.cpp b/Source/core/rendering/style/QuotesData.cpp
index 5686176..5ec5c0c 100644
--- a/Source/core/rendering/style/QuotesData.cpp
+++ b/Source/core/rendering/style/QuotesData.cpp
@@ -64,14 +64,4 @@
     return m_quotePairs.at(index).second;
 }
 
-bool QuotesData::operator==(const QuotesData* a)
-{
-    return m_quotePairs == a->m_quotePairs;
-}
-
-bool QuotesData::operator!=(const QuotesData* a)
-{
-    return m_quotePairs != a->m_quotePairs;
-}
-
 } // namespace WebCore
diff --git a/Source/core/rendering/style/QuotesData.h b/Source/core/rendering/style/QuotesData.h
index 88a2b6f..f8db17b 100644
--- a/Source/core/rendering/style/QuotesData.h
+++ b/Source/core/rendering/style/QuotesData.h
@@ -35,8 +35,8 @@
     static PassRefPtr<QuotesData> create(const String open, const String close);
     static PassRefPtr<QuotesData> create(UChar open1, UChar close1, UChar open2, UChar close2);
 
-    bool operator==(const QuotesData*);
-    bool operator!=(const QuotesData*);
+    bool operator==(const QuotesData& o) const { return m_quotePairs == o.m_quotePairs; }
+    bool operator!=(const QuotesData& o) const { return !(*this == o); }
 
     void addPair(const std::pair<String, String> quotePair);
     const String getOpenQuote(int index) const;
diff --git a/Source/core/rendering/style/RenderStyle.cpp b/Source/core/rendering/style/RenderStyle.cpp
index f47362a..3e45a0c 100644
--- a/Source/core/rendering/style/RenderStyle.cpp
+++ b/Source/core/rendering/style/RenderStyle.cpp
@@ -531,7 +531,7 @@
         if (!rareInheritedData->shadowDataEquivalent(*other.rareInheritedData.get()))
             return true;
 
-        if (rareInheritedData->quotes.get() != other.rareInheritedData->quotes.get())
+        if (!rareInheritedData->quotesDataEquivalent(*other.rareInheritedData.get()))
             return true;
     }
 
@@ -540,10 +540,10 @@
 
     if (inherited.get() != other.inherited.get()) {
         if (inherited->line_height != other.inherited->line_height
-        || inherited->font != other.inherited->font
-        || inherited->horizontal_border_spacing != other.inherited->horizontal_border_spacing
-        || inherited->vertical_border_spacing != other.inherited->vertical_border_spacing)
-        return true;
+            || inherited->font != other.inherited->font
+            || inherited->horizontal_border_spacing != other.inherited->horizontal_border_spacing
+            || inherited->vertical_border_spacing != other.inherited->vertical_border_spacing)
+            return true;
     }
 
     if (inherited_flags._box_direction != other.inherited_flags._box_direction
@@ -608,13 +608,16 @@
     if (position() != StaticPosition && (visual->clip != other.visual->clip || visual->hasClip != other.visual->hasClip))
         return true;
 
-    if (RuntimeEnabledFeatures::cssCompositingEnabled() && (rareNonInheritedData->m_effectiveBlendMode != other.rareNonInheritedData->m_effectiveBlendMode
-        || rareNonInheritedData->m_isolation != other.rareNonInheritedData->m_isolation))
-        return true;
+    if (rareNonInheritedData.get() != other.rareNonInheritedData.get()) {
+        if (RuntimeEnabledFeatures::cssCompositingEnabled()
+            && (rareNonInheritedData->m_effectiveBlendMode != other.rareNonInheritedData->m_effectiveBlendMode
+                || rareNonInheritedData->m_isolation != other.rareNonInheritedData->m_isolation))
+            return true;
 
-    if (rareNonInheritedData->m_mask != other.rareNonInheritedData->m_mask
-        || rareNonInheritedData->m_maskBoxImage != other.rareNonInheritedData->m_maskBoxImage)
-        return true;
+        if (rareNonInheritedData->m_mask != other.rareNonInheritedData->m_mask
+            || rareNonInheritedData->m_maskBoxImage != other.rareNonInheritedData->m_maskBoxImage)
+            return true;
+    }
 
     return false;
 }
@@ -625,21 +628,25 @@
         || inherited_flags.m_printColorAdjust != other.inherited_flags.m_printColorAdjust
         || inherited_flags._insideLink != other.inherited_flags._insideLink
         || !surround->border.visuallyEqual(other.surround->border)
-        || !m_background->visuallyEqual(*other.m_background)
-        || rareInheritedData->userModify != other.rareInheritedData->userModify
-        || rareInheritedData->userSelect != other.rareInheritedData->userSelect
-        || rareNonInheritedData->userDrag != other.rareNonInheritedData->userDrag
-        || rareNonInheritedData->m_borderFit != other.rareNonInheritedData->m_borderFit
-        || rareNonInheritedData->m_objectFit != other.rareNonInheritedData->m_objectFit
-        || rareNonInheritedData->m_objectPosition != other.rareNonInheritedData->m_objectPosition
-        || rareInheritedData->m_imageRendering != other.rareInheritedData->m_imageRendering)
+        || !m_background->visuallyEqual(*other.m_background))
         return true;
 
-    if (rareNonInheritedData->m_shapeOutside != other.rareNonInheritedData->m_shapeOutside)
-        return true;
+    if (rareInheritedData.get() != other.rareInheritedData.get()) {
+        if (rareInheritedData->userModify != other.rareInheritedData->userModify
+            || rareInheritedData->userSelect != other.rareInheritedData->userSelect
+            || rareInheritedData->m_imageRendering != other.rareInheritedData->m_imageRendering)
+            return true;
+    }
 
-    if (rareNonInheritedData->m_clipPath != other.rareNonInheritedData->m_clipPath)
-        return true;
+    if (rareNonInheritedData.get() != other.rareNonInheritedData.get()) {
+        if (rareNonInheritedData->userDrag != other.rareNonInheritedData->userDrag
+            || rareNonInheritedData->m_borderFit != other.rareNonInheritedData->m_borderFit
+            || rareNonInheritedData->m_objectFit != other.rareNonInheritedData->m_objectFit
+            || rareNonInheritedData->m_objectPosition != other.rareNonInheritedData->m_objectPosition
+            || rareNonInheritedData->m_shapeOutside != other.rareNonInheritedData->m_shapeOutside
+            || rareNonInheritedData->m_clipPath != other.rareNonInheritedData->m_clipPath)
+            return true;
+    }
 
     return false;
 }
@@ -652,8 +659,7 @@
             || rareNonInheritedData->m_perspective != other.rareNonInheritedData->m_perspective
             || rareNonInheritedData->m_perspectiveOriginX != other.rareNonInheritedData->m_perspectiveOriginX
             || rareNonInheritedData->m_perspectiveOriginY != other.rareNonInheritedData->m_perspectiveOriginY
-            || hasWillChangeCompositingHint() != other.hasWillChangeCompositingHint()
-            || hasWillChangeGpuRasterizationHint() != other.hasWillChangeGpuRasterizationHint())
+            || hasWillChangeCompositingHint() != other.hasWillChangeCompositingHint())
             return true;
     }
 
@@ -675,22 +681,26 @@
         if (rareNonInheritedData->opacity != other.rareNonInheritedData->opacity)
             changedContextSensitiveProperties |= ContextSensitivePropertyOpacity;
 
-        if (rareNonInheritedData->m_filter.get() != other.rareNonInheritedData->m_filter.get()
-            && *rareNonInheritedData->m_filter.get() != *other.rareNonInheritedData->m_filter.get())
+        if (rareNonInheritedData->m_filter != other.rareNonInheritedData->m_filter)
             changedContextSensitiveProperties |= ContextSensitivePropertyFilter;
     }
 
     if (!diff.needsRepaint()) {
         if (inherited->color != other.inherited->color
             || inherited_flags._text_decorations != other.inherited_flags._text_decorations
-            || visual->textDecoration != other.visual->textDecoration
-            || rareNonInheritedData->m_textDecorationStyle != other.rareNonInheritedData->m_textDecorationStyle
-            || rareNonInheritedData->m_textDecorationColor != other.rareNonInheritedData->m_textDecorationColor
-            || rareInheritedData->textFillColor() != other.rareInheritedData->textFillColor()
-            || rareInheritedData->textStrokeColor() != other.rareInheritedData->textStrokeColor()
-            || rareInheritedData->textEmphasisColor() != other.rareInheritedData->textEmphasisColor()
-            || rareInheritedData->textEmphasisFill != other.rareInheritedData->textEmphasisFill)
+            || visual->textDecoration != other.visual->textDecoration) {
             changedContextSensitiveProperties |= ContextSensitivePropertyTextOrColor;
+        } else if (rareNonInheritedData.get() != other.rareNonInheritedData.get()) {
+            if (rareNonInheritedData->m_textDecorationStyle != other.rareNonInheritedData->m_textDecorationStyle
+                || rareNonInheritedData->m_textDecorationColor != other.rareNonInheritedData->m_textDecorationColor)
+                changedContextSensitiveProperties |= ContextSensitivePropertyTextOrColor;
+        } else if (rareInheritedData.get() != other.rareInheritedData.get()) {
+            if (rareInheritedData->textFillColor() != other.rareInheritedData->textFillColor()
+                || rareInheritedData->textStrokeColor() != other.rareInheritedData->textStrokeColor()
+                || rareInheritedData->textEmphasisColor() != other.rareInheritedData->textEmphasisColor()
+                || rareInheritedData->textEmphasisFill != other.rareInheritedData->textEmphasisFill)
+                changedContextSensitiveProperties |= ContextSensitivePropertyTextOrColor;
+        }
     }
 
     return changedContextSensitiveProperties;
@@ -719,8 +729,6 @@
 
 void RenderStyle::setQuotes(PassRefPtr<QuotesData> q)
 {
-    if (rareInheritedData->quotes.get() == q.get())
-        return;
     rareInheritedData.access()->quotes = q;
 }
 
@@ -861,30 +869,6 @@
         case CSSPropertyOpacity:
         case CSSPropertyTransform:
         case CSSPropertyWebkitTransform:
-        case CSSPropertyLeft:
-        case CSSPropertyTop:
-        case CSSPropertyRight:
-        case CSSPropertyBottom:
-        case CSSPropertyWebkitFilter:
-            return true;
-        default:
-            break;
-        }
-    }
-    return false;
-}
-
-bool RenderStyle::hasWillChangeGpuRasterizationHint() const
-{
-    if (willChangeContents())
-        return true;
-
-    for (size_t i = 0; i < rareNonInheritedData->m_willChange->m_properties.size(); ++i) {
-        switch (rareNonInheritedData->m_willChange->m_properties[i]) {
-        case CSSPropertyWidth:
-        case CSSPropertyHeight:
-        case CSSPropertyBackgroundColor:
-        case CSSPropertyBackgroundPosition:
             return true;
         default:
             break;
diff --git a/Source/core/rendering/style/RenderStyle.h b/Source/core/rendering/style/RenderStyle.h
index bf83d88..e77f596 100644
--- a/Source/core/rendering/style/RenderStyle.h
+++ b/Source/core/rendering/style/RenderStyle.h
@@ -563,6 +563,7 @@
 
     EClear clear() const { return static_cast<EClear>(noninherited_flags._clear); }
     ETableLayout tableLayout() const { return static_cast<ETableLayout>(noninherited_flags._table_layout); }
+    bool isFixedTableLayout() const { return tableLayout() == TFIXED && !logicalWidth().isAuto(); }
 
     const Font& font() const;
     const FontMetrics& fontMetrics() const;
@@ -967,7 +968,6 @@
     bool willChangeContents() const { return rareNonInheritedData->m_willChange->m_contents; }
     bool willChangeScrollPosition() const { return rareNonInheritedData->m_willChange->m_scrollPosition; }
     bool hasWillChangeCompositingHint() const;
-    bool hasWillChangeGpuRasterizationHint() const;
 
 // attribute setter methods
 
@@ -1415,11 +1415,11 @@
     void setStrokePaintColor(const Color& c) { accessSVGStyle()->setStrokePaint(SVGPaint::SVG_PAINTTYPE_RGBCOLOR, c, ""); }
     float strokeOpacity() const { return svgStyle()->strokeOpacity(); }
     void setStrokeOpacity(float f) { accessSVGStyle()->setStrokeOpacity(f); }
-    PassRefPtr<SVGLength> strokeWidth() const { return svgStyle()->strokeWidth(); }
+    SVGLength* strokeWidth() const { return svgStyle()->strokeWidth(); }
     void setStrokeWidth(PassRefPtr<SVGLength> w) { accessSVGStyle()->setStrokeWidth(w); }
-    PassRefPtr<SVGLengthList> strokeDashArray() const { return svgStyle()->strokeDashArray(); }
+    SVGLengthList* strokeDashArray() const { return svgStyle()->strokeDashArray(); }
     void setStrokeDashArray(PassRefPtr<SVGLengthList> array) { accessSVGStyle()->setStrokeDashArray(array); }
-    PassRefPtr<SVGLength> strokeDashOffset() const { return svgStyle()->strokeDashOffset(); }
+    SVGLength* strokeDashOffset() const { return svgStyle()->strokeDashOffset(); }
     void setStrokeDashOffset(PassRefPtr<SVGLength> d) { accessSVGStyle()->setStrokeDashOffset(d); }
     float strokeMiterLimit() const { return svgStyle()->strokeMiterLimit(); }
     void setStrokeMiterLimit(float f) { accessSVGStyle()->setStrokeMiterLimit(f); }
@@ -1434,7 +1434,7 @@
     void setFloodColor(const Color& c) { accessSVGStyle()->setFloodColor(c); }
     void setLightingColor(const Color& c) { accessSVGStyle()->setLightingColor(c); }
 
-    PassRefPtr<SVGLength> baselineShiftValue() const { return svgStyle()->baselineShiftValue(); }
+    SVGLength* baselineShiftValue() const { return svgStyle()->baselineShiftValue(); }
     void setBaselineShiftValue(PassRefPtr<SVGLength> s) { accessSVGStyle()->setBaselineShiftValue(s); }
 
     void setShapeOutside(PassRefPtr<ShapeValue> value)
diff --git a/Source/core/rendering/style/SVGRenderStyle.cpp b/Source/core/rendering/style/SVGRenderStyle.cpp
index 27be6fc..0a66df6 100644
--- a/Source/core/rendering/style/SVGRenderStyle.cpp
+++ b/Source/core/rendering/style/SVGRenderStyle.cpp
@@ -151,7 +151,7 @@
         return true;
 
     // Text related properties influence layout.
-    if (misc != other->misc && misc->baselineShiftValue != other->misc->baselineShiftValue)
+    if (misc->baselineShiftValue != other->misc->baselineShiftValue)
         return true;
 
     // These properties affect the cached stroke bounding box rects.
@@ -164,7 +164,7 @@
         return true;
 
     // Some stroke properties, requires relayouts, as the cached stroke boundaries need to be recalculated.
-    if (stroke != other->stroke) {
+    if (stroke.get() != other->stroke.get()) {
         if (stroke->width != other->stroke->width
             || stroke->paintType != other->stroke->paintType
             || stroke->paintColor != other->stroke->paintColor
@@ -187,7 +187,7 @@
         return true;
 
     // Painting related properties only need repaints.
-    if (misc != other->misc) {
+    if (misc.get() != other->misc.get()) {
         if (misc->floodColor != other->misc->floodColor
             || misc->floodOpacity != other->misc->floodOpacity
             || misc->lightingColor != other->misc->lightingColor)
@@ -195,9 +195,13 @@
     }
 
     // If fill changes, we just need to repaint. Fill boundaries are not influenced by this, only by the Path, that RenderSVGPath contains.
-    if (fill->paintType != other->fill->paintType || fill->paintColor != other->fill->paintColor
-        || fill->paintUri != other->fill->paintUri || fill->opacity != other->fill->opacity)
-        return true;
+    if (fill.get() != other->fill.get()) {
+        if (fill->paintType != other->fill->paintType
+            || fill->paintColor != other->fill->paintColor
+            || fill->paintUri != other->fill->paintUri
+            || fill->opacity != other->fill->opacity)
+            return true;
+    }
 
     // If gradient stops change, we just need to repaint. Style updates are already handled through RenderSVGGradientSTop.
     if (stops != other->stops)
diff --git a/Source/core/rendering/style/SVGRenderStyle.h b/Source/core/rendering/style/SVGRenderStyle.h
index 43f4a14..bd672e5 100644
--- a/Source/core/rendering/style/SVGRenderStyle.h
+++ b/Source/core/rendering/style/SVGRenderStyle.h
@@ -314,16 +314,16 @@
     const SVGPaint::SVGPaintType& strokePaintType() const { return stroke->paintType; }
     const Color& strokePaintColor() const { return stroke->paintColor; }
     const String& strokePaintUri() const { return stroke->paintUri; }
-    PassRefPtr<SVGLengthList> strokeDashArray() const { return stroke->dashArray; }
+    SVGLengthList* strokeDashArray() const { return stroke->dashArray.get(); }
     float strokeMiterLimit() const { return stroke->miterLimit; }
-    PassRefPtr<SVGLength> strokeWidth() const { return stroke->width; }
-    PassRefPtr<SVGLength> strokeDashOffset() const { return stroke->dashOffset; }
+    SVGLength* strokeWidth() const { return stroke->width.get(); }
+    SVGLength* strokeDashOffset() const { return stroke->dashOffset.get(); }
     float stopOpacity() const { return stops->opacity; }
     const Color& stopColor() const { return stops->color; }
     float floodOpacity() const { return misc->floodOpacity; }
     const Color& floodColor() const { return misc->floodColor; }
     const Color& lightingColor() const { return misc->lightingColor; }
-    PassRefPtr<SVGLength> baselineShiftValue() const { return misc->baselineShiftValue; }
+    SVGLength* baselineShiftValue() const { return misc->baselineShiftValue.get(); }
     const AtomicString& clipperResource() const { return resources->clipper; }
     const AtomicString& filterResource() const { return resources->filter; }
     const AtomicString& maskerResource() const { return resources->masker; }
diff --git a/Source/core/rendering/style/StyleImage.h b/Source/core/rendering/style/StyleImage.h
index f03649f..b487e2c 100644
--- a/Source/core/rendering/style/StyleImage.h
+++ b/Source/core/rendering/style/StyleImage.h
@@ -73,16 +73,6 @@
     ALWAYS_INLINE bool isGeneratedImage() const { return m_isGeneratedImage; }
     ALWAYS_INLINE bool isImageResourceSet() const { return m_isImageResourceSet; }
 
-    static bool imagesEquivalent(const StyleImage* image1, const StyleImage* image2)
-    {
-        if (image1 != image2) {
-            if (!image1 || !image2)
-                return false;
-            return *image1 == *image2;
-        }
-        return true;
-    }
-
 protected:
     StyleImage()
         : m_isImageResource(false)
diff --git a/Source/core/rendering/style/StyleRareInheritedData.cpp b/Source/core/rendering/style/StyleRareInheritedData.cpp
index 2516821..bcc9efc 100644
--- a/Source/core/rendering/style/StyleRareInheritedData.cpp
+++ b/Source/core/rendering/style/StyleRareInheritedData.cpp
@@ -23,6 +23,7 @@
 #include "core/rendering/style/StyleRareInheritedData.h"
 
 #include "core/rendering/style/CursorList.h"
+#include "core/rendering/style/DataEquivalency.h"
 #include "core/rendering/style/QuotesData.h"
 #include "core/rendering/style/RenderStyle.h"
 #include "core/rendering/style/RenderStyleConstants.h"
@@ -158,15 +159,6 @@
 {
 }
 
-static bool cursorDataEquivalent(const CursorList* c1, const CursorList* c2)
-{
-    if (c1 == c2)
-        return true;
-    if ((!c1 && c2) || (c1 && !c2))
-        return false;
-    return (*c1 == *c2);
-}
-
 bool StyleRareInheritedData::operator==(const StyleRareInheritedData& o) const
 {
     return m_textStrokeColor == o.m_textStrokeColor
@@ -179,7 +171,7 @@
         && tapHighlightColor == o.tapHighlightColor
         && shadowDataEquivalent(o)
         && highlight == o.highlight
-        && cursorDataEquivalent(cursorData.get(), o.cursorData.get())
+        && dataEquivalent(cursorData.get(), o.cursorData.get())
         && indent == o.indent
         && m_effectiveZoom == o.m_effectiveZoom
         && widows == o.widows
@@ -217,21 +209,22 @@
         && hyphenationString == o.hyphenationString
         && locale == o.locale
         && textEmphasisCustomMark == o.textEmphasisCustomMark
-        && quotes.get() == o.quotes.get()
+        && quotesDataEquivalent(o)
         && m_tabSize == o.m_tabSize
         && m_imageRendering == o.m_imageRendering
         && m_textUnderlinePosition == o.m_textUnderlinePosition
         && m_rubyPosition == o.m_rubyPosition
-        && StyleImage::imagesEquivalent(listStyleImage.get(), o.listStyleImage.get());
+        && dataEquivalent(listStyleImage.get(), o.listStyleImage.get());
 }
 
 bool StyleRareInheritedData::shadowDataEquivalent(const StyleRareInheritedData& o) const
 {
-    if ((!textShadow && o.textShadow) || (textShadow && !o.textShadow))
-        return false;
-    if (textShadow && o.textShadow && (*textShadow != *o.textShadow))
-        return false;
-    return true;
+    return dataEquivalent(textShadow.get(), o.textShadow.get());
+}
+
+bool StyleRareInheritedData::quotesDataEquivalent(const StyleRareInheritedData& o) const
+{
+    return dataEquivalent(quotes, o.quotes);
 }
 
 } // namespace WebCore
diff --git a/Source/core/rendering/style/StyleRareInheritedData.h b/Source/core/rendering/style/StyleRareInheritedData.h
index 50cf413..3fc422b 100644
--- a/Source/core/rendering/style/StyleRareInheritedData.h
+++ b/Source/core/rendering/style/StyleRareInheritedData.h
@@ -55,6 +55,7 @@
         return !(*this == o);
     }
     bool shadowDataEquivalent(const StyleRareInheritedData&) const;
+    bool quotesDataEquivalent(const StyleRareInheritedData&) const;
 
     RefPtr<StyleImage> listStyleImage;
 
diff --git a/Source/core/rendering/style/StyleRareNonInheritedData.cpp b/Source/core/rendering/style/StyleRareNonInheritedData.cpp
index 90a5cac..6fec049 100644
--- a/Source/core/rendering/style/StyleRareNonInheritedData.cpp
+++ b/Source/core/rendering/style/StyleRareNonInheritedData.cpp
@@ -23,6 +23,7 @@
 #include "core/rendering/style/StyleRareNonInheritedData.h"
 
 #include "core/rendering/style/ContentData.h"
+#include "core/rendering/style/DataEquivalency.h"
 #include "core/rendering/style/RenderStyle.h"
 #include "core/rendering/style/ShadowList.h"
 #include "core/rendering/style/StyleFilterData.h"
@@ -268,50 +269,27 @@
 
 bool StyleRareNonInheritedData::counterDataEquivalent(const StyleRareNonInheritedData& o) const
 {
-    if (m_counterDirectives.get() == o.m_counterDirectives.get())
-        return true;
-
-    if (m_counterDirectives && o.m_counterDirectives && *m_counterDirectives == *o.m_counterDirectives)
-        return true;
-
-    return false;
+    return dataEquivalent(m_counterDirectives, o.m_counterDirectives);
 }
 
 bool StyleRareNonInheritedData::shadowDataEquivalent(const StyleRareNonInheritedData& o) const
 {
-    if ((!m_boxShadow && o.m_boxShadow) || (m_boxShadow && !o.m_boxShadow))
-        return false;
-    if (m_boxShadow && o.m_boxShadow && (*m_boxShadow != *o.m_boxShadow))
-        return false;
-    return true;
+    return dataEquivalent(m_boxShadow, o.m_boxShadow);
 }
 
 bool StyleRareNonInheritedData::reflectionDataEquivalent(const StyleRareNonInheritedData& o) const
 {
-    if (m_boxReflect != o.m_boxReflect) {
-        if (!m_boxReflect || !o.m_boxReflect)
-            return false;
-        return *m_boxReflect == *o.m_boxReflect;
-    }
-    return true;
+    return dataEquivalent(m_boxReflect, o.m_boxReflect);
 }
 
 bool StyleRareNonInheritedData::animationDataEquivalent(const StyleRareNonInheritedData& o) const
 {
-    if ((!m_animations && o.m_animations) || (m_animations && !o.m_animations))
-        return false;
-    if (m_animations && o.m_animations && (*m_animations != *o.m_animations))
-        return false;
-    return true;
+    return dataEquivalent(m_animations, o.m_animations);
 }
 
 bool StyleRareNonInheritedData::transitionDataEquivalent(const StyleRareNonInheritedData& o) const
 {
-    if ((!m_transitions && o.m_transitions) || (m_transitions && !o.m_transitions))
-        return false;
-    if (m_transitions && o.m_transitions && (*m_transitions != *o.m_transitions))
-        return false;
-    return true;
+    return dataEquivalent(m_transitions, o.m_transitions);
 }
 
 bool StyleRareNonInheritedData::hasFilters() const
diff --git a/Source/core/rendering/svg/RenderSVGBlock.cpp b/Source/core/rendering/svg/RenderSVGBlock.cpp
index 27119a2..37c175e 100644
--- a/Source/core/rendering/svg/RenderSVGBlock.cpp
+++ b/Source/core/rendering/svg/RenderSVGBlock.cpp
@@ -23,6 +23,7 @@
 
 #include "core/rendering/svg/RenderSVGBlock.h"
 
+#include "core/rendering/RenderView.h"
 #include "core/rendering/style/ShadowList.h"
 #include "core/rendering/svg/SVGRenderSupport.h"
 #include "core/rendering/svg/SVGResourcesCache.h"
@@ -111,4 +112,13 @@
     return false;
 }
 
+void RenderSVGBlock::repaintTreeAfterLayout()
+{
+    if (!shouldCheckForInvalidationAfterLayout())
+        return;
+
+    LayoutStateDisabler layoutStateDisabler(*this);
+    RenderBlockFlow::repaintTreeAfterLayout();
+}
+
 }
diff --git a/Source/core/rendering/svg/RenderSVGBlock.h b/Source/core/rendering/svg/RenderSVGBlock.h
index 8602a72..a5af4c1 100644
--- a/Source/core/rendering/svg/RenderSVGBlock.h
+++ b/Source/core/rendering/svg/RenderSVGBlock.h
@@ -42,6 +42,8 @@
 
     virtual LayerType layerTypeRequired() const OVERRIDE FINAL { return NoLayer; }
 
+    virtual void repaintTreeAfterLayout() OVERRIDE;
+
 protected:
     virtual void willBeDestroyed() OVERRIDE;
 
diff --git a/Source/core/rendering/svg/RenderSVGModelObject.cpp b/Source/core/rendering/svg/RenderSVGModelObject.cpp
index 1567979..00c617f 100644
--- a/Source/core/rendering/svg/RenderSVGModelObject.cpp
+++ b/Source/core/rendering/svg/RenderSVGModelObject.cpp
@@ -33,6 +33,7 @@
 #include "core/rendering/svg/RenderSVGModelObject.h"
 
 #include "SVGNames.h"
+#include "core/rendering/RenderView.h"
 #include "core/rendering/svg/RenderSVGRoot.h"
 #include "core/rendering/svg/SVGResourcesCache.h"
 #include "core/svg/SVGGraphicsElement.h"
@@ -123,4 +124,38 @@
     quads.append(localToAbsoluteQuad(FloatQuad(repaintRectInLocalCoordinates())));
 }
 
+void RenderSVGModelObject::repaintTreeAfterLayout()
+{
+    // Note: This is a reduced version of RenderBox::repaintTreeAfterLayout().
+    // FIXME: Should share code with RenderBox::repaintTreeAfterLayout().
+    ASSERT(RuntimeEnabledFeatures::repaintAfterLayoutEnabled());
+    ASSERT(!needsLayout());
+
+    if (!shouldCheckForInvalidationAfterLayout())
+        return;
+
+    LayoutStateDisabler layoutStateDisabler(*this);
+
+    const LayoutRect oldRepaintRect = previousRepaintRect();
+    const LayoutPoint oldPositionFromRepaintContainer = previousPositionFromRepaintContainer();
+    const RenderLayerModelObject* repaintContainer = containerForRepaint();
+    setPreviousRepaintRect(clippedOverflowRectForRepaint(repaintContainer));
+    setPreviousPositionFromRepaintContainer(positionFromRepaintContainer(repaintContainer));
+
+    // If we are set to do a full repaint that means the RenderView will be
+    // invalidated. We can then skip issuing of invalidations for the child
+    // renderers as they'll be covered by the RenderView.
+    if (view()->doingFullRepaint()) {
+        RenderObject::repaintTreeAfterLayout();
+        return;
+    }
+
+    const LayoutRect& newRepaintRect = previousRepaintRect();
+    const LayoutPoint& newPositionFromRepaintContainer = previousPositionFromRepaintContainer();
+    repaintAfterLayoutIfNeeded(containerForRepaint(),
+        shouldDoFullRepaintAfterLayout(), oldRepaintRect, oldPositionFromRepaintContainer, &newRepaintRect, &newPositionFromRepaintContainer);
+
+    RenderObject::repaintTreeAfterLayout();
+}
+
 } // namespace WebCore
diff --git a/Source/core/rendering/svg/RenderSVGModelObject.h b/Source/core/rendering/svg/RenderSVGModelObject.h
index b0ab010..bbfe5af 100644
--- a/Source/core/rendering/svg/RenderSVGModelObject.h
+++ b/Source/core/rendering/svg/RenderSVGModelObject.h
@@ -68,6 +68,8 @@
 
     virtual bool isSVG() const OVERRIDE FINAL { return true; }
 
+    virtual void repaintTreeAfterLayout() OVERRIDE;
+
 protected:
     virtual void addLayerHitTestRects(LayerHitTestRects&, const RenderLayer* currentCompositedLayer, const LayoutPoint& layerOffset, const LayoutRect& containerRect) const OVERRIDE FINAL;
     virtual void willBeDestroyed() OVERRIDE;
diff --git a/Source/core/rendering/svg/RenderSVGResourceFilter.cpp b/Source/core/rendering/svg/RenderSVGResourceFilter.cpp
index 07f73e1..10bffe3 100644
--- a/Source/core/rendering/svg/RenderSVGResourceFilter.cpp
+++ b/Source/core/rendering/svg/RenderSVGResourceFilter.cpp
@@ -311,7 +311,7 @@
     if (!filterData)
         return;
 
-    if (object->document().settings()->deferredFiltersEnabled()) {
+    if (object->document().settings()->deferredFiltersEnabled() && (filterData->state == FilterData::PaintingSource || filterData->state == FilterData::Built)) {
         endDeferredFilter(context, filterData);
         filterData->state = FilterData::Built;
         return;
diff --git a/Source/core/rendering/svg/RenderSVGViewportContainer.cpp b/Source/core/rendering/svg/RenderSVGViewportContainer.cpp
index 0dae02c..752859f 100644
--- a/Source/core/rendering/svg/RenderSVGViewportContainer.cpp
+++ b/Source/core/rendering/svg/RenderSVGViewportContainer.cpp
@@ -67,54 +67,6 @@
     SVGLengthContext lengthContext(element);
     m_viewport = FloatRect(svg->x()->currentValue()->value(lengthContext), svg->y()->currentValue()->value(lengthContext), svg->width()->currentValue()->value(lengthContext), svg->height()->currentValue()->value(lengthContext));
 
-    SVGElement* correspondingElement = svg->correspondingElement();
-    if (correspondingElement && svg->isInShadowTree()) {
-        const HashSet<SVGElementInstance*>& instances = correspondingElement->instancesForElement();
-        ASSERT(!instances.isEmpty());
-
-        SVGUseElement* useElement = 0;
-        const HashSet<SVGElementInstance*>::const_iterator end = instances.end();
-        for (HashSet<SVGElementInstance*>::const_iterator it = instances.begin(); it != end; ++it) {
-            const SVGElementInstance* instance = (*it);
-            ASSERT(isSVGSVGElement(instance->correspondingElement()) || isSVGSymbolElement(instance->correspondingElement()));
-            if (instance->shadowTreeElement() == svg) {
-                ASSERT(correspondingElement == instance->correspondingElement());
-                useElement = instance->directUseElement();
-                if (!useElement)
-                    useElement = instance->correspondingUseElement();
-                break;
-            }
-        }
-
-        ASSERT(useElement);
-        bool isSymbolElement = isSVGSymbolElement(*correspondingElement);
-
-        // Spec (<use> on <symbol>): This generated 'svg' will always have explicit values for attributes width and height.
-        // If attributes width and/or height are provided on the 'use' element, then these attributes
-        // will be transferred to the generated 'svg'. If attributes width and/or height are not specified,
-        // the generated 'svg' element will use values of 100% for these attributes.
-
-        // Spec (<use> on <svg>): If attributes width and/or height are provided on the 'use' element, then these
-        // values will override the corresponding attributes on the 'svg' in the generated tree.
-
-        SVGLengthContext lengthContext(element);
-        if (useElement->hasAttribute(SVGNames::widthAttr))
-            m_viewport.setWidth(useElement->width()->currentValue()->value(lengthContext));
-        else if (isSymbolElement && svg->hasAttribute(SVGNames::widthAttr)) {
-            RefPtr<SVGLength> containerWidth = SVGLength::create(LengthModeWidth);
-            containerWidth->setValueAsString("100%", ASSERT_NO_EXCEPTION);
-            m_viewport.setWidth(containerWidth->value(lengthContext));
-        }
-
-        if (useElement->hasAttribute(SVGNames::heightAttr))
-            m_viewport.setHeight(useElement->height()->currentValue()->value(lengthContext));
-        else if (isSymbolElement && svg->hasAttribute(SVGNames::heightAttr)) {
-            RefPtr<SVGLength> containerHeight = SVGLength::create(LengthModeHeight);
-            containerHeight->setValueAsString("100%", ASSERT_NO_EXCEPTION);
-            m_viewport.setHeight(containerHeight->value(lengthContext));
-        }
-    }
-
     if (oldViewport != m_viewport) {
         setNeedsBoundariesUpdate();
         setNeedsTransformUpdate();
diff --git a/Source/core/speech/SpeechInput.cpp b/Source/core/speech/SpeechInput.cpp
deleted file mode 100644
index 8870b7c..0000000
--- a/Source/core/speech/SpeechInput.cpp
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- *     * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "core/speech/SpeechInput.h"
-
-#if ENABLE(INPUT_SPEECH)
-
-#include "core/html/shadow/TextControlInnerElements.h"
-#include "core/speech/SpeechInputClient.h"
-#include "wtf/PassOwnPtr.h"
-
-namespace WebCore {
-
-SpeechInput::SpeechInput(PassOwnPtr<SpeechInputClient> client)
-    : m_client(client)
-    , m_nextListenerId(1)
-{
-    m_client->setListener(this);
-}
-
-SpeechInput::~SpeechInput()
-{
-    m_client->setListener(0);
-}
-
-PassOwnPtrWillBeRawPtr<SpeechInput> SpeechInput::create(PassOwnPtr<SpeechInputClient> client)
-{
-    return adoptPtrWillBeNoop(new SpeechInput(client));
-}
-
-int SpeechInput::registerListener(SpeechInputListener* listener)
-{
-#if defined(DEBUG)
-    // Check if already present.
-    for (WillBeHeapHashMap<int, RawPtrWillBeWeakMember<SpeechInputListener> >::iterator it = m_listeners.begin(); it != m_listeners.end(); ++it)
-        ASSERT(it->value != listener);
-#endif
-
-    m_listeners.add(m_nextListenerId, listener);
-    return m_nextListenerId++;
-}
-
-void SpeechInput::unregisterListener(int listenerId)
-{
-    if (m_listeners.contains(listenerId))
-        m_listeners.remove(listenerId);
-}
-
-void SpeechInput::didCompleteRecording(int listenerId)
-{
-    // Don't assert if not present as the element might have been removed by the page while
-    // this event was on the way.
-    if (m_listeners.contains(listenerId))
-        m_listeners.get(listenerId)->didCompleteRecording(listenerId);
-}
-
-void SpeechInput::didCompleteRecognition(int listenerId)
-{
-    // Don't assert if not present as the element might have been removed by the page while
-    // this event was on the way.
-    if (m_listeners.contains(listenerId))
-        m_listeners.get(listenerId)->didCompleteRecognition(listenerId);
-}
-
-void SpeechInput::setRecognitionResult(int listenerId, const SpeechInputResultArray& result)
-{
-    // Don't assert if not present as the element might have been removed by the page while
-    // this event was on the way.
-    if (m_listeners.contains(listenerId))
-        m_listeners.get(listenerId)->setRecognitionResult(listenerId, result);
-}
-
-bool SpeechInput::startRecognition(int listenerId, const IntRect& elementRect, const AtomicString& language, const String& grammar, SecurityOrigin* origin)
-{
-    ASSERT(m_listeners.contains(listenerId));
-    return m_client->startRecognition(listenerId, elementRect, language, grammar, origin);
-}
-
-void SpeechInput::stopRecording(int listenerId)
-{
-    ASSERT(m_listeners.contains(listenerId));
-    m_client->stopRecording(listenerId);
-}
-
-void SpeechInput::cancelRecognition(int listenerId)
-{
-    ASSERT(m_listeners.contains(listenerId));
-    m_client->cancelRecognition(listenerId);
-}
-
-const char* SpeechInput::supplementName()
-{
-    return "SpeechInput";
-}
-
-void SpeechInput::trace(Visitor* visitor)
-{
-    visitor->registerWeakMembers<SpeechInput, &SpeechInput::clearWeakMembers>(this);
-}
-
-void provideSpeechInputTo(Page& page, PassOwnPtr<SpeechInputClient> client)
-{
-    SpeechInput::provideTo(page, SpeechInput::supplementName(), SpeechInput::create(client));
-}
-
-void SpeechInput::clearWeakMembers(Visitor* visitor)
-{
-    Vector<int> deadListenerIds;
-    WillBeHeapHashMap<int, RawPtrWillBeWeakMember<SpeechInputListener> >::const_iterator end = m_listeners.end();
-    for (WillBeHeapHashMap<int, RawPtrWillBeWeakMember<SpeechInputListener> >::const_iterator it = m_listeners.begin(); it != end; ++it) {
-        if (!visitor->isAlive(it->value)) {
-            deadListenerIds.append(it->key);
-            m_client->cancelRecognition(it->key);
-        }
-    }
-    for (unsigned i = 0; i < deadListenerIds.size(); ++i)
-        m_listeners.remove(deadListenerIds[i]);
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(INPUT_SPEECH)
diff --git a/Source/core/speech/SpeechInput.h b/Source/core/speech/SpeechInput.h
deleted file mode 100644
index 908fb08..0000000
--- a/Source/core/speech/SpeechInput.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- *     * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SpeechInput_h
-#define SpeechInput_h
-
-#if ENABLE(INPUT_SPEECH)
-
-#include "core/page/Page.h"
-#include "core/speech/SpeechInputListener.h"
-#include "wtf/Forward.h"
-#include "wtf/HashMap.h"
-
-namespace WebCore {
-
-class IntRect;
-class SecurityOrigin;
-class SpeechInputClient;
-
-// This class connects the input elements requiring speech input with the platform specific
-// speech recognition engine. It provides methods for the input elements to activate speech
-// recognition and methods for the speech recognition engine to return back the results.
-class SpeechInput FINAL : public NoBaseWillBeGarbageCollectedFinalized<SpeechInput>, public SpeechInputListener, public WillBeHeapSupplement<Page> {
-    WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(SpeechInput);
-    WTF_MAKE_NONCOPYABLE(SpeechInput);
-public:
-    virtual ~SpeechInput();
-
-    static PassOwnPtrWillBeRawPtr<SpeechInput> create(PassOwnPtr<SpeechInputClient>);
-    static const char* supplementName();
-    static SpeechInput* from(Page* page) { return static_cast<SpeechInput*>(WillBeHeapSupplement<Page>::from(page, supplementName())); }
-
-    // Generates a unique ID for the given listener to be used for speech requests.
-    // This should be the first call made by listeners before anything else.
-    int registerListener(SpeechInputListener*);
-
-    // Invoked when the listener is done with recording or getting destroyed.
-    // Failure to unregister may result in crashes if there were any pending speech events.
-    void unregisterListener(int);
-
-    // Methods invoked by the input elements.
-    bool startRecognition(int listenerId, const IntRect& elementRect, const AtomicString& language, const String& grammar, SecurityOrigin*);
-    void stopRecording(int);
-    void cancelRecognition(int);
-
-    // SpeechInputListener methods.
-    virtual void didCompleteRecording(int) OVERRIDE;
-    virtual void didCompleteRecognition(int) OVERRIDE;
-    virtual void setRecognitionResult(int, const SpeechInputResultArray&) OVERRIDE;
-
-    virtual void trace(Visitor*) OVERRIDE;
-    void clearWeakMembers(Visitor*);
-
-private:
-    explicit SpeechInput(PassOwnPtr<SpeechInputClient>);
-
-    OwnPtr<SpeechInputClient> m_client;
-    WillBeHeapHashMap<int, RawPtrWillBeWeakMember<SpeechInputListener> > m_listeners;
-    int m_nextListenerId;
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(INPUT_SPEECH)
-
-#endif // SpeechInput_h
diff --git a/Source/core/speech/SpeechInputClient.h b/Source/core/speech/SpeechInputClient.h
deleted file mode 100644
index 8afb3a0..0000000
--- a/Source/core/speech/SpeechInputClient.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- *     * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SpeechInputClient_h
-#define SpeechInputClient_h
-
-#include "wtf/Forward.h"
-
-#if ENABLE(INPUT_SPEECH)
-
-namespace WebCore {
-
-class IntRect;
-class SecurityOrigin;
-class SpeechInputListener;
-class Page;
-
-// Provides an interface for SpeechInput to call into the embedder.
-class SpeechInputClient {
-public:
-    // This is the first call made by a listener, registering itself for future callbacks.
-    // When the listener no longer needs speech input (for e.g. when it gets destroyed),
-    // it should set a null listener to stop receiving callbacks.
-    // The client does not take ownership of the pointer.
-    virtual void setListener(SpeechInputListener*) = 0;
-
-    // Starts speech recognition and audio recording. elementRect is the position
-    // of the element where the user clicked in the RootView coordinate system.
-    virtual bool startRecognition(int requestId, const IntRect& elementRect, const AtomicString& language, const String& grammar, SecurityOrigin*) = 0;
-
-    // Stops audio recording and performs recognition with the audio recorded until now
-    // (does not discard audio).
-    virtual void stopRecording(int requestId) = 0;
-
-    // Cancels an ongoing recognition and discards any audio recorded so far. No partial
-    // recognition results are returned to the listener.
-    virtual void cancelRecognition(int requestId) = 0;
-
-    virtual ~SpeechInputClient() { }
-};
-
-void provideSpeechInputTo(Page&, PassOwnPtr<SpeechInputClient>);
-
-} // namespace WebCore
-
-#endif // ENABLE(INPUT_SPEECH)
-
-#endif // SpeechInputClient_h
diff --git a/Source/core/speech/SpeechInputEvent.cpp b/Source/core/speech/SpeechInputEvent.cpp
deleted file mode 100644
index 5aeaef2..0000000
--- a/Source/core/speech/SpeechInputEvent.cpp
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- *     * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-
-#if ENABLE(INPUT_SPEECH)
-
-#include "core/speech/SpeechInputEvent.h"
-
-namespace WebCore {
-
-PassRefPtrWillBeRawPtr<SpeechInputEvent> SpeechInputEvent::create()
-{
-    return adoptRefWillBeNoop(new SpeechInputEvent);
-}
-
-PassRefPtrWillBeRawPtr<SpeechInputEvent> SpeechInputEvent::create(const AtomicString& eventType, const SpeechInputResultArray& results)
-{
-    return adoptRefWillBeNoop(new SpeechInputEvent(eventType, results));
-}
-
-SpeechInputEvent::SpeechInputEvent()
-{
-    ScriptWrappable::init(this);
-}
-
-SpeechInputEvent::SpeechInputEvent(const AtomicString& eventType, const SpeechInputResultArray& results)
-    : Event(eventType, true, false) // Can bubble, not cancelable
-    , m_results(SpeechInputResultList::create(results))
-{
-    ScriptWrappable::init(this);
-}
-
-SpeechInputEvent::~SpeechInputEvent()
-{
-}
-
-const AtomicString& SpeechInputEvent::interfaceName() const
-{
-    return EventNames::SpeechInputEvent;
-}
-
-void SpeechInputEvent::trace(Visitor* visitor)
-{
-    visitor->trace(m_results);
-    Event::trace(visitor);
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(INPUT_SPEECH)
diff --git a/Source/core/speech/SpeechInputEvent.h b/Source/core/speech/SpeechInputEvent.h
deleted file mode 100644
index d473c6d..0000000
--- a/Source/core/speech/SpeechInputEvent.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *  * Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *  * Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SpeechInputEvent_h
-#define SpeechInputEvent_h
-
-#if ENABLE(INPUT_SPEECH)
-
-#include "core/events/Event.h"
-#include "core/speech/SpeechInputResultList.h"
-#include "platform/heap/Handle.h"
-#include "wtf/PassRefPtr.h"
-
-namespace WebCore {
-
-class SpeechInputEvent FINAL : public Event {
-public:
-    static PassRefPtrWillBeRawPtr<SpeechInputEvent> create();
-    static PassRefPtrWillBeRawPtr<SpeechInputEvent> create(const AtomicString& eventType, const SpeechInputResultArray& results);
-    virtual ~SpeechInputEvent();
-
-    SpeechInputResultList* results() const { return m_results.get(); }
-
-    virtual const AtomicString& interfaceName() const OVERRIDE;
-
-    virtual void trace(Visitor*) OVERRIDE;
-
-private:
-    SpeechInputEvent();
-    SpeechInputEvent(const AtomicString& eventType, const SpeechInputResultArray& results);
-
-    RefPtrWillBeMember<SpeechInputResultList> m_results;
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(INPUT_SPEECH)
-
-#endif // SpeechInputEvent_h
diff --git a/Source/core/speech/SpeechInputEvent.idl b/Source/core/speech/SpeechInputEvent.idl
deleted file mode 100644
index 4fe740b..0000000
--- a/Source/core/speech/SpeechInputEvent.idl
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *  * Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *  * Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-[
-    Conditional=INPUT_SPEECH
-] interface SpeechInputEvent : Event {
-    readonly attribute SpeechInputResultList results;
-};
-
diff --git a/Source/core/speech/SpeechInputListener.h b/Source/core/speech/SpeechInputListener.h
deleted file mode 100644
index ce365ad..0000000
--- a/Source/core/speech/SpeechInputListener.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- *     * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SpeechInputListener_h
-#define SpeechInputListener_h
-
-#if ENABLE(INPUT_SPEECH)
-
-#include "core/speech/SpeechInputResult.h"
-#include "wtf/Forward.h"
-
-namespace WebCore {
-
-// Interface to be implemented by the element which invokes SpeechInput.
-class SpeechInputListener : public WillBeGarbageCollectedMixin {
-public:
-    // Informs that audio recording has completed and recognition is underway.
-    virtual void didCompleteRecording(int requestId) = 0;
-
-    // Informs that speech recognition has completed. This gets invoked irrespective of whether
-    // recognition was succesful or not, whether setRecognitionResult() was invoked or not. The
-    // handler typically frees up any temporary resources allocated and waits for the next speech
-    // recognition request.
-    virtual void didCompleteRecognition(int requestId) = 0;
-
-    // Gives results from speech recognition, either partial or the final results.
-    // This method can potentially get called multiple times if there are partial results
-    // available as the user keeps speaking. If the speech could not be recognized properly
-    // or if there was any other errors in the process, this method may never be called.
-    virtual void setRecognitionResult(int requestId, const SpeechInputResultArray&) = 0;
-
-protected:
-    virtual ~SpeechInputListener() { }
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(INPUT_SPEECH)
-
-#endif // SpeechInputListener_h
diff --git a/Source/core/speech/SpeechInputResult.cpp b/Source/core/speech/SpeechInputResult.cpp
deleted file mode 100644
index 9476585..0000000
--- a/Source/core/speech/SpeechInputResult.cpp
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *  * Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *  * Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "core/speech/SpeechInputResult.h"
-
-#if ENABLE(INPUT_SPEECH)
-
-namespace WebCore {
-
-PassRefPtrWillBeRawPtr<SpeechInputResult> SpeechInputResult::create(const String& utterance, double confidence)
-{
-    return adoptRefWillBeNoop(new SpeechInputResult(utterance, confidence));
-}
-
-PassRefPtrWillBeRawPtr<SpeechInputResult> SpeechInputResult::create(const SpeechInputResult& source)
-{
-    return adoptRefWillBeNoop(new SpeechInputResult(source.m_utterance, source.m_confidence));
-}
-
-SpeechInputResult::SpeechInputResult(const String& utterance, double confidence)
-    : m_utterance(utterance)
-    , m_confidence(confidence)
-{
-    ScriptWrappable::init(this);
-}
-
-double SpeechInputResult::confidence() const
-{
-    return m_confidence;
-}
-
-const String& SpeechInputResult::utterance() const
-{
-    return m_utterance;
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(INPUT_SPEECH)
diff --git a/Source/core/speech/SpeechInputResult.h b/Source/core/speech/SpeechInputResult.h
deleted file mode 100644
index 2680d79..0000000
--- a/Source/core/speech/SpeechInputResult.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *  * Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *  * Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SpeechInputResult_h
-#define SpeechInputResult_h
-
-#if ENABLE(INPUT_SPEECH)
-
-#include "bindings/v8/ScriptWrappable.h"
-#include "platform/heap/Handle.h"
-#include "wtf/PassRefPtr.h"
-#include "wtf/RefCounted.h"
-#include "wtf/text/WTFString.h"
-
-namespace WebCore {
-
-// This class holds one speech recognition result including the text and other related
-// fields, as received from the embedder.
-class SpeechInputResult : public RefCountedWillBeGarbageCollectedFinalized<SpeechInputResult>, public ScriptWrappable {
-public:
-    static PassRefPtrWillBeRawPtr<SpeechInputResult> create(const SpeechInputResult& source);
-    static PassRefPtrWillBeRawPtr<SpeechInputResult> create(const String& utterance, double confidence);
-
-    double confidence() const;
-    const String& utterance() const;
-
-    void trace(Visitor *) { }
-
-private:
-    SpeechInputResult(const String& utterance, double confidence);
-
-    String m_utterance;
-    double m_confidence;
-};
-
-typedef WillBeHeapVector<RefPtrWillBeMember<SpeechInputResult> > SpeechInputResultArray;
-typedef WillBePersistentHeapVector<RefPtrWillBeMember<SpeechInputResult> > WillBePersistentSpeechInputResultArray;
-
-} // namespace WebCore
-
-#endif // ENABLE(INPUT_SPEECH)
-
-#endif // SpeechInputResult_h
diff --git a/Source/core/speech/SpeechInputResult.idl b/Source/core/speech/SpeechInputResult.idl
deleted file mode 100644
index 1b08612..0000000
--- a/Source/core/speech/SpeechInputResult.idl
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *  * Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *  * Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-[
-    WillBeGarbageCollected,
-    NoInterfaceObject,
-    Conditional=INPUT_SPEECH
-] interface SpeechInputResult {
-    readonly attribute DOMString utterance;
-    readonly attribute float confidence;
-};
-
diff --git a/Source/core/speech/SpeechInputResultList.cpp b/Source/core/speech/SpeechInputResultList.cpp
deleted file mode 100644
index 54e5fd5..0000000
--- a/Source/core/speech/SpeechInputResultList.cpp
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- *     * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "core/speech/SpeechInputResultList.h"
-
-#if ENABLE(INPUT_SPEECH)
-
-namespace WebCore {
-
-PassRefPtrWillBeRawPtr<SpeechInputResultList> SpeechInputResultList::create(const SpeechInputResultArray& results)
-{
-    return adoptRefWillBeNoop(new SpeechInputResultList(results));
-}
-
-SpeechInputResult* SpeechInputResultList::item(unsigned index)
-{
-    return index >= m_results.size() ? 0 : m_results[index].get();
-}
-
-SpeechInputResultList::SpeechInputResultList(const SpeechInputResultArray& results)
-    : m_results(results) // Copies the incoming result array.
-{
-    ScriptWrappable::init(this);
-}
-
-void SpeechInputResultList::trace(Visitor* visitor)
-{
-    visitor->trace(m_results);
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(INPUT_SPEECH)
diff --git a/Source/core/speech/SpeechInputResultList.h b/Source/core/speech/SpeechInputResultList.h
deleted file mode 100644
index 119b2f2..0000000
--- a/Source/core/speech/SpeechInputResultList.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *  * Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *  * Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SpeechInputResultList_h
-#define SpeechInputResultList_h
-
-#if ENABLE(INPUT_SPEECH)
-
-#include "bindings/v8/ScriptWrappable.h"
-#include "core/speech/SpeechInputResult.h"
-#include "platform/heap/Handle.h"
-#include "wtf/PassRefPtr.h"
-#include "wtf/RefCounted.h"
-
-namespace WebCore {
-
-class SpeechInputResultList : public RefCountedWillBeGarbageCollectedFinalized<SpeechInputResultList>, public ScriptWrappable {
-public:
-    static PassRefPtrWillBeRawPtr<SpeechInputResultList> create(const SpeechInputResultArray& results);
-
-    // Methods from the IDL.
-    size_t length() { return m_results.size(); }
-    SpeechInputResult* item(unsigned index);
-
-    void trace(Visitor *);
-
-private:
-    explicit SpeechInputResultList(const SpeechInputResultArray& results);
-
-    SpeechInputResultArray m_results;
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(INPUT_SPEECH)
-
-#endif // SpeechInputResultList_h
diff --git a/Source/core/speech/SpeechInputResultList.idl b/Source/core/speech/SpeechInputResultList.idl
deleted file mode 100644
index 878c5a6..0000000
--- a/Source/core/speech/SpeechInputResultList.idl
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *  * Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *  * Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-[
-    WillBeGarbageCollected,
-    NoInterfaceObject,
-    Conditional=INPUT_SPEECH
-] interface SpeechInputResultList {
-    readonly attribute unsigned long length;
-    getter SpeechInputResult item(unsigned long index);
-};
-
diff --git a/Source/core/svg/SVGAElement.cpp b/Source/core/svg/SVGAElement.cpp
index 8652932..14ca8b4 100644
--- a/Source/core/svg/SVGAElement.cpp
+++ b/Source/core/svg/SVGAElement.cpp
@@ -115,7 +115,7 @@
         return;
     }
 
-    SVGElementInstance::InvalidationGuard invalidationGuard(this);
+    SVGElement::InvalidationGuard invalidationGuard(this);
 
     // Unlike other SVG*Element classes, SVGAElement only listens to SVGURIReference changes
     // as none of the other properties changes the linking behaviour for our <a> element.
diff --git a/Source/core/svg/SVGAnimateElement.cpp b/Source/core/svg/SVGAnimateElement.cpp
index 9c34ed7..3bbdbcb 100644
--- a/Source/core/svg/SVGAnimateElement.cpp
+++ b/Source/core/svg/SVGAnimateElement.cpp
@@ -49,8 +49,10 @@
 
 SVGAnimateElement::~SVGAnimateElement()
 {
+#if !ENABLE(OILPAN)
     if (targetElement())
         clearAnimatedType(targetElement());
+#endif
 }
 
 bool SVGAnimateElement::hasValidAttributeType()
@@ -148,10 +150,10 @@
 
     animatedElements.append(targetElement);
 
-    const HashSet<SVGElementInstance*>& instances = targetElement->instancesForElement();
-    const HashSet<SVGElementInstance*>::const_iterator end = instances.end();
-    for (HashSet<SVGElementInstance*>::const_iterator it = instances.begin(); it != end; ++it) {
-        if (SVGElement* shadowTreeElement = (*it)->shadowTreeElement())
+    const WillBeHeapHashSet<RawPtrWillBeWeakMember<SVGElement> >& instances = targetElement->instancesForElement();
+    const WillBeHeapHashSet<RawPtrWillBeWeakMember<SVGElement> >::const_iterator end = instances.end();
+    for (WillBeHeapHashSet<RawPtrWillBeWeakMember<SVGElement> >::const_iterator it = instances.begin(); it != end; ++it) {
+        if (SVGElement* shadowTreeElement = *it)
             animatedElements.append(shadowTreeElement);
     }
 
@@ -203,7 +205,9 @@
 
 static inline void applyCSSPropertyToTarget(SVGElement* targetElement, CSSPropertyID id, const String& value)
 {
+#if !ENABLE(OILPAN)
     ASSERT_WITH_SECURITY_IMPLICATION(!targetElement->m_deletionHasBegun);
+#endif
 
     MutableStylePropertySet* propertySet = targetElement->ensureAnimatedSMILStyleProperties();
     if (!propertySet->setProperty(id, value, false, 0))
@@ -214,7 +218,9 @@
 
 static inline void removeCSSPropertyFromTarget(SVGElement* targetElement, CSSPropertyID id)
 {
+#if !ENABLE(OILPAN)
     ASSERT_WITH_SECURITY_IMPLICATION(!targetElement->m_deletionHasBegun);
+#endif
     targetElement->ensureAnimatedSMILStyleProperties()->removeProperty(id);
     targetElement->setNeedsStyleRecalc(LocalStyleChange);
 }
@@ -227,14 +233,14 @@
 
     CSSPropertyID id = cssPropertyID(attributeName.localName());
 
-    SVGElementInstance::InstanceUpdateBlocker blocker(targetElement);
+    SVGElement::InstanceUpdateBlocker blocker(targetElement);
     applyCSSPropertyToTarget(targetElement, id, valueAsString);
 
     // If the target element has instances, update them as well, w/o requiring the <use> tree to be rebuilt.
-    const HashSet<SVGElementInstance*>& instances = targetElement->instancesForElement();
-    const HashSet<SVGElementInstance*>::const_iterator end = instances.end();
-    for (HashSet<SVGElementInstance*>::const_iterator it = instances.begin(); it != end; ++it) {
-        if (SVGElement* shadowTreeElement = (*it)->shadowTreeElement())
+    const WillBeHeapHashSet<RawPtrWillBeWeakMember<SVGElement> >& instances = targetElement->instancesForElement();
+    const WillBeHeapHashSet<RawPtrWillBeWeakMember<SVGElement> >::const_iterator end = instances.end();
+    for (WillBeHeapHashSet<RawPtrWillBeWeakMember<SVGElement> >::const_iterator it = instances.begin(); it != end; ++it) {
+        if (SVGElement* shadowTreeElement = *it)
             applyCSSPropertyToTarget(shadowTreeElement, id, valueAsString);
     }
 }
@@ -247,21 +253,23 @@
 
     CSSPropertyID id = cssPropertyID(attributeName.localName());
 
-    SVGElementInstance::InstanceUpdateBlocker blocker(targetElement);
+    SVGElement::InstanceUpdateBlocker blocker(targetElement);
     removeCSSPropertyFromTarget(targetElement, id);
 
     // If the target element has instances, update them as well, w/o requiring the <use> tree to be rebuilt.
-    const HashSet<SVGElementInstance*>& instances = targetElement->instancesForElement();
-    const HashSet<SVGElementInstance*>::const_iterator end = instances.end();
-    for (HashSet<SVGElementInstance*>::const_iterator it = instances.begin(); it != end; ++it) {
-        if (SVGElement* shadowTreeElement = (*it)->shadowTreeElement())
+    const WillBeHeapHashSet<RawPtrWillBeWeakMember<SVGElement> >& instances = targetElement->instancesForElement();
+    const WillBeHeapHashSet<RawPtrWillBeWeakMember<SVGElement> >::const_iterator end = instances.end();
+    for (WillBeHeapHashSet<RawPtrWillBeWeakMember<SVGElement> >::const_iterator it = instances.begin(); it != end; ++it) {
+        if (SVGElement* shadowTreeElement = *it)
             removeCSSPropertyFromTarget(shadowTreeElement, id);
     }
 }
 
 static inline void notifyTargetAboutAnimValChange(SVGElement* targetElement, const QualifiedName& attributeName)
 {
+#if !ENABLE(OILPAN)
     ASSERT_WITH_SECURITY_IMPLICATION(!targetElement->m_deletionHasBegun);
+#endif
     targetElement->invalidateSVGAttributes();
     targetElement->svgAttributeChanged(attributeName);
 }
@@ -272,14 +280,14 @@
     if (attributeName == anyQName() || !targetElement->inDocument() || !targetElement->parentNode())
         return;
 
-    SVGElementInstance::InstanceUpdateBlocker blocker(targetElement);
+    SVGElement::InstanceUpdateBlocker blocker(targetElement);
     notifyTargetAboutAnimValChange(targetElement, attributeName);
 
     // If the target element has instances, update them as well, w/o requiring the <use> tree to be rebuilt.
-    const HashSet<SVGElementInstance*>& instances = targetElement->instancesForElement();
-    const HashSet<SVGElementInstance*>::const_iterator end = instances.end();
-    for (HashSet<SVGElementInstance*>::const_iterator it = instances.begin(); it != end; ++it) {
-        if (SVGElement* shadowTreeElement = (*it)->shadowTreeElement())
+    const WillBeHeapHashSet<RawPtrWillBeWeakMember<SVGElement> >& instances = targetElement->instancesForElement();
+    const WillBeHeapHashSet<RawPtrWillBeWeakMember<SVGElement> >::const_iterator end = instances.end();
+    for (WillBeHeapHashSet<RawPtrWillBeWeakMember<SVGElement> >::const_iterator it = instances.begin(); it != end; ++it) {
+        if (SVGElement* shadowTreeElement = *it)
             notifyTargetAboutAnimValChange(shadowTreeElement, attributeName);
     }
 }
diff --git a/Source/core/svg/SVGAnimateMotionElement.cpp b/Source/core/svg/SVGAnimateMotionElement.cpp
index 1ade309..cb6ad8f 100644
--- a/Source/core/svg/SVGAnimateMotionElement.cpp
+++ b/Source/core/svg/SVGAnimateMotionElement.cpp
@@ -50,8 +50,10 @@
 
 SVGAnimateMotionElement::~SVGAnimateMotionElement()
 {
+#if !ENABLE(OILPAN)
     if (targetElement())
         clearAnimatedType(targetElement());
+#endif
 }
 
 PassRefPtr<SVGAnimateMotionElement> SVGAnimateMotionElement::create(Document& document)
@@ -309,10 +311,10 @@
         return;
 
     // ...except in case where we have additional instances in <use> trees.
-    const HashSet<SVGElementInstance*>& instances = targetElement->instancesForElement();
-    const HashSet<SVGElementInstance*>::const_iterator end = instances.end();
-    for (HashSet<SVGElementInstance*>::const_iterator it = instances.begin(); it != end; ++it) {
-        SVGElement* shadowTreeElement = (*it)->shadowTreeElement();
+    const WillBeHeapHashSet<RawPtrWillBeWeakMember<SVGElement> >& instances = targetElement->instancesForElement();
+    const WillBeHeapHashSet<RawPtrWillBeWeakMember<SVGElement> >::const_iterator end = instances.end();
+    for (WillBeHeapHashSet<RawPtrWillBeWeakMember<SVGElement> >::const_iterator it = instances.begin(); it != end; ++it) {
+        SVGElement* shadowTreeElement = *it;
         ASSERT(shadowTreeElement);
         AffineTransform* transform = shadowTreeElement->supplementalTransform();
         if (!transform)
diff --git a/Source/core/svg/SVGAnimatedTypeAnimator.cpp b/Source/core/svg/SVGAnimatedTypeAnimator.cpp
index 86360d6..63ba27c 100644
--- a/Source/core/svg/SVGAnimatedTypeAnimator.cpp
+++ b/Source/core/svg/SVGAnimatedTypeAnimator.cpp
@@ -196,7 +196,7 @@
 PassRefPtr<SVGPropertyBase> SVGAnimatedTypeAnimator::startAnimValAnimation(const Vector<SVGElement*>& list)
 {
     ASSERT(isAnimatingSVGDom());
-    SVGElementInstance::InstanceUpdateBlocker blocker(m_contextElement);
+    SVGElement::InstanceUpdateBlocker blocker(m_contextElement);
 
     invokeMethodOnAllTargetProperties(list, m_animatedProperty->attributeName(), &SVGAnimatedPropertyBase::animationStarted);
 
@@ -206,14 +206,14 @@
 void SVGAnimatedTypeAnimator::stopAnimValAnimation(const Vector<SVGElement*>& list)
 {
     ASSERT(isAnimatingSVGDom());
-    SVGElementInstance::InstanceUpdateBlocker blocker(m_contextElement);
+    SVGElement::InstanceUpdateBlocker blocker(m_contextElement);
 
     invokeMethodOnAllTargetProperties(list, m_animatedProperty->attributeName(), &SVGAnimatedPropertyBase::animationEnded);
 }
 
 PassRefPtr<SVGPropertyBase> SVGAnimatedTypeAnimator::resetAnimValToBaseVal(const Vector<SVGElement*>& list)
 {
-    SVGElementInstance::InstanceUpdateBlocker blocker(m_contextElement);
+    SVGElement::InstanceUpdateBlocker blocker(m_contextElement);
 
     return resetAnimation(list);
 }
diff --git a/Source/core/svg/SVGCircleElement.cpp b/Source/core/svg/SVGCircleElement.cpp
index 16ab4da..bbd4c52 100644
--- a/Source/core/svg/SVGCircleElement.cpp
+++ b/Source/core/svg/SVGCircleElement.cpp
@@ -83,7 +83,7 @@
         return;
     }
 
-    SVGElementInstance::InvalidationGuard invalidationGuard(this);
+    SVGElement::InvalidationGuard invalidationGuard(this);
 
     bool isLengthAttribute = attrName == SVGNames::cxAttr
                           || attrName == SVGNames::cyAttr
diff --git a/Source/core/svg/SVGClipPathElement.cpp b/Source/core/svg/SVGClipPathElement.cpp
index 7573966..ef7899b 100644
--- a/Source/core/svg/SVGClipPathElement.cpp
+++ b/Source/core/svg/SVGClipPathElement.cpp
@@ -74,7 +74,7 @@
         return;
     }
 
-    SVGElementInstance::InvalidationGuard invalidationGuard(this);
+    SVGElement::InvalidationGuard invalidationGuard(this);
 
     RenderSVGResourceContainer* renderer = toRenderSVGResourceContainer(this->renderer());
     if (renderer)
diff --git a/Source/core/svg/SVGComponentTransferFunctionElement.cpp b/Source/core/svg/SVGComponentTransferFunctionElement.cpp
index fbf79ac..ccdd561 100644
--- a/Source/core/svg/SVGComponentTransferFunctionElement.cpp
+++ b/Source/core/svg/SVGComponentTransferFunctionElement.cpp
@@ -113,7 +113,7 @@
         return;
     }
 
-    SVGElementInstance::InvalidationGuard invalidationGuard(this);
+    SVGElement::InvalidationGuard invalidationGuard(this);
 
     invalidateFilterPrimitiveParent(this);
 }
diff --git a/Source/core/svg/SVGCursorElement.cpp b/Source/core/svg/SVGCursorElement.cpp
index 8022ccd..0f8e48c 100644
--- a/Source/core/svg/SVGCursorElement.cpp
+++ b/Source/core/svg/SVGCursorElement.cpp
@@ -117,7 +117,7 @@
         return;
     }
 
-    SVGElementInstance::InvalidationGuard invalidationGuard(this);
+    SVGElement::InvalidationGuard invalidationGuard(this);
 
     // Any change of a cursor specific attribute triggers this recalc.
     WillBeHeapHashSet<RawPtrWillBeWeakMember<SVGElement> >::const_iterator it = m_clients.begin();
diff --git a/Source/core/svg/SVGDocument.cpp b/Source/core/svg/SVGDocument.cpp
deleted file mode 100644
index 8f972d2..0000000
--- a/Source/core/svg/SVGDocument.cpp
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Copyright (C) 2004, 2005 Nikolas Zimmermann <zimmermann@kde.org>
- * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#include "config.h"
-#include "core/svg/SVGDocument.h"
-
-#include "SVGNames.h"
-#include "bindings/v8/ExceptionStatePlaceholder.h"
-#include "core/frame/FrameView.h"
-#include "core/rendering/RenderView.h"
-#include "core/svg/SVGElement.h"
-#include "core/svg/SVGSVGElement.h"
-#include "core/svg/SVGViewSpec.h"
-#include "core/svg/SVGZoomAndPan.h"
-#include "core/svg/SVGZoomEvent.h"
-
-namespace WebCore {
-
-SVGDocument::SVGDocument(const DocumentInit& initializer)
-    : XMLDocument(initializer, XMLDocumentClass | SVGDocumentClass)
-{
-}
-
-SVGSVGElement* SVGDocument::rootElement(const Document& document)
-{
-    Element* elem = document.documentElement();
-    return isSVGSVGElement(elem) ? toSVGSVGElement(elem) : 0;
-}
-
-SVGSVGElement* SVGDocument::rootElement() const
-{
-    return rootElement(*this);
-}
-
-bool SVGDocument::zoomAndPanEnabled() const
-{
-    if (SVGSVGElement* svg = rootElement()) {
-        if (svg->useCurrentView()) {
-            if (svg->currentView())
-                return svg->currentView()->zoomAndPan() == SVGZoomAndPanMagnify;
-        } else {
-            return svg->zoomAndPan() == SVGZoomAndPanMagnify;
-        }
-    }
-
-    return false;
-}
-
-void SVGDocument::startPan(const FloatPoint& start)
-{
-    if (SVGSVGElement* svg = rootElement())
-        m_translate = FloatPoint(start.x() - svg->currentTranslate().x(), start.y() - svg->currentTranslate().y());
-}
-
-void SVGDocument::updatePan(const FloatPoint& pos) const
-{
-    if (SVGSVGElement* svg = rootElement()) {
-        svg->setCurrentTranslate(FloatPoint(pos.x() - m_translate.x(), pos.y() - m_translate.y()));
-        if (renderer())
-            renderer()->repaint();
-    }
-}
-
-PassRefPtr<Document> SVGDocument::cloneDocumentWithoutChildren()
-{
-    return create(DocumentInit(url()));
-}
-
-}
diff --git a/Source/core/svg/SVGDocument.h b/Source/core/svg/SVGDocument.h
deleted file mode 100644
index e70fdac..0000000
--- a/Source/core/svg/SVGDocument.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2004, 2005 Nikolas Zimmermann <zimmermann@kde.org>
- * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#ifndef SVGDocument_h
-#define SVGDocument_h
-
-#include "core/dom/XMLDocument.h"
-#include "platform/geometry/FloatPoint.h"
-
-namespace WebCore {
-
-class SVGSVGElement;
-
-class SVGDocument FINAL : public XMLDocument {
-public:
-    static PassRefPtr<SVGDocument> create(const DocumentInit& initializer = DocumentInit())
-    {
-        return adoptRef(new SVGDocument(initializer));
-    }
-
-    static SVGSVGElement* rootElement(const Document&);
-    SVGSVGElement* rootElement() const;
-
-    bool zoomAndPanEnabled() const;
-
-    void startPan(const FloatPoint& start);
-    void updatePan(const FloatPoint& pos) const;
-
-    virtual PassRefPtr<Document> cloneDocumentWithoutChildren() OVERRIDE;
-
-private:
-    explicit SVGDocument(const DocumentInit&);
-
-    FloatPoint m_translate;
-};
-
-DEFINE_DOCUMENT_TYPE_CASTS(SVGDocument);
-
-} // namespace WebCore
-
-#endif // SVGDocument_h
diff --git a/Source/core/svg/SVGDocument.idl b/Source/core/svg/SVGDocument.idl
index 0f1dafc..a57cb2e 100644
--- a/Source/core/svg/SVGDocument.idl
+++ b/Source/core/svg/SVGDocument.idl
@@ -19,7 +19,9 @@
  * Boston, MA 02110-1301, USA.
  */
 
-partial interface Document {
+[
+    ImplementedAs=SVGDocumentExtensions
+] partial interface Document {
     [MeasureAs=SVGDocumentRootElement] readonly attribute SVGSVGElement        rootElement;
 };
 
diff --git a/Source/core/svg/SVGDocumentExtensions.cpp b/Source/core/svg/SVGDocumentExtensions.cpp
index 9593866..c0cc4bf 100644
--- a/Source/core/svg/SVGDocumentExtensions.cpp
+++ b/Source/core/svg/SVGDocumentExtensions.cpp
@@ -24,10 +24,12 @@
 
 #include "XLinkNames.h"
 #include "core/dom/Document.h"
+#include "core/rendering/RenderView.h"
 #include "core/rendering/svg/SVGResourcesCache.h"
-#include "core/svg/SVGElement.h"
 #include "core/svg/SVGFontFaceElement.h"
 #include "core/svg/SVGSVGElement.h"
+#include "core/svg/SVGViewSpec.h"
+#include "core/svg/SVGZoomAndPan.h"
 #include "core/svg/animation/SMILTimeContainer.h"
 #include "wtf/TemporaryChange.h"
 #include "wtf/text/AtomicString.h"
@@ -435,4 +437,42 @@
 
 #endif
 
+bool SVGDocumentExtensions::zoomAndPanEnabled() const
+{
+    if (SVGSVGElement* svg = rootElement(*m_document)) {
+        if (svg->useCurrentView()) {
+            if (svg->currentView())
+                return svg->currentView()->zoomAndPan() == SVGZoomAndPanMagnify;
+        } else {
+            return svg->zoomAndPan() == SVGZoomAndPanMagnify;
+        }
+    }
+
+    return false;
+}
+
+void SVGDocumentExtensions::startPan(const FloatPoint& start)
+{
+    if (SVGSVGElement* svg = rootElement(*m_document))
+        m_translate = FloatPoint(start.x() - svg->currentTranslate().x(), start.y() - svg->currentTranslate().y());
+}
+
+void SVGDocumentExtensions::updatePan(const FloatPoint& pos) const
+{
+    if (SVGSVGElement* svg = rootElement(*m_document))
+        svg->setCurrentTranslate(FloatPoint(pos.x() - m_translate.x(), pos.y() - m_translate.y()));
+}
+
+SVGSVGElement* SVGDocumentExtensions::rootElement(const Document& document)
+{
+    Element* elem = document.documentElement();
+    return isSVGSVGElement(elem) ? toSVGSVGElement(elem) : 0;
+}
+
+SVGSVGElement* SVGDocumentExtensions::rootElement() const
+{
+    ASSERT(m_document);
+    return rootElement(*m_document);
+}
+
 }
diff --git a/Source/core/svg/SVGDocumentExtensions.h b/Source/core/svg/SVGDocumentExtensions.h
index 9b8a0ef..8fb89fa 100644
--- a/Source/core/svg/SVGDocumentExtensions.h
+++ b/Source/core/svg/SVGDocumentExtensions.h
@@ -21,6 +21,7 @@
 #ifndef SVGDocumentExtensions_h
 #define SVGDocumentExtensions_h
 
+#include "platform/geometry/FloatPoint.h"
 #include "wtf/Forward.h"
 #include "wtf/HashMap.h"
 #include "wtf/HashSet.h"
@@ -85,6 +86,14 @@
     void removePendingSVGFontFaceElementsForRemoval();
 #endif
 
+    bool zoomAndPanEnabled() const;
+
+    void startPan(const FloatPoint& start);
+    void updatePan(const FloatPoint& pos) const;
+
+    static SVGSVGElement* rootElement(const Document&);
+    SVGSVGElement* rootElement() const;
+
 private:
     Document* m_document; // weak reference
     HashSet<SVGSVGElement*> m_timeContainers; // For SVG 1.2 support this will need to be made more general.
@@ -99,6 +108,7 @@
     HashMap<SVGElement*, OwnPtr<HashSet<SVGElement*> > > m_elementDependencies;
     OwnPtr<SVGResourcesCache> m_resourcesCache;
     HashSet<SVGSVGElement*> m_relativeLengthSVGRoots; // Root SVG elements with relative length descendants.
+    FloatPoint m_translate;
 #if !ASSERT_DISABLED
     bool m_inRelativeLengthSVGRootsInvalidation;
 #endif
diff --git a/Source/core/svg/SVGElement.cpp b/Source/core/svg/SVGElement.cpp
index 11616ed..0dc86e3 100644
--- a/Source/core/svg/SVGElement.cpp
+++ b/Source/core/svg/SVGElement.cpp
@@ -42,7 +42,6 @@
 #include "core/rendering/svg/RenderSVGResourceContainer.h"
 #include "core/svg/SVGCursorElement.h"
 #include "core/svg/SVGDocumentExtensions.h"
-#include "core/svg/SVGElementInstance.h"
 #include "core/svg/SVGElementRareData.h"
 #include "core/svg/SVGGraphicsElement.h"
 #include "core/svg/SVGSVGElement.h"
@@ -342,7 +341,7 @@
         document().accessSVGExtensions().removeAllElementReferencesForTarget(this);
     }
 
-    SVGElementInstance::invalidateAllInstancesOfElement(this);
+    invalidateInstances();
 }
 
 void SVGElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)
@@ -351,7 +350,7 @@
 
     // Invalidate all SVGElementInstances associated with us.
     if (!changedByParser)
-        SVGElementInstance::invalidateAllInstancesOfElement(this);
+        invalidateInstances();
 }
 
 CSSPropertyID SVGElement::cssPropertyIdForSVGAttributeName(const QualifiedName& attrName)
@@ -528,33 +527,44 @@
     return document().accessSVGExtensions();
 }
 
-void SVGElement::mapInstanceToElement(SVGElementInstance* instance)
+void SVGElement::mapInstanceToElement(SVGElement* instance)
 {
     ASSERT(instance);
+    ASSERT(instance->inUseShadowTree());
 
-    HashSet<SVGElementInstance*>& instances = ensureSVGRareData()->elementInstances();
+    WillBeHeapHashSet<RawPtrWillBeWeakMember<SVGElement> >& instances = ensureSVGRareData()->elementInstances();
     ASSERT(!instances.contains(instance));
 
     instances.add(instance);
 }
 
-void SVGElement::removeInstanceMapping(SVGElementInstance* instance)
+void SVGElement::removeInstanceMapping(SVGElement* instance)
 {
     ASSERT(instance);
+    ASSERT(instance->inUseShadowTree());
     ASSERT(hasSVGRareData());
 
-    HashSet<SVGElementInstance*>& instances = svgRareData()->elementInstances();
+    WillBeHeapHashSet<RawPtrWillBeWeakMember<SVGElement> >& instances = svgRareData()->elementInstances();
     ASSERT(instances.contains(instance));
 
     instances.remove(instance);
 }
 
-const HashSet<SVGElementInstance*>& SVGElement::instancesForElement() const
+static WillBeHeapHashSet<RawPtrWillBeWeakMember<SVGElement> >& emptyInstances()
 {
-    if (!hasSVGRareData()) {
-        DEFINE_STATIC_LOCAL(HashSet<SVGElementInstance*>, emptyInstances, ());
-        return emptyInstances;
-    }
+#if ENABLE(OILPAN)
+    DEFINE_STATIC_LOCAL(Persistent<HeapHashSet<WeakMember<SVGElement> > >, emptyInstances, (new HeapHashSet<WeakMember<SVGElement> >));
+    return *emptyInstances;
+#else
+    DEFINE_STATIC_LOCAL(HashSet<RawPtr<SVGElement> >, emptyInstances, ());
+    return emptyInstances;
+#endif
+}
+
+const WillBeHeapHashSet<RawPtrWillBeWeakMember<SVGElement> >& SVGElement::instancesForElement() const
+{
+    if (!hasSVGRareData())
+        return emptyInstances();
     return svgRareData()->elementInstances();
 }
 
@@ -613,6 +623,15 @@
     return hasSVGRareData() ? svgRareData()->correspondingElement() : 0;
 }
 
+SVGUseElement* SVGElement::correspondingUseElement() const
+{
+    if (ShadowRoot* root = containingShadowRoot()) {
+        if (isSVGUseElement(root->host()) && (root->type() == ShadowRoot::UserAgentShadowRoot))
+            return toSVGUseElement(root->host());
+    }
+    return 0;
+}
+
 void SVGElement::setCorrespondingElement(SVGElement* correspondingElement)
 {
     ensureSVGRareData()->setCorrespondingElement(correspondingElement);
@@ -620,9 +639,7 @@
 
 bool SVGElement::inUseShadowTree() const
 {
-    if (ShadowRoot* root = containingShadowRoot())
-        return isSVGUseElement(root->host()) && (root->type() == ShadowRoot::UserAgentShadowRoot);
-    return false;
+    return correspondingUseElement();
 }
 
 bool SVGElement::supportsSpatialNavigationFocus() const
@@ -775,7 +792,7 @@
     return true;
 }
 
-static inline void collectInstancesForSVGElement(SVGElement* element, HashSet<SVGElementInstance*>& instances)
+static inline void collectInstancesForSVGElement(SVGElement* element, WillBeHeapHashSet<RawPtrWillBeWeakMember<SVGElement> >& instances)
 {
     ASSERT(element);
     if (element->containingShadowRoot())
@@ -795,14 +812,11 @@
         return false;
 
     // Add event listener to all shadow tree DOM element instances
-    HashSet<SVGElementInstance*> instances;
+    WillBeHeapHashSet<RawPtrWillBeWeakMember<SVGElement> > instances;
     collectInstancesForSVGElement(this, instances);
-    const HashSet<SVGElementInstance*>::const_iterator end = instances.end();
-    for (HashSet<SVGElementInstance*>::const_iterator it = instances.begin(); it != end; ++it) {
-        ASSERT((*it)->shadowTreeElement());
-        ASSERT((*it)->correspondingElement() == this);
-
-        bool result = (*it)->shadowTreeElement()->Node::addEventListener(eventType, listener, useCapture);
+    const WillBeHeapHashSet<RawPtrWillBeWeakMember<SVGElement> >::const_iterator end = instances.end();
+    for (WillBeHeapHashSet<RawPtrWillBeWeakMember<SVGElement> >::const_iterator it = instances.begin(); it != end; ++it) {
+        bool result = (*it)->Node::addEventListener(eventType, listener, useCapture);
         ASSERT_UNUSED(result, result);
     }
 
@@ -811,7 +825,7 @@
 
 bool SVGElement::removeEventListener(const AtomicString& eventType, EventListener* listener, bool useCapture)
 {
-    HashSet<SVGElementInstance*> instances;
+    WillBeHeapHashSet<RawPtrWillBeWeakMember<SVGElement> > instances;
     collectInstancesForSVGElement(this, instances);
     if (instances.isEmpty())
         return Node::removeEventListener(eventType, listener, useCapture);
@@ -828,11 +842,9 @@
         return false;
 
     // Remove event listener from all shadow tree DOM element instances
-    const HashSet<SVGElementInstance*>::const_iterator end = instances.end();
-    for (HashSet<SVGElementInstance*>::const_iterator it = instances.begin(); it != end; ++it) {
-        ASSERT((*it)->correspondingElement() == this);
-
-        SVGElement* shadowTreeElement = (*it)->shadowTreeElement();
+    const WillBeHeapHashSet<RawPtrWillBeWeakMember<SVGElement> >::const_iterator end = instances.end();
+    for (WillBeHeapHashSet<RawPtrWillBeWeakMember<SVGElement> >::const_iterator it = instances.begin(); it != end; ++it) {
+        SVGElement* shadowTreeElement = *it;
         ASSERT(shadowTreeElement);
 
         if (shadowTreeElement->Node::removeEventListener(eventType, listener, useCapture))
@@ -916,20 +928,6 @@
     return 0;
 }
 
-void SVGElement::finishParsingChildren()
-{
-    Element::finishParsingChildren();
-
-    // The outermost SVGSVGElement SVGLoad event is fired through Document::dispatchWindowLoadEvent.
-    if (isOutermostSVGSVGElement())
-        return;
-
-    // finishParsingChildren() is called when the close tag is reached for an element (e.g. </svg>)
-    // we send SVGLoad events here if we can, otherwise they'll be sent when any required loads finish
-    if (isSVGSVGElement(*this))
-        sendSVGLoadEventIfPossible();
-}
-
 void SVGElement::attributeChanged(const QualifiedName& name, const AtomicString& newValue, AttributeModificationReason)
 {
     Element::attributeChanged(name, newValue);
@@ -947,13 +945,13 @@
 {
     CSSPropertyID propId = SVGElement::cssPropertyIdForSVGAttributeName(attrName);
     if (propId > 0) {
-        SVGElementInstance::invalidateAllInstancesOfElement(this);
+        invalidateInstances();
         return;
     }
 
     if (attrName == HTMLNames::classAttr) {
         classAttributeChanged(AtomicString(m_className->currentValue()->value()));
-        SVGElementInstance::invalidateAllInstancesOfElement(this);
+        invalidateInstances();
         return;
     }
 
@@ -964,7 +962,7 @@
             toRenderSVGResourceContainer(object)->idChanged();
         if (inDocument())
             buildPendingResourcesIfNeeded();
-        SVGElementInstance::invalidateAllInstancesOfElement(this);
+        invalidateInstances();
         return;
     }
 }
@@ -1042,6 +1040,45 @@
         || hasEventListeners(EventTypeNames::focus) || hasEventListeners(EventTypeNames::blur);
 }
 
+void SVGElement::invalidateInstances()
+{
+    if (!inDocument())
+        return;
+
+    if (instanceUpdatesBlocked())
+        return;
+
+    const WillBeHeapHashSet<RawPtrWillBeWeakMember<SVGElement> >& set = instancesForElement();
+    if (set.isEmpty())
+        return;
+
+    // Mark all use elements referencing 'element' for rebuilding
+    const WillBeHeapHashSet<RawPtrWillBeWeakMember<SVGElement> >::const_iterator end = set.end();
+    for (WillBeHeapHashSet<RawPtrWillBeWeakMember<SVGElement> >::const_iterator it = set.begin(); it != end; ++it) {
+        (*it)->setCorrespondingElement(0);
+
+        if (SVGUseElement* element = (*it)->correspondingUseElement()) {
+            ASSERT(element->inDocument());
+            element->invalidateShadowTree();
+        }
+    }
+
+    document().updateRenderTreeIfNeeded();
+}
+
+SVGElement::InstanceUpdateBlocker::InstanceUpdateBlocker(SVGElement* targetElement)
+    : m_targetElement(targetElement)
+{
+    if (m_targetElement)
+        m_targetElement->setInstanceUpdatesBlocked(true);
+}
+
+SVGElement::InstanceUpdateBlocker::~InstanceUpdateBlocker()
+{
+    if (m_targetElement)
+        m_targetElement->setInstanceUpdatesBlocked(false);
+}
+
 #ifndef NDEBUG
 bool SVGElement::isAnimatableAttribute(const QualifiedName& name) const
 {
diff --git a/Source/core/svg/SVGElement.h b/Source/core/svg/SVGElement.h
index 08ce56c..adc6ba8 100644
--- a/Source/core/svg/SVGElement.h
+++ b/Source/core/svg/SVGElement.h
@@ -40,7 +40,6 @@
 class SubtreeLayoutScope;
 class SVGCursorElement;
 class SVGDocumentExtensions;
-class SVGElementInstance;
 class SVGElementRareData;
 class SVGFitToViewBox;
 class SVGSVGElement;
@@ -108,12 +107,15 @@
     void invalidateSVGAttributes() { ensureUniqueElementData().m_animatedSVGAttributesAreDirty = true; }
     void invalidateSVGPresentationAttributeStyle() { ensureUniqueElementData().m_presentationAttributeStyleIsDirty = true; }
 
-    const HashSet<SVGElementInstance*>& instancesForElement() const;
+    const WillBeHeapHashSet<RawPtrWillBeWeakMember<SVGElement> >& instancesForElement() const;
+    void mapInstanceToElement(SVGElement*);
+    void removeInstanceMapping(SVGElement*);
 
     bool getBoundingBox(FloatRect&);
 
     void setCursorElement(SVGCursorElement*);
     void setCursorImageValue(CSSCursorImageValue*);
+
 #if !ENABLE(OILPAN)
     void cursorElementRemoved();
     void cursorImageValueRemoved();
@@ -121,6 +123,7 @@
 
     SVGElement* correspondingElement();
     void setCorrespondingElement(SVGElement*);
+    SVGUseElement* correspondingUseElement() const;
 
     void synchronizeAnimatedSVGAttribute(const QualifiedName&) const;
 
@@ -154,12 +157,32 @@
 
     bool inUseShadowTree() const;
 
+    class InvalidationGuard {
+        WTF_MAKE_NONCOPYABLE(InvalidationGuard);
+    public:
+        InvalidationGuard(SVGElement* element) : m_element(element) { }
+        ~InvalidationGuard() { m_element->invalidateInstances(); }
+    private:
+        SVGElement* m_element;
+    };
+
+    class InstanceUpdateBlocker {
+        WTF_MAKE_NONCOPYABLE(InstanceUpdateBlocker);
+    public:
+        InstanceUpdateBlocker(SVGElement* targetElement);
+        ~InstanceUpdateBlocker();
+
+    private:
+        SVGElement* m_targetElement;
+    };
+
+    void invalidateInstances();
+
 protected:
     SVGElement(const QualifiedName&, Document&, ConstructionType = CreateSVGElement);
 
     virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
 
-    virtual void finishParsingChildren() OVERRIDE;
     virtual void attributeChanged(const QualifiedName&, const AtomicString&, AttributeModificationReason = ModifiedDirectly) OVERRIDE;
 
     virtual bool isPresentationAttribute(const QualifiedName&) const OVERRIDE;
@@ -189,8 +212,6 @@
     bool hasFocusEventListeners() const;
 
 private:
-    friend class SVGElementInstance;
-
     // FIXME: Author shadows should be allowed
     // https://bugs.webkit.org/show_bug.cgi?id=77938
     virtual bool areAuthorShadowsAllowed() const OVERRIDE FINAL { return false; }
@@ -201,9 +222,6 @@
 
     void buildPendingResourcesIfNeeded();
 
-    void mapInstanceToElement(SVGElementInstance*);
-    void removeInstanceMapping(SVGElementInstance*);
-
     bool supportsSpatialNavigationFocus() const;
 
     HashSet<SVGElement*> m_elementsWithRelativeLengths;
diff --git a/Source/core/svg/SVGElementInstance.cpp b/Source/core/svg/SVGElementInstance.cpp
index d4aad6a..752f482 100644
--- a/Source/core/svg/SVGElementInstance.cpp
+++ b/Source/core/svg/SVGElementInstance.cpp
@@ -86,22 +86,19 @@
 }
 
 SVGElementInstance::SVGElementInstance(SVGUseElement* correspondingUseElement, SVGUseElement* directUseElement, PassRefPtr<SVGElement> originalElement)
-    : m_parentInstance(0)
+    : m_parentInstance(nullptr)
     , m_correspondingUseElement(correspondingUseElement)
     , m_directUseElement(directUseElement)
     , m_element(originalElement)
-    , m_previousSibling(0)
-    , m_nextSibling(0)
-    , m_firstChild(0)
-    , m_lastChild(0)
+    , m_previousSibling(nullptr)
+    , m_nextSibling(nullptr)
+    , m_firstChild(nullptr)
+    , m_lastChild(nullptr)
 {
     ASSERT(m_correspondingUseElement);
     ASSERT(m_element);
     ScriptWrappable::init(this);
 
-    // Register as instance for passed element.
-    m_element->mapInstanceToElement(this);
-
 #ifndef NDEBUG
     instanceCounter.increment();
 #endif
@@ -109,27 +106,28 @@
 
 SVGElementInstance::~SVGElementInstance()
 {
-    // Call detach because we may be deleted directly if we are a child of a detached instance.
-    detach();
-
 #ifndef NDEBUG
     instanceCounter.decrement();
 #endif
 
+#if !ENABLE(OILPAN)
+    // Call detach because we may be deleted directly if we are a child of a detached instance.
+    detach();
     m_element = nullptr;
+#endif
 }
 
 // It's important not to inline removedLastRef, because we don't want to inline the code to
 // delete an SVGElementInstance at each deref call site.
+#if !ENABLE(OILPAN)
 void SVGElementInstance::removedLastRef()
 {
-#if !ENABLE(OILPAN)
 #if SECURITY_ASSERT_ENABLED
     m_deletionHasBegun = true;
 #endif
     delete this;
-#endif
 }
+#endif
 
 void SVGElementInstance::detach()
 {
@@ -140,22 +138,26 @@
         node->detach();
 
     // Deregister as instance for passed element, if we haven't already.
-    if (m_element->instancesForElement().contains(this))
-        m_element->removeInstanceMapping(this);
-    // DO NOT clear ref to m_element because JavaScriptCore uses it for garbage collection
+    if (shadowTreeElement() && m_element->instancesForElement().contains(shadowTreeElement()))
+        m_element->removeInstanceMapping(shadowTreeElement());
 
     m_shadowTreeElement = nullptr;
 
-    m_directUseElement = 0;
-    m_correspondingUseElement = 0;
+    m_directUseElement = nullptr;
+    m_correspondingUseElement = nullptr;
 
+#if !ENABLE(OILPAN)
     removeDetachedChildrenInContainer<SVGElementInstance, SVGElementInstance>(*this);
+#endif
 }
 
 void SVGElementInstance::setShadowTreeElement(SVGElement* element)
 {
     ASSERT(element);
     m_shadowTreeElement = element;
+    // Register as instance for passed element.
+    m_element->mapInstanceToElement(shadowTreeElement());
+
 }
 
 void SVGElementInstance::appendChild(PassRefPtr<SVGElementInstance> child)
@@ -163,36 +165,6 @@
     appendChildToContainer<SVGElementInstance, SVGElementInstance>(*child, *this);
 }
 
-void SVGElementInstance::invalidateAllInstancesOfElement(SVGElement* element)
-{
-    if (!element || !element->inDocument())
-        return;
-
-    if (element->instanceUpdatesBlocked())
-        return;
-
-    const HashSet<SVGElementInstance*>& set = element->instancesForElement();
-    if (set.isEmpty())
-        return;
-
-    // Mark all use elements referencing 'element' for rebuilding
-    const HashSet<SVGElementInstance*>::const_iterator end = set.end();
-    for (HashSet<SVGElementInstance*>::const_iterator it = set.begin(); it != end; ++it) {
-        ASSERT((*it)->shadowTreeElement());
-        ASSERT((*it)->shadowTreeElement()->correspondingElement());
-        ASSERT((*it)->shadowTreeElement()->correspondingElement() == (*it)->correspondingElement());
-        ASSERT((*it)->correspondingElement() == element);
-        (*it)->shadowTreeElement()->setCorrespondingElement(0);
-
-        if (SVGUseElement* element = (*it)->correspondingUseElement()) {
-            ASSERT(element->inDocument());
-            element->invalidateShadowTree();
-        }
-    }
-
-    element->document().updateRenderTreeIfNeeded();
-}
-
 const AtomicString& SVGElementInstance::interfaceName() const
 {
     return EventTargetNames::SVGElementInstance;
@@ -251,17 +223,17 @@
     return *eventTargetData();
 }
 
-SVGElementInstance::InstanceUpdateBlocker::InstanceUpdateBlocker(SVGElement* targetElement)
-    : m_targetElement(targetElement)
+void SVGElementInstance::trace(Visitor* visitor)
 {
-    if (m_targetElement)
-        m_targetElement->setInstanceUpdatesBlocked(true);
-}
-
-SVGElementInstance::InstanceUpdateBlocker::~InstanceUpdateBlocker()
-{
-    if (m_targetElement)
-        m_targetElement->setInstanceUpdatesBlocked(false);
+    visitor->trace(m_parentInstance);
+    visitor->trace(m_correspondingUseElement);
+    visitor->trace(m_directUseElement);
+    visitor->trace(m_element);
+    visitor->trace(m_shadowTreeElement);
+    visitor->trace(m_previousSibling);
+    visitor->trace(m_nextSibling);
+    visitor->trace(m_firstChild);
+    visitor->trace(m_lastChild);
 }
 
 }
diff --git a/Source/core/svg/SVGElementInstance.h b/Source/core/svg/SVGElementInstance.h
index 660b60c..8366754 100644
--- a/Source/core/svg/SVGElementInstance.h
+++ b/Source/core/svg/SVGElementInstance.h
@@ -37,8 +37,8 @@
 class SVGUseElement;
 
 // SVGElementInstance mimics Node, but without providing all its functionality
-class SVGElementInstance FINAL : public TreeShared<SVGElementInstance>, public EventTarget, public ScriptWrappable {
-    DEFINE_EVENT_TARGET_REFCOUNTING(TreeShared<SVGElementInstance>);
+class SVGElementInstance FINAL : public TreeSharedWillBeRefCountedGarbageCollected<SVGElementInstance>, public EventTarget, public ScriptWrappable {
+    DEFINE_EVENT_TARGET_REFCOUNTING(TreeSharedWillBeRefCountedGarbageCollected<SVGElementInstance>);
 public:
     static PassRefPtr<SVGElementInstance> create(SVGUseElement* correspondingUseElement, SVGUseElement* directUseElement, PassRefPtr<SVGElement> originalElement);
 
@@ -73,28 +73,7 @@
 
     inline Document* ownerDocument() const;
 
-    class InvalidationGuard {
-        WTF_MAKE_NONCOPYABLE(InvalidationGuard);
-    public:
-        InvalidationGuard(SVGElement* element) : m_element(element) { }
-        ~InvalidationGuard() { SVGElementInstance::invalidateAllInstancesOfElement(m_element); }
-    private:
-        SVGElement* m_element;
-    };
-
-    class InstanceUpdateBlocker {
-        WTF_MAKE_NONCOPYABLE(InstanceUpdateBlocker);
-    public:
-        InstanceUpdateBlocker(SVGElement* targetElement);
-        ~InstanceUpdateBlocker();
-
-    private:
-        SVGElement* m_targetElement;
-    };
-
-    static void invalidateAllInstancesOfElement(SVGElement*);
-
-    virtual void trace(Visitor*) { }
+    virtual void trace(Visitor*);
 
     // EventTarget API
     DECLARE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), abort);
@@ -147,7 +126,11 @@
 
     SVGElementInstance(SVGUseElement*, SVGUseElement*, PassRefPtr<SVGElement> originalElement);
 
+
+#if !ENABLE(OILPAN)
     void removedLastRef();
+#endif
+
     bool hasTreeSharedParent() const { return !!m_parentInstance; }
 
     virtual Node* toNode() OVERRIDE;
@@ -158,11 +141,13 @@
     template<class GenericNode, class GenericNodeContainer>
     friend void appendChildToContainer(GenericNode& child, GenericNodeContainer&);
 
+#if !ENABLE(OILPAN)
     template<class GenericNode, class GenericNodeContainer>
     friend void removeDetachedChildrenInContainer(GenericNodeContainer&);
 
     template<class GenericNode, class GenericNodeContainer>
     friend void Private::addChildNodesToDeletionQueue(GenericNode*& head, GenericNode*& tail, GenericNodeContainer&);
+#endif
 
     bool hasChildren() const { return m_firstChild; }
 
@@ -175,18 +160,18 @@
     virtual EventTargetData* eventTargetData() OVERRIDE;
     virtual EventTargetData& ensureEventTargetData() OVERRIDE;
 
-    SVGElementInstance* m_parentInstance;
+    RawPtrWillBeMember<SVGElementInstance> m_parentInstance;
 
-    SVGUseElement* m_correspondingUseElement;
-    SVGUseElement* m_directUseElement;
-    RefPtr<SVGElement> m_element;
-    RefPtr<SVGElement> m_shadowTreeElement;
+    RawPtrWillBeMember<SVGUseElement> m_correspondingUseElement;
+    RawPtrWillBeMember<SVGUseElement> m_directUseElement;
+    RefPtrWillBeMember<SVGElement> m_element;
+    RefPtrWillBeMember<SVGElement> m_shadowTreeElement;
 
-    SVGElementInstance* m_previousSibling;
-    SVGElementInstance* m_nextSibling;
+    RawPtrWillBeMember<SVGElementInstance> m_previousSibling;
+    RawPtrWillBeMember<SVGElementInstance> m_nextSibling;
 
-    SVGElementInstance* m_firstChild;
-    SVGElementInstance* m_lastChild;
+    RawPtrWillBeMember<SVGElementInstance> m_firstChild;
+    RawPtrWillBeMember<SVGElementInstance> m_lastChild;
 };
 
 } // namespace WebCore
diff --git a/Source/core/svg/SVGElementRareData.h b/Source/core/svg/SVGElementRareData.h
index 209fa98..648d9ce 100644
--- a/Source/core/svg/SVGElementRareData.h
+++ b/Source/core/svg/SVGElementRareData.h
@@ -31,7 +31,6 @@
 class CSSCursorImageValue;
 class SVGCursorElement;
 class SVGElement;
-class SVGElementInstance;
 
 class SVGElementRareData : public NoBaseWillBeGarbageCollectedFinalized<SVGElementRareData> {
     WTF_MAKE_NONCOPYABLE(SVGElementRareData); WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED;
@@ -65,8 +64,8 @@
         return rareDataMap().get(element);
     }
 
-    HashSet<SVGElementInstance*>& elementInstances() { return m_elementInstances; }
-    const HashSet<SVGElementInstance*>& elementInstances() const { return m_elementInstances; }
+    WillBeHeapHashSet<RawPtrWillBeWeakMember<SVGElement> >& elementInstances() { return m_elementInstances; }
+    const WillBeHeapHashSet<RawPtrWillBeWeakMember<SVGElement> >& elementInstances() const { return m_elementInstances; }
 
     bool instanceUpdatesBlocked() const { return m_instancesUpdatesBlocked; }
     void setInstanceUpdatesBlocked(bool value) { m_instancesUpdatesBlocked = value; }
@@ -109,6 +108,7 @@
     void trace(Visitor* visitor)
     {
         visitor->trace(m_animatedSMILStyleProperties);
+        visitor->trace(m_elementInstances);
         visitor->registerWeakMembers<SVGElementRareData, &SVGElementRareData::processWeakMembers>(this);
     }
 
@@ -146,7 +146,7 @@
 
 private:
     RawPtrWillBeWeakMember<SVGElement> m_owner;
-    HashSet<SVGElementInstance*> m_elementInstances;
+    WillBeHeapHashSet<RawPtrWillBeWeakMember<SVGElement> > m_elementInstances;
     RawPtrWillBeWeakMember<SVGCursorElement> m_cursorElement;
     RawPtrWillBeWeakMember<CSSCursorImageValue> m_cursorImageValue;
     SVGElement* m_correspondingElement;
diff --git a/Source/core/svg/SVGEllipseElement.cpp b/Source/core/svg/SVGEllipseElement.cpp
index a481a59..436931a 100644
--- a/Source/core/svg/SVGEllipseElement.cpp
+++ b/Source/core/svg/SVGEllipseElement.cpp
@@ -88,7 +88,7 @@
         return;
     }
 
-    SVGElementInstance::InvalidationGuard invalidationGuard(this);
+    SVGElement::InvalidationGuard invalidationGuard(this);
 
     bool isLengthAttribute = attrName == SVGNames::cxAttr
                           || attrName == SVGNames::cyAttr
diff --git a/Source/core/svg/SVGFEBlendElement.cpp b/Source/core/svg/SVGFEBlendElement.cpp
index afd30ea..ddd5651 100644
--- a/Source/core/svg/SVGFEBlendElement.cpp
+++ b/Source/core/svg/SVGFEBlendElement.cpp
@@ -108,7 +108,7 @@
         return;
     }
 
-    SVGElementInstance::InvalidationGuard invalidationGuard(this);
+    SVGElement::InvalidationGuard invalidationGuard(this);
 
     if (attrName == SVGNames::modeAttr) {
         primitiveAttributeChanged(attrName);
diff --git a/Source/core/svg/SVGFEColorMatrixElement.cpp b/Source/core/svg/SVGFEColorMatrixElement.cpp
index 56eac91..10b2dfe 100644
--- a/Source/core/svg/SVGFEColorMatrixElement.cpp
+++ b/Source/core/svg/SVGFEColorMatrixElement.cpp
@@ -110,7 +110,7 @@
         return;
     }
 
-    SVGElementInstance::InvalidationGuard invalidationGuard(this);
+    SVGElement::InvalidationGuard invalidationGuard(this);
 
     if (attrName == SVGNames::typeAttr || attrName == SVGNames::valuesAttr) {
         primitiveAttributeChanged(attrName);
diff --git a/Source/core/svg/SVGFECompositeElement.cpp b/Source/core/svg/SVGFECompositeElement.cpp
index 149ec11..89837b2 100644
--- a/Source/core/svg/SVGFECompositeElement.cpp
+++ b/Source/core/svg/SVGFECompositeElement.cpp
@@ -139,7 +139,7 @@
         return;
     }
 
-    SVGElementInstance::InvalidationGuard invalidationGuard(this);
+    SVGElement::InvalidationGuard invalidationGuard(this);
 
     if (attrName == SVGNames::operatorAttr
         || attrName == SVGNames::k1Attr
diff --git a/Source/core/svg/SVGFEConvolveMatrixElement.cpp b/Source/core/svg/SVGFEConvolveMatrixElement.cpp
index 44e3544..c15fb97 100644
--- a/Source/core/svg/SVGFEConvolveMatrixElement.cpp
+++ b/Source/core/svg/SVGFEConvolveMatrixElement.cpp
@@ -162,7 +162,7 @@
         return;
     }
 
-    SVGElementInstance::InvalidationGuard invalidationGuard(this);
+    SVGElement::InvalidationGuard invalidationGuard(this);
 
     if (attrName == SVGNames::edgeModeAttr
         || attrName == SVGNames::divisorAttr
diff --git a/Source/core/svg/SVGFEDiffuseLightingElement.cpp b/Source/core/svg/SVGFEDiffuseLightingElement.cpp
index c31990a..d17ee40 100644
--- a/Source/core/svg/SVGFEDiffuseLightingElement.cpp
+++ b/Source/core/svg/SVGFEDiffuseLightingElement.cpp
@@ -138,7 +138,7 @@
         return;
     }
 
-    SVGElementInstance::InvalidationGuard invalidationGuard(this);
+    SVGElement::InvalidationGuard invalidationGuard(this);
 
     if (attrName == SVGNames::surfaceScaleAttr
         || attrName == SVGNames::diffuseConstantAttr
diff --git a/Source/core/svg/SVGFEDisplacementMapElement.cpp b/Source/core/svg/SVGFEDisplacementMapElement.cpp
index 7a1dbdb..a129de1 100644
--- a/Source/core/svg/SVGFEDisplacementMapElement.cpp
+++ b/Source/core/svg/SVGFEDisplacementMapElement.cpp
@@ -121,7 +121,7 @@
         return;
     }
 
-    SVGElementInstance::InvalidationGuard invalidationGuard(this);
+    SVGElement::InvalidationGuard invalidationGuard(this);
 
     if (attrName == SVGNames::xChannelSelectorAttr || attrName == SVGNames::yChannelSelectorAttr || attrName == SVGNames::scaleAttr) {
         primitiveAttributeChanged(attrName);
diff --git a/Source/core/svg/SVGFEDropShadowElement.cpp b/Source/core/svg/SVGFEDropShadowElement.cpp
index 910e47e..a2423bf 100644
--- a/Source/core/svg/SVGFEDropShadowElement.cpp
+++ b/Source/core/svg/SVGFEDropShadowElement.cpp
@@ -99,7 +99,7 @@
         return;
     }
 
-    SVGElementInstance::InvalidationGuard invalidationGuard(this);
+    SVGElement::InvalidationGuard invalidationGuard(this);
 
     if (attrName == SVGNames::inAttr
         || attrName == SVGNames::stdDeviationAttr
diff --git a/Source/core/svg/SVGFEGaussianBlurElement.cpp b/Source/core/svg/SVGFEGaussianBlurElement.cpp
index 7fb2af7..9ce1f7f 100644
--- a/Source/core/svg/SVGFEGaussianBlurElement.cpp
+++ b/Source/core/svg/SVGFEGaussianBlurElement.cpp
@@ -89,7 +89,7 @@
         return;
     }
 
-    SVGElementInstance::InvalidationGuard invalidationGuard(this);
+    SVGElement::InvalidationGuard invalidationGuard(this);
 
     if (attrName == SVGNames::inAttr || attrName == SVGNames::stdDeviationAttr) {
         invalidate();
diff --git a/Source/core/svg/SVGFEImageElement.cpp b/Source/core/svg/SVGFEImageElement.cpp
index eb8e0f6..6515cca 100644
--- a/Source/core/svg/SVGFEImageElement.cpp
+++ b/Source/core/svg/SVGFEImageElement.cpp
@@ -147,7 +147,7 @@
         return;
     }
 
-    SVGElementInstance::InvalidationGuard invalidationGuard(this);
+    SVGElement::InvalidationGuard invalidationGuard(this);
 
     if (attrName == SVGNames::preserveAspectRatioAttr) {
         invalidate();
diff --git a/Source/core/svg/SVGFELightElement.cpp b/Source/core/svg/SVGFELightElement.cpp
index e986cb3..4a9fec5 100644
--- a/Source/core/svg/SVGFELightElement.cpp
+++ b/Source/core/svg/SVGFELightElement.cpp
@@ -130,7 +130,7 @@
         return;
     }
 
-    SVGElementInstance::InvalidationGuard invalidationGuard(this);
+    SVGElement::InvalidationGuard invalidationGuard(this);
 
     if (attrName == SVGNames::azimuthAttr
         || attrName == SVGNames::elevationAttr
diff --git a/Source/core/svg/SVGFEMergeNodeElement.cpp b/Source/core/svg/SVGFEMergeNodeElement.cpp
index 4f33793..ae409ce 100644
--- a/Source/core/svg/SVGFEMergeNodeElement.cpp
+++ b/Source/core/svg/SVGFEMergeNodeElement.cpp
@@ -72,7 +72,7 @@
         return;
     }
 
-    SVGElementInstance::InvalidationGuard invalidationGuard(this);
+    SVGElement::InvalidationGuard invalidationGuard(this);
 
     if (attrName == SVGNames::inAttr) {
         invalidateFilterPrimitiveParent(this);
diff --git a/Source/core/svg/SVGFEMorphologyElement.cpp b/Source/core/svg/SVGFEMorphologyElement.cpp
index 6f9b371..f82ad4b 100644
--- a/Source/core/svg/SVGFEMorphologyElement.cpp
+++ b/Source/core/svg/SVGFEMorphologyElement.cpp
@@ -119,7 +119,7 @@
         return;
     }
 
-    SVGElementInstance::InvalidationGuard invalidationGuard(this);
+    SVGElement::InvalidationGuard invalidationGuard(this);
 
     if (attrName == SVGNames::operatorAttr || attrName == SVGNames::radiusAttr) {
         primitiveAttributeChanged(attrName);
diff --git a/Source/core/svg/SVGFEMorphologyElement.idl b/Source/core/svg/SVGFEMorphologyElement.idl
index 053d522..831d126 100644
--- a/Source/core/svg/SVGFEMorphologyElement.idl
+++ b/Source/core/svg/SVGFEMorphologyElement.idl
@@ -38,8 +38,8 @@
     readonly attribute SVGAnimatedNumber radiusX;
     readonly attribute SVGAnimatedNumber radiusY;
 
-    void setRadius([Default=Undefined] optional float radiusX,
-                   [Default=Undefined] optional float radiusY); // non-standard
+    [MeasureAs=SVGFEMorphologyElementSetRadius] void setRadius([Default=Undefined] optional float radiusX,
+                                                               [Default=Undefined] optional float radiusY); // non-standard
 };
 
 SVGFEMorphologyElement implements SVGFilterPrimitiveStandardAttributes;
diff --git a/Source/core/svg/SVGFEOffsetElement.cpp b/Source/core/svg/SVGFEOffsetElement.cpp
index 88cc467..d79763f 100644
--- a/Source/core/svg/SVGFEOffsetElement.cpp
+++ b/Source/core/svg/SVGFEOffsetElement.cpp
@@ -86,7 +86,7 @@
         return;
     }
 
-    SVGElementInstance::InvalidationGuard invalidationGuard(this);
+    SVGElement::InvalidationGuard invalidationGuard(this);
 
     if (attrName == SVGNames::inAttr || attrName == SVGNames::dxAttr || attrName == SVGNames::dyAttr) {
         invalidate();
diff --git a/Source/core/svg/SVGFESpecularLightingElement.cpp b/Source/core/svg/SVGFESpecularLightingElement.cpp
index 6ea66d9..36630fb 100644
--- a/Source/core/svg/SVGFESpecularLightingElement.cpp
+++ b/Source/core/svg/SVGFESpecularLightingElement.cpp
@@ -145,7 +145,7 @@
         return;
     }
 
-    SVGElementInstance::InvalidationGuard invalidationGuard(this);
+    SVGElement::InvalidationGuard invalidationGuard(this);
 
     if (attrName == SVGNames::surfaceScaleAttr
         || attrName == SVGNames::specularConstantAttr
diff --git a/Source/core/svg/SVGFETileElement.cpp b/Source/core/svg/SVGFETileElement.cpp
index 9f5e475..f71e694 100644
--- a/Source/core/svg/SVGFETileElement.cpp
+++ b/Source/core/svg/SVGFETileElement.cpp
@@ -74,7 +74,7 @@
         return;
     }
 
-    SVGElementInstance::InvalidationGuard invalidationGuard(this);
+    SVGElement::InvalidationGuard invalidationGuard(this);
 
     if (attrName == SVGNames::inAttr) {
         invalidate();
diff --git a/Source/core/svg/SVGFETurbulenceElement.cpp b/Source/core/svg/SVGFETurbulenceElement.cpp
index 8bb68c0..eb3aade 100644
--- a/Source/core/svg/SVGFETurbulenceElement.cpp
+++ b/Source/core/svg/SVGFETurbulenceElement.cpp
@@ -136,7 +136,7 @@
         return;
     }
 
-    SVGElementInstance::InvalidationGuard invalidationGuard(this);
+    SVGElement::InvalidationGuard invalidationGuard(this);
 
     if (attrName == SVGNames::baseFrequencyAttr
         || attrName == SVGNames::numOctavesAttr
diff --git a/Source/core/svg/SVGFilterElement.cpp b/Source/core/svg/SVGFilterElement.cpp
index 2a12099..2b0f234 100644
--- a/Source/core/svg/SVGFilterElement.cpp
+++ b/Source/core/svg/SVGFilterElement.cpp
@@ -125,7 +125,7 @@
         return;
     }
 
-    SVGElementInstance::InvalidationGuard invalidationGuard(this);
+    SVGElement::InvalidationGuard invalidationGuard(this);
 
     if (attrName == SVGNames::xAttr
         || attrName == SVGNames::yAttr
diff --git a/Source/core/svg/SVGFilterPrimitiveStandardAttributes.cpp b/Source/core/svg/SVGFilterPrimitiveStandardAttributes.cpp
index 0536763..8fc80ab 100644
--- a/Source/core/svg/SVGFilterPrimitiveStandardAttributes.cpp
+++ b/Source/core/svg/SVGFilterPrimitiveStandardAttributes.cpp
@@ -103,7 +103,7 @@
         return;
     }
 
-    SVGElementInstance::InvalidationGuard invalidationGuard(this);
+    SVGElement::InvalidationGuard invalidationGuard(this);
     invalidate();
 }
 
diff --git a/Source/core/svg/SVGForeignObjectElement.cpp b/Source/core/svg/SVGForeignObjectElement.cpp
index a588a67..aa6cc75 100644
--- a/Source/core/svg/SVGForeignObjectElement.cpp
+++ b/Source/core/svg/SVGForeignObjectElement.cpp
@@ -96,12 +96,13 @@
 {
     if (name == SVGNames::widthAttr || name == SVGNames::heightAttr) {
         RefPtr<SVGLength> length = SVGLength::create(LengthModeOther);
-        length->setValueAsString(value, IGNORE_EXCEPTION);
-        if (length->unitType() != LengthTypeUnknown) {
+        TrackExceptionState exceptionState;
+        length->setValueAsString(value, exceptionState);
+        if (!exceptionState.hadException()) {
             if (name == SVGNames::widthAttr)
-                addPropertyToPresentationAttributeStyle(style, CSSPropertyWidth, length->valueAsString());
+                addPropertyToPresentationAttributeStyle(style, CSSPropertyWidth, value);
             else if (name == SVGNames::heightAttr)
-                addPropertyToPresentationAttributeStyle(style, CSSPropertyHeight, length->valueAsString());
+                addPropertyToPresentationAttributeStyle(style, CSSPropertyHeight, value);
         }
     } else {
         SVGGraphicsElement::collectStyleForPresentationAttribute(name, value, style);
@@ -120,7 +121,7 @@
         setNeedsStyleRecalc(LocalStyleChange);
     }
 
-    SVGElementInstance::InvalidationGuard invalidationGuard(this);
+    SVGElement::InvalidationGuard invalidationGuard(this);
 
     bool isLengthAttribute = attrName == SVGNames::xAttr
                           || attrName == SVGNames::yAttr
diff --git a/Source/core/svg/SVGGElement.cpp b/Source/core/svg/SVGGElement.cpp
index ed9496e..5280d98 100644
--- a/Source/core/svg/SVGGElement.cpp
+++ b/Source/core/svg/SVGGElement.cpp
@@ -64,7 +64,7 @@
         return;
     }
 
-    SVGElementInstance::InvalidationGuard invalidationGuard(this);
+    SVGElement::InvalidationGuard invalidationGuard(this);
 
     if (RenderObject* renderer = this->renderer())
         RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
diff --git a/Source/core/svg/SVGGradientElement.cpp b/Source/core/svg/SVGGradientElement.cpp
index 8c28094..5685205 100644
--- a/Source/core/svg/SVGGradientElement.cpp
+++ b/Source/core/svg/SVGGradientElement.cpp
@@ -100,7 +100,7 @@
         return;
     }
 
-    SVGElementInstance::InvalidationGuard invalidationGuard(this);
+    SVGElement::InvalidationGuard invalidationGuard(this);
 
     RenderSVGResourceContainer* renderer = toRenderSVGResourceContainer(this->renderer());
     if (renderer)
diff --git a/Source/core/svg/SVGGraphicsElement.cpp b/Source/core/svg/SVGGraphicsElement.cpp
index 6d66cff..adfad4b 100644
--- a/Source/core/svg/SVGGraphicsElement.cpp
+++ b/Source/core/svg/SVGGraphicsElement.cpp
@@ -196,7 +196,7 @@
         return;
     }
 
-    SVGElementInstance::InvalidationGuard invalidationGuard(this);
+    SVGElement::InvalidationGuard invalidationGuard(this);
 
     // Reattach so the isValid() check will be run again during renderer creation.
     if (SVGTests::isKnownAttribute(attrName)) {
diff --git a/Source/core/svg/SVGImageElement.cpp b/Source/core/svg/SVGImageElement.cpp
index dedf437..26e7af0 100644
--- a/Source/core/svg/SVGImageElement.cpp
+++ b/Source/core/svg/SVGImageElement.cpp
@@ -131,7 +131,7 @@
         return;
     }
 
-    SVGElementInstance::InvalidationGuard invalidationGuard(this);
+    SVGElement::InvalidationGuard invalidationGuard(this);
 
     bool isLengthAttribute = attrName == SVGNames::xAttr
                           || attrName == SVGNames::yAttr
diff --git a/Source/core/svg/SVGLineElement.cpp b/Source/core/svg/SVGLineElement.cpp
index 5f1852d..abe03cd 100644
--- a/Source/core/svg/SVGLineElement.cpp
+++ b/Source/core/svg/SVGLineElement.cpp
@@ -87,7 +87,7 @@
         return;
     }
 
-    SVGElementInstance::InvalidationGuard invalidationGuard(this);
+    SVGElement::InvalidationGuard invalidationGuard(this);
 
     bool isLengthAttribute = attrName == SVGNames::x1Attr
                           || attrName == SVGNames::y1Attr
diff --git a/Source/core/svg/SVGLinearGradientElement.cpp b/Source/core/svg/SVGLinearGradientElement.cpp
index 81c4727..5690016 100644
--- a/Source/core/svg/SVGLinearGradientElement.cpp
+++ b/Source/core/svg/SVGLinearGradientElement.cpp
@@ -95,7 +95,7 @@
         return;
     }
 
-    SVGElementInstance::InvalidationGuard invalidationGuard(this);
+    SVGElement::InvalidationGuard invalidationGuard(this);
 
     updateRelativeLengthsInformation();
 
diff --git a/Source/core/svg/SVGMPathElement.cpp b/Source/core/svg/SVGMPathElement.cpp
index c7d969e..7bffa8b 100644
--- a/Source/core/svg/SVGMPathElement.cpp
+++ b/Source/core/svg/SVGMPathElement.cpp
@@ -126,7 +126,7 @@
         return;
     }
 
-    SVGElementInstance::InvalidationGuard invalidationGuard(this);
+    SVGElement::InvalidationGuard invalidationGuard(this);
 
     if (SVGURIReference::isKnownAttribute(attrName)) {
         buildPendingResource();
diff --git a/Source/core/svg/SVGMarkerElement.cpp b/Source/core/svg/SVGMarkerElement.cpp
index 34695b7..e1d0b62 100644
--- a/Source/core/svg/SVGMarkerElement.cpp
+++ b/Source/core/svg/SVGMarkerElement.cpp
@@ -122,7 +122,7 @@
         return;
     }
 
-    SVGElementInstance::InvalidationGuard invalidationGuard(this);
+    SVGElement::InvalidationGuard invalidationGuard(this);
 
     if (attrName == SVGNames::refXAttr
         || attrName == SVGNames::refYAttr
diff --git a/Source/core/svg/SVGMaskElement.cpp b/Source/core/svg/SVGMaskElement.cpp
index 253f4d7..99aa9e3 100644
--- a/Source/core/svg/SVGMaskElement.cpp
+++ b/Source/core/svg/SVGMaskElement.cpp
@@ -110,7 +110,7 @@
         return;
     }
 
-    SVGElementInstance::InvalidationGuard invalidationGuard(this);
+    SVGElement::InvalidationGuard invalidationGuard(this);
 
     if (attrName == SVGNames::xAttr
         || attrName == SVGNames::yAttr
diff --git a/Source/core/svg/SVGPathElement.cpp b/Source/core/svg/SVGPathElement.cpp
index 1b5bf37..0fc949b 100644
--- a/Source/core/svg/SVGPathElement.cpp
+++ b/Source/core/svg/SVGPathElement.cpp
@@ -221,7 +221,7 @@
         return;
     }
 
-    SVGElementInstance::InvalidationGuard invalidationGuard(this);
+    SVGElement::InvalidationGuard invalidationGuard(this);
 
     RenderSVGPath* renderer = toRenderSVGPath(this->renderer());
 
diff --git a/Source/core/svg/SVGPatternElement.cpp b/Source/core/svg/SVGPatternElement.cpp
index 9add4a8..2debbf4 100644
--- a/Source/core/svg/SVGPatternElement.cpp
+++ b/Source/core/svg/SVGPatternElement.cpp
@@ -116,7 +116,7 @@
         return;
     }
 
-    SVGElementInstance::InvalidationGuard invalidationGuard(this);
+    SVGElement::InvalidationGuard invalidationGuard(this);
 
     if (attrName == SVGNames::xAttr
         || attrName == SVGNames::yAttr
diff --git a/Source/core/svg/SVGPolyElement.cpp b/Source/core/svg/SVGPolyElement.cpp
index 7e3b3ae..bb0b0ad 100644
--- a/Source/core/svg/SVGPolyElement.cpp
+++ b/Source/core/svg/SVGPolyElement.cpp
@@ -70,7 +70,7 @@
         return;
     }
 
-    SVGElementInstance::InvalidationGuard invalidationGuard(this);
+    SVGElement::InvalidationGuard invalidationGuard(this);
 
     RenderSVGShape* renderer = toRenderSVGShape(this->renderer());
     if (!renderer)
diff --git a/Source/core/svg/SVGRadialGradientElement.cpp b/Source/core/svg/SVGRadialGradientElement.cpp
index 0c76c03..75c180e 100644
--- a/Source/core/svg/SVGRadialGradientElement.cpp
+++ b/Source/core/svg/SVGRadialGradientElement.cpp
@@ -109,7 +109,7 @@
         return;
     }
 
-    SVGElementInstance::InvalidationGuard invalidationGuard(this);
+    SVGElement::InvalidationGuard invalidationGuard(this);
 
     updateRelativeLengthsInformation();
 
diff --git a/Source/core/svg/SVGRectElement.cpp b/Source/core/svg/SVGRectElement.cpp
index 1a3399e..95dbbcb 100644
--- a/Source/core/svg/SVGRectElement.cpp
+++ b/Source/core/svg/SVGRectElement.cpp
@@ -98,7 +98,7 @@
         return;
     }
 
-    SVGElementInstance::InvalidationGuard invalidationGuard(this);
+    SVGElement::InvalidationGuard invalidationGuard(this);
 
     bool isLengthAttribute = attrName == SVGNames::xAttr
                           || attrName == SVGNames::yAttr
diff --git a/Source/core/svg/SVGSVGElement.cpp b/Source/core/svg/SVGSVGElement.cpp
index 29b889e..2d1c466 100644
--- a/Source/core/svg/SVGSVGElement.cpp
+++ b/Source/core/svg/SVGSVGElement.cpp
@@ -213,9 +213,6 @@
 {
     if (RenderObject* object = renderer())
         object->setNeedsLayout();
-
-    if (parentNode() == document() && document().renderer())
-        document().renderer()->repaint();
 }
 
 void SVGSVGElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
@@ -273,8 +270,9 @@
 {
     if (isOutermostSVGSVGElement() && (name == SVGNames::widthAttr || name == SVGNames::heightAttr)) {
         RefPtr<SVGLength> length = SVGLength::create(LengthModeOther);
-        length->setValueAsString(value, IGNORE_EXCEPTION);
-        if (length->unitType() != LengthTypeUnknown) {
+        TrackExceptionState exceptionState;
+        length->setValueAsString(value, exceptionState);
+        if (!exceptionState.hadException()) {
             if (name == SVGNames::widthAttr)
                 addPropertyToPresentationAttributeStyle(style, CSSPropertyWidth, value);
             else if (name == SVGNames::heightAttr)
@@ -319,7 +317,7 @@
             object->setNeedsTransformUpdate();
     }
 
-    SVGElementInstance::InvalidationGuard invalidationGuard(this);
+    SVGElement::InvalidationGuard invalidationGuard(this);
 
     if (updateRelativeLengthsOrViewBox
         || SVGZoomAndPan::isKnownAttribute(attrName)) {
@@ -773,4 +771,17 @@
         view->setZoomAndPan(zoomAndPan());
 }
 
+void SVGSVGElement::finishParsingChildren()
+{
+    SVGGraphicsElement::finishParsingChildren();
+
+    // The outermost SVGSVGElement SVGLoad event is fired through Document::dispatchWindowLoadEvent.
+    if (isOutermostSVGSVGElement())
+        return;
+
+    // finishParsingChildren() is called when the close tag is reached for an element (e.g. </svg>)
+    // we send SVGLoad events here if we can, otherwise they'll be sent when any required loads finish
+    sendSVGLoadEventIfPossible();
+}
+
 }
diff --git a/Source/core/svg/SVGSVGElement.h b/Source/core/svg/SVGSVGElement.h
index 32c9836..f9a8d79 100644
--- a/Source/core/svg/SVGSVGElement.h
+++ b/Source/core/svg/SVGSVGElement.h
@@ -136,6 +136,8 @@
 
     void updateCurrentTranslate();
 
+    virtual void finishParsingChildren() OVERRIDE;
+
     enum CheckIntersectionOrEnclosure {
         CheckIntersection,
         CheckEnclosure
diff --git a/Source/core/svg/SVGScriptElement.cpp b/Source/core/svg/SVGScriptElement.cpp
index 83782db..1199337 100644
--- a/Source/core/svg/SVGScriptElement.cpp
+++ b/Source/core/svg/SVGScriptElement.cpp
@@ -85,7 +85,7 @@
         return;
     }
 
-    SVGElementInstance::InvalidationGuard invalidationGuard(this);
+    SVGElement::InvalidationGuard invalidationGuard(this);
 
     if (attrName == SVGNames::typeAttr || attrName == HTMLNames::onerrorAttr)
         return;
diff --git a/Source/core/svg/SVGStopElement.cpp b/Source/core/svg/SVGStopElement.cpp
index 294797b..17fe49e 100644
--- a/Source/core/svg/SVGStopElement.cpp
+++ b/Source/core/svg/SVGStopElement.cpp
@@ -74,7 +74,7 @@
         return;
     }
 
-    SVGElementInstance::InvalidationGuard invalidationGuard(this);
+    SVGElement::InvalidationGuard invalidationGuard(this);
 
     if (!renderer())
         return;
diff --git a/Source/core/svg/SVGStyleElement.cpp b/Source/core/svg/SVGStyleElement.cpp
index 2c09b7b..94114dd 100644
--- a/Source/core/svg/SVGStyleElement.cpp
+++ b/Source/core/svg/SVGStyleElement.cpp
@@ -38,11 +38,7 @@
 
 SVGStyleElement::~SVGStyleElement()
 {
-#if ENABLE(OILPAN)
-    // Remove this once StyleSheet has a strong pointer to its owner.
-    if (m_sheet)
-        m_sheet->clearOwnerNode();
-#else
+#if !ENABLE(OILPAN)
     StyleElement::clearDocumentData(document(), this);
 #endif
 }
@@ -154,4 +150,10 @@
     StyleElement::childrenChanged(this);
 }
 
+void SVGStyleElement::trace(Visitor* visitor)
+{
+    StyleElement::trace(visitor);
+    SVGElement::trace(visitor);
+}
+
 }
diff --git a/Source/core/svg/SVGStyleElement.h b/Source/core/svg/SVGStyleElement.h
index 1490667..3c68587 100644
--- a/Source/core/svg/SVGStyleElement.h
+++ b/Source/core/svg/SVGStyleElement.h
@@ -29,6 +29,7 @@
 
 class SVGStyleElement FINAL : public SVGElement
                             , public StyleElement {
+    WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(SVGStyleElement);
 public:
     static PassRefPtr<SVGStyleElement> create(Document&, bool createdByParser);
     virtual ~SVGStyleElement();
@@ -47,6 +48,8 @@
     virtual String title() const OVERRIDE;
     void setTitle(const AtomicString&);
 
+    virtual void trace(Visitor*) OVERRIDE;
+
 private:
     SVGStyleElement(Document&, bool createdByParser);
 
diff --git a/Source/core/svg/SVGSymbolElement.cpp b/Source/core/svg/SVGSymbolElement.cpp
index 1acac8b..3e33cc1 100644
--- a/Source/core/svg/SVGSymbolElement.cpp
+++ b/Source/core/svg/SVGSymbolElement.cpp
@@ -72,7 +72,7 @@
         return;
     }
 
-    SVGElementInstance::InvalidationGuard invalidationGuard(this);
+    SVGElement::InvalidationGuard invalidationGuard(this);
 
     // Every other property change is ignored.
     if (attrName == SVGNames::viewBoxAttr)
diff --git a/Source/core/svg/SVGTextContentElement.cpp b/Source/core/svg/SVGTextContentElement.cpp
index 9aaeb1b..6b9db03 100644
--- a/Source/core/svg/SVGTextContentElement.cpp
+++ b/Source/core/svg/SVGTextContentElement.cpp
@@ -255,7 +255,7 @@
     if (attrName == SVGNames::textLengthAttr)
         m_textLengthIsSpecifiedByUser = true;
 
-    SVGElementInstance::InvalidationGuard invalidationGuard(this);
+    SVGElement::InvalidationGuard invalidationGuard(this);
 
     if (RenderObject* renderer = this->renderer())
         RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
diff --git a/Source/core/svg/SVGTextPathElement.cpp b/Source/core/svg/SVGTextPathElement.cpp
index ff06f81..ce5165d 100644
--- a/Source/core/svg/SVGTextPathElement.cpp
+++ b/Source/core/svg/SVGTextPathElement.cpp
@@ -118,7 +118,7 @@
         return;
     }
 
-    SVGElementInstance::InvalidationGuard invalidationGuard(this);
+    SVGElement::InvalidationGuard invalidationGuard(this);
 
     if (SVGURIReference::isKnownAttribute(attrName)) {
         buildPendingResource();
diff --git a/Source/core/svg/SVGTextPositioningElement.cpp b/Source/core/svg/SVGTextPositioningElement.cpp
index b73b7e1..707f160 100644
--- a/Source/core/svg/SVGTextPositioningElement.cpp
+++ b/Source/core/svg/SVGTextPositioningElement.cpp
@@ -93,7 +93,7 @@
         return;
     }
 
-    SVGElementInstance::InvalidationGuard invalidationGuard(this);
+    SVGElement::InvalidationGuard invalidationGuard(this);
 
     bool updateRelativeLengths = attrName == SVGNames::xAttr
                               || attrName == SVGNames::yAttr
diff --git a/Source/core/svg/SVGTransformList.cpp b/Source/core/svg/SVGTransformList.cpp
index f449003..f335bc2 100644
--- a/Source/core/svg/SVGTransformList.cpp
+++ b/Source/core/svg/SVGTransformList.cpp
@@ -313,18 +313,18 @@
     RefPtr<SVGTransformList> toList = toSVGTransformList(toValue);
     RefPtr<SVGTransformList> toAtEndOfDurationList = toSVGTransformList(toAtEndOfDurationValue);
 
-    size_t fromListSize = fromList->length();
     size_t toListSize = toList->length();
-
     if (!toListSize)
         return;
 
+    // Get a reference to the from value before potentially cleaning it out (in the case of a To animation.)
+    RefPtr<SVGTransform> toTransform = toList->at(0);
+    RefPtr<SVGTransform> effectiveFrom = fromList->length() ? fromList->at(0) : SVGTransform::create(toTransform->transformType(), SVGTransform::ConstructZeroTransform);
+
     // Never resize the animatedTransformList to the toList size, instead either clear the list or append to it.
     if (!isEmpty() && !animationElement->isAdditive())
         clear();
 
-    RefPtr<SVGTransform> toTransform = toList->at(0);
-    RefPtr<SVGTransform> effectiveFrom = fromListSize ? fromList->at(0) : SVGTransform::create(toTransform->transformType(), SVGTransform::ConstructZeroTransform);
     RefPtr<SVGTransform> currentTransform = SVGTransformDistance(effectiveFrom, toTransform).scaledDistance(percentage).addToSVGTransform(effectiveFrom);
     if (animationElement->isAccumulated() && repeatCount) {
         RefPtr<SVGTransform> effectiveToAtEnd = !toAtEndOfDurationList->isEmpty() ? toAtEndOfDurationList->at(0) : SVGTransform::create(toTransform->transformType(), SVGTransform::ConstructZeroTransform);
diff --git a/Source/core/svg/SVGUseElement.cpp b/Source/core/svg/SVGUseElement.cpp
index ecdea38..d3457b2 100644
--- a/Source/core/svg/SVGUseElement.cpp
+++ b/Source/core/svg/SVGUseElement.cpp
@@ -43,12 +43,6 @@
 #include "core/svg/SVGSVGElement.h"
 #include "core/xml/parser/XMLDocumentParser.h"
 
-// Dump SVGElementInstance object tree - useful to debug instanceRoot problems
-// #define DUMP_INSTANCE_TREE
-
-// Dump the deep-expanded shadow tree (where the renderers are built from)
-// #define DUMP_SHADOW_TREE
-
 namespace WebCore {
 
 inline SVGUseElement::SVGUseElement(Document& document, bool wasInsertedByParser)
@@ -194,6 +188,30 @@
     return 0;
 }
 
+void transferUseWidthAndHeightIfNeeded(const SVGUseElement& use, SVGElement* shadowElement, const SVGElement& originalElement)
+{
+    ASSERT(shadowElement);
+    if (isSVGSymbolElement(*shadowElement)) {
+        // Spec (<use> on <symbol>): This generated 'svg' will always have explicit values for attributes width and height.
+        // If attributes width and/or height are provided on the 'use' element, then these attributes
+        // will be transferred to the generated 'svg'. If attributes width and/or height are not specified,
+        // the generated 'svg' element will use values of 100% for these attributes.
+        shadowElement->setAttribute(SVGNames::widthAttr, use.width()->isSpecified() ? AtomicString(use.width()->currentValue()->valueAsString()) : "100%");
+        shadowElement->setAttribute(SVGNames::heightAttr, use.height()->isSpecified() ? AtomicString(use.height()->currentValue()->valueAsString()) : "100%");
+    } else if (isSVGSVGElement(*shadowElement)) {
+        // Spec (<use> on <svg>): If attributes width and/or height are provided on the 'use' element, then these
+        // values will override the corresponding attributes on the 'svg' in the generated tree.
+        if (use.width()->isSpecified())
+            shadowElement->setAttribute(SVGNames::widthAttr, AtomicString(use.width()->currentValue()->valueAsString()));
+        else
+            shadowElement->setAttribute(SVGNames::widthAttr, originalElement.getAttribute(SVGNames::widthAttr));
+        if (use.height()->isSpecified())
+            shadowElement->setAttribute(SVGNames::heightAttr, AtomicString(use.height()->currentValue()->valueAsString()));
+        else
+            shadowElement->setAttribute(SVGNames::heightAttr, originalElement.getAttribute(SVGNames::heightAttr));
+    }
+}
+
 void SVGUseElement::svgAttributeChanged(const QualifiedName& attrName)
 {
     if (!isSupportedAttribute(attrName)) {
@@ -201,7 +219,7 @@
         return;
     }
 
-    SVGElementInstance::InvalidationGuard invalidationGuard(this);
+    SVGElement::InvalidationGuard invalidationGuard(this);
 
     RenderObject* renderer = this->renderer();
     if (attrName == SVGNames::xAttr
@@ -209,6 +227,10 @@
         || attrName == SVGNames::widthAttr
         || attrName == SVGNames::heightAttr) {
         updateRelativeLengthsInformation();
+        if (m_targetElementInstance) {
+            ASSERT(m_targetElementInstance->correspondingElement());
+            transferUseWidthAndHeightIfNeeded(*this, m_targetElementInstance->shadowTreeElement(), *m_targetElementInstance->correspondingElement());
+        }
         if (renderer)
             RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
         return;
@@ -238,58 +260,6 @@
     ASSERT_NOT_REACHED();
 }
 
-#ifdef DUMP_INSTANCE_TREE
-static void dumpInstanceTree(unsigned& depth, String& text, SVGElementInstance* targetInstance)
-{
-    SVGElement* element = targetInstance->correspondingElement();
-    ASSERT(element);
-
-    if (isSVGUseElement(*element) && toSVGUseElement(*element).resourceIsStillLoading())
-        return;
-
-    SVGElement* shadowTreeElement = targetInstance->shadowTreeElement();
-    ASSERT(shadowTreeElement);
-
-    SVGUseElement* directUseElement = targetInstance->directUseElement();
-    String directUseElementName = directUseElement ? directUseElement->nodeName() : "null";
-
-    String elementId = element->getIdAttribute();
-    String elementNodeName = element->nodeName();
-    String shadowTreeElementNodeName = shadowTreeElement->nodeName();
-    String parentNodeName = element->parentNode() ? element->parentNode()->nodeName() : "null";
-    String firstChildNodeName = element->firstChild() ? element->firstChild()->nodeName() : "null";
-
-    for (unsigned i = 0; i < depth; ++i)
-        text += "  ";
-
-    text += String::format("SVGElementInstance this=%p, (parentNode=%s (%p), firstChild=%s (%p), correspondingElement=%s (%p), directUseElement=%s (%p), shadowTreeElement=%s (%p), id=%s)\n",
-                           targetInstance, parentNodeName.latin1().data(), element->parentNode(), firstChildNodeName.latin1().data(), element->firstChild(),
-                           elementNodeName.latin1().data(), element, directUseElementName.latin1().data(), directUseElement, shadowTreeElementNodeName.latin1().data(), shadowTreeElement, elementId.latin1().data());
-
-    for (unsigned i = 0; i < depth; ++i)
-        text += "  ";
-
-    const HashSet<SVGElementInstance*>& elementInstances = element->instancesForElement();
-    text += "Corresponding element is associated with " + String::number(elementInstances.size()) + " instance(s):\n";
-
-    const HashSet<SVGElementInstance*>::const_iterator end = elementInstances.end();
-    for (HashSet<SVGElementInstance*>::const_iterator it = elementInstances.begin(); it != end; ++it) {
-        for (unsigned i = 0; i < depth; ++i)
-            text += "  ";
-
-        text += String::format(" -> SVGElementInstance this=%p, (refCount: %i, shadowTreeElement in document? %i)\n",
-                               *it, (*it)->refCount(), (*it)->shadowTreeElement()->inDocument());
-    }
-
-    ++depth;
-
-    for (SVGElementInstance* instance = targetInstance->firstChild(); instance; instance = instance->nextSibling())
-        dumpInstanceTree(depth, text, instance);
-
-    --depth;
-}
-#endif
-
 static bool isDisallowedElement(Node* node)
 {
     // Spec: "Any 'svg', 'symbol', 'g', graphics element or other 'use' is potentially a template object that can be re-used
@@ -354,15 +324,15 @@
 
 void SVGUseElement::clearResourceReferences()
 {
-    // FIXME: We should try to optimize this, to at least allow partial reclones.
-    if (ShadowRoot* shadowTreeRootElement = userAgentShadowRoot())
-        shadowTreeRootElement->removeChildren();
-
     if (m_targetElementInstance) {
         m_targetElementInstance->detach();
         m_targetElementInstance = nullptr;
     }
 
+    // FIXME: We should try to optimize this, to at least allow partial reclones.
+    if (ShadowRoot* shadowTreeRootElement = userAgentShadowRoot())
+        shadowTreeRootElement->removeChildren();
+
     m_needsShadowTreeRecreation = false;
     document().unscheduleUseShadowTreeUpdate(*this);
 
@@ -453,7 +423,7 @@
 
     // Build shadow tree from instance tree
     // This also handles the special cases: <use> on <symbol>, <use> on <svg>.
-    buildShadowTree(target, m_targetElementInstance.get());
+    buildShadowTree(target, m_targetElementInstance.get(), shadowTreeRootElement);
 
     // Expand all <use> elements in the shadow tree.
     // Expand means: replace the actual <use> element by what it references.
@@ -463,41 +433,30 @@
     // Expand means: replace the actual <symbol> element by the <svg> element.
     expandSymbolElementsInShadowTree(shadowTreeRootElement);
 
-    // Now that the shadow tree is completly expanded, we can associate
-    // shadow tree elements <-> instances in the instance tree.
-    associateInstancesWithShadowTreeElements(shadowTreeRootElement->firstChild(), m_targetElementInstance.get());
-
     // If no shadow tree element is present, this means that the reference root
     // element was removed, as it is disallowed (ie. <use> on <foreignObject>)
     // Do NOT leave an inconsistent instance tree around, instead destruct it.
-    if (!m_targetElementInstance->shadowTreeElement()) {
+    Node* shadowTreeTargetNode = shadowTreeRootElement->firstChild();
+    if (!shadowTreeTargetNode) {
         clearResourceReferences();
         return;
     }
 
-    ASSERT(m_targetElementInstance->shadowTreeElement()->parentNode() == shadowTreeRootElement);
+    // Now that the shadow tree is completly expanded, we can associate
+    // shadow tree elements <-> instances in the instance tree.
+    associateInstancesWithShadowTreeElements(shadowTreeTargetNode, m_targetElementInstance.get());
+
+    SVGElement* shadowTreeTargetElement = toSVGElement(shadowTreeTargetNode);
+    ASSERT(shadowTreeTargetElement->correspondingElement());
+    transferUseWidthAndHeightIfNeeded(*this, shadowTreeTargetElement, *shadowTreeTargetElement->correspondingElement());
+
+    ASSERT(shadowTreeTargetElement->parentNode() == shadowTreeRootElement);
 
     // Transfer event listeners assigned to the referenced element to our shadow tree elements.
-    transferEventListenersToShadowTree(m_targetElementInstance.get());
+    transferEventListenersToShadowTree(shadowTreeTargetElement);
 
     // Update relative length information.
     updateRelativeLengthsInformation();
-
-    // Eventually dump instance tree
-#ifdef DUMP_INSTANCE_TREE
-    String text;
-    unsigned depth = 0;
-
-    dumpInstanceTree(depth, text, m_targetElementInstance.get());
-    fprintf(stderr, "\nDumping <use> instance tree:\n%s\n", text.latin1().data());
-#endif
-
-    // Eventually dump shadow tree
-#ifdef DUMP_SHADOW_TREE
-    RefPtr<XMLSerializer> serializer = XMLSerializer::create();
-    String markup = serializer->serializeToString(shadowTreeRootElement, ASSERT_NO_EXCEPTION);
-    fprintf(stderr, "Dumping <use> shadow tree markup:\n%s\n", markup.latin1().data());
-#endif
 }
 
 RenderObject* SVGUseElement::createRenderer(RenderStyle*)
@@ -520,7 +479,7 @@
 {
     ASSERT(path.isEmpty());
 
-    Node* n = m_targetElementInstance ? m_targetElementInstance->shadowTreeElement() : 0;
+    Node* n = userAgentShadowRoot()->firstChild();
     if (!n)
         return;
 
@@ -540,12 +499,10 @@
 
 RenderObject* SVGUseElement::rendererClipChild() const
 {
-    Node* n = m_targetElementInstance ? m_targetElementInstance->shadowTreeElement() : 0;
-    if (!n)
-        return 0;
-
-    if (n->isSVGElement() && isDirectReference(*n))
-        return toSVGElement(n)->renderer();
+    if (Node* n = userAgentShadowRoot()->firstChild()) {
+        if (n->isSVGElement() && isDirectReference(*n))
+            return toSVGElement(n)->renderer();
+    }
 
     return 0;
 }
@@ -651,7 +608,7 @@
     }
 }
 
-void SVGUseElement::buildShadowTree(SVGElement* target, SVGElementInstance* targetInstance)
+void SVGUseElement::buildShadowTree(SVGElement* target, SVGElementInstance* targetInstance, ShadowRoot* shadowTreeRootElement)
 {
     // For instance <use> on <foreignObject> (direct case).
     if (isDisallowedElement(target))
@@ -667,7 +624,7 @@
     if (subtreeContainsDisallowedElement(newChild.get()))
         removeDisallowedElementsFromSubtree(*newChild);
 
-    userAgentShadowRoot()->appendChild(newChild.release());
+    shadowTreeRootElement->appendChild(newChild.release());
 }
 
 void SVGUseElement::expandUseElementsInShadowTree(Node* element)
@@ -702,6 +659,7 @@
         if (target && !isDisallowedElement(target)) {
             RefPtr<Element> newChild = target->cloneElementWithChildren();
             ASSERT(newChild->isSVGElement());
+            transferUseWidthAndHeightIfNeeded(*use, toSVGElement(newChild.get()), *target);
             cloneParent->appendChild(newChild.release());
         }
 
@@ -776,21 +734,18 @@
         expandSymbolElementsInShadowTree(child.get());
 }
 
-void SVGUseElement::transferEventListenersToShadowTree(SVGElementInstance* target)
+void SVGUseElement::transferEventListenersToShadowTree(SVGElement* shadowTreeTargetElement)
 {
-    if (!target)
+    if (!shadowTreeTargetElement)
         return;
 
-    SVGElement* originalElement = target->correspondingElement();
+    SVGElement* originalElement = shadowTreeTargetElement->correspondingElement();
     ASSERT(originalElement);
+    if (EventTargetData* data = originalElement->eventTargetData())
+        data->eventListenerMap.copyEventListenersNotCreatedFromMarkupToTarget(shadowTreeTargetElement);
 
-    if (SVGElement* shadowTreeElement = target->shadowTreeElement()) {
-        if (EventTargetData* data = originalElement->eventTargetData())
-            data->eventListenerMap.copyEventListenersNotCreatedFromMarkupToTarget(shadowTreeElement);
-    }
-
-    for (SVGElementInstance* instance = target->firstChild(); instance; instance = instance->nextSibling())
-        transferEventListenersToShadowTree(instance);
+    for (SVGElement* child = Traversal<SVGElement>::firstChild(*shadowTreeTargetElement); child; child = Traversal<SVGElement>::nextSibling(*child))
+        transferEventListenersToShadowTree(child);
 }
 
 void SVGUseElement::associateInstancesWithShadowTreeElements(Node* target, SVGElementInstance* targetInstance)
@@ -867,9 +822,9 @@
 void SVGUseElement::invalidateDependentShadowTrees()
 {
     // Recursively invalidate dependent <use> shadow trees
-    const HashSet<SVGElementInstance*>& instances = instancesForElement();
-    const HashSet<SVGElementInstance*>::const_iterator end = instances.end();
-    for (HashSet<SVGElementInstance*>::const_iterator it = instances.begin(); it != end; ++it) {
+    const WillBeHeapHashSet<RawPtrWillBeWeakMember<SVGElement> >& instances = instancesForElement();
+    const WillBeHeapHashSet<RawPtrWillBeWeakMember<SVGElement> >::const_iterator end = instances.end();
+    for (WillBeHeapHashSet<RawPtrWillBeWeakMember<SVGElement> >::const_iterator it = instances.begin(); it != end; ++it) {
         if (SVGUseElement* element = (*it)->correspondingUseElement()) {
             ASSERT(element->inDocument());
             element->invalidateShadowTree();
@@ -971,4 +926,10 @@
         m_resource->addClient(this);
 }
 
+void SVGUseElement::trace(Visitor* visitor)
+{
+    visitor->trace(m_targetElementInstance);
+    SVGGraphicsElement::trace(visitor);
+}
+
 }
diff --git a/Source/core/svg/SVGUseElement.h b/Source/core/svg/SVGUseElement.h
index 87e82a2..dd29b2b 100644
--- a/Source/core/svg/SVGUseElement.h
+++ b/Source/core/svg/SVGUseElement.h
@@ -55,6 +55,8 @@
 
     virtual void buildPendingResource() OVERRIDE;
 
+    virtual void trace(Visitor*) OVERRIDE;
+
 private:
     SVGUseElement(Document&, bool wasInsertedByParser);
 
@@ -84,7 +86,7 @@
     bool hasCycleUseReferencing(SVGUseElement*, SVGElementInstance* targetInstance, SVGElement*& newTarget);
 
     // Shadow tree handling
-    void buildShadowTree(SVGElement* target, SVGElementInstance* targetInstance);
+    void buildShadowTree(SVGElement* target, SVGElementInstance* targetInstance, ShadowRoot* shadowTreeRootElement);
 
     void expandUseElementsInShadowTree(Node* element);
     void expandSymbolElementsInShadowTree(Node* element);
@@ -94,7 +96,7 @@
     SVGElementInstance* instanceForShadowTreeElement(Node* element, SVGElementInstance* instance) const;
 
     void transferUseAttributesToReplacedElement(SVGElement* from, SVGElement* to) const;
-    void transferEventListenersToShadowTree(SVGElementInstance* target);
+    void transferEventListenersToShadowTree(SVGElement* shadowTreeTargetElement);
 
     RefPtr<SVGAnimatedLength> m_x;
     RefPtr<SVGAnimatedLength> m_y;
@@ -113,7 +115,7 @@
     bool m_wasInsertedByParser;
     bool m_haveFiredLoadEvent;
     bool m_needsShadowTreeRecreation;
-    RefPtr<SVGElementInstance> m_targetElementInstance;
+    RefPtrWillBeMember<SVGElementInstance> m_targetElementInstance;
     ResourcePtr<DocumentResource> m_resource;
     Timer<SVGElement> m_svgLoadEventTimer;
 };
diff --git a/Source/core/svg/animation/SVGSMILElement.cpp b/Source/core/svg/animation/SVGSMILElement.cpp
index f91e405..2d68d22 100644
--- a/Source/core/svg/animation/SVGSMILElement.cpp
+++ b/Source/core/svg/animation/SVGSMILElement.cpp
@@ -169,7 +169,7 @@
 SVGSMILElement::SVGSMILElement(const QualifiedName& tagName, Document& doc)
     : SVGElement(tagName, doc)
     , m_attributeName(anyQName())
-    , m_targetElement(0)
+    , m_targetElement(nullptr)
     , m_syncBaseConditionsConnected(false)
     , m_hasEndEventConditions(false)
     , m_isWaitingForFirstInterval(true)
@@ -199,9 +199,11 @@
     smilBeginEventSender().cancelEvent(this);
     smilRepeatEventSender().cancelEvent(this);
     smilRepeatNEventSender().cancelEvent(this);
+#if !ENABLE(OILPAN)
     clearConditions();
     if (m_timeContainer && m_targetElement && hasValidAttributeName())
         m_timeContainer->unschedule(this, m_targetElement, m_attributeName);
+#endif
 }
 
 void SVGSMILElement::clearResourceAndEventBaseReferences()
@@ -268,7 +270,7 @@
 
     AtomicString prefix;
     AtomicString localName;
-    if (!Document::parseQualifiedName(attributeName, prefix, localName, ASSERT_NO_EXCEPTION))
+    if (!Document::parseQualifiedName(attributeName, prefix, localName, IGNORE_EXCEPTION))
         return anyQName();
 
     const AtomicString& namespaceURI = svgElement->lookupNamespaceURI(prefix);
@@ -562,7 +564,7 @@
     else if (attrName == SVGNames::attributeNameAttr)
         setAttributeName(constructQualifiedName(this, fastGetAttribute(SVGNames::attributeNameAttr)));
     else if (attrName.matches(XLinkNames::hrefAttr)) {
-        SVGElementInstance::InvalidationGuard invalidationGuard(this);
+        SVGElement::InvalidationGuard invalidationGuard(this);
         buildPendingResource();
         if (m_targetElement)
             clearAnimatedType(m_targetElement);
@@ -1330,4 +1332,10 @@
     }
 }
 
+void SVGSMILElement::trace(Visitor* visitor)
+{
+    visitor->trace(m_targetElement);
+    SVGElement::trace(visitor);
+}
+
 }
diff --git a/Source/core/svg/animation/SVGSMILElement.h b/Source/core/svg/animation/SVGSMILElement.h
index 3290a00..9b7452b 100644
--- a/Source/core/svg/animation/SVGSMILElement.h
+++ b/Source/core/svg/animation/SVGSMILElement.h
@@ -117,6 +117,8 @@
 
     virtual bool isSVGDiscardElement() const { return false; }
 
+    void trace(Visitor*) OVERRIDE;
+
 protected:
     void addBeginTime(SMILTime eventTime, SMILTime endTime, SMILTimeWithOrigin::Origin = SMILTimeWithOrigin::ParserOrigin);
     void addEndTime(SMILTime eventTime, SMILTime endTime, SMILTimeWithOrigin::Origin = SMILTimeWithOrigin::ParserOrigin);
@@ -205,7 +207,7 @@
     float calculateAnimationPercentAndRepeat(SMILTime elapsed, unsigned& repeat) const;
     SMILTime calculateNextProgressTime(SMILTime elapsed) const;
 
-    SVGElement* m_targetElement;
+    RawPtrWillBeMember<SVGElement> m_targetElement;
 
     Vector<Condition> m_conditions;
     bool m_syncBaseConditionsConnected;
diff --git a/Source/core/svg/graphics/SVGImage.cpp b/Source/core/svg/graphics/SVGImage.cpp
index fc7d45a..0ffe311 100644
--- a/Source/core/svg/graphics/SVGImage.cpp
+++ b/Source/core/svg/graphics/SVGImage.cpp
@@ -39,7 +39,7 @@
 #include "core/page/Chrome.h"
 #include "core/rendering/style/RenderStyle.h"
 #include "core/rendering/svg/RenderSVGRoot.h"
-#include "core/svg/SVGDocument.h"
+#include "core/svg/SVGDocumentExtensions.h"
 #include "core/svg/SVGFEImageElement.h"
 #include "core/svg/SVGImageElement.h"
 #include "core/svg/SVGSVGElement.h"
@@ -92,7 +92,7 @@
 
     RELEASE_ASSERT(frame->document()->loadEventFinished());
 
-    SVGSVGElement* rootElement = toSVGDocument(frame->document())->rootElement();
+    SVGSVGElement* rootElement = frame->document()->accessSVGExtensions().rootElement();
     if (!rootElement)
         return true;
 
@@ -122,7 +122,7 @@
     if (!page)
         return 0;
     LocalFrame* frame = page->mainFrame();
-    return toSVGDocument(frame->document())->rootElement();
+    return frame->document()->accessSVGExtensions().rootElement();
 }
 
 void SVGImage::setContainerSize(const IntSize& size)
@@ -275,6 +275,9 @@
     FrameView* view = frameView();
     view->resize(containerSize());
 
+    if (!m_url.isEmpty())
+        view->scrollToFragment(m_url);
+
     if (view->needsLayout())
         view->layout();
 
diff --git a/Source/core/svg/graphics/SVGImage.h b/Source/core/svg/graphics/SVGImage.h
index 891d1bc..3b491ee 100644
--- a/Source/core/svg/graphics/SVGImage.h
+++ b/Source/core/svg/graphics/SVGImage.h
@@ -29,6 +29,7 @@
 
 #include "platform/graphics/Image.h"
 #include "platform/heap/Handle.h"
+#include "platform/weborigin/KURL.h"
 
 namespace WebCore {
 
@@ -53,6 +54,7 @@
 
     virtual bool isSVGImage() const OVERRIDE { return true; }
     virtual IntSize size() const OVERRIDE { return m_intrinsicSize; }
+    void setURL(const KURL& url) { m_url = url; }
 
     virtual bool currentFrameHasSingleSecurityOrigin() const OVERRIDE;
 
@@ -101,6 +103,7 @@
     OwnPtr<SVGImageChromeClient> m_chromeClient;
     OwnPtrWillBePersistent<Page> m_page;
     IntSize m_intrinsicSize;
+    KURL m_url;
 };
 
 DEFINE_IMAGE_TYPE_CASTS(SVGImage);
diff --git a/Source/core/svg/graphics/SVGImageCache.cpp b/Source/core/svg/graphics/SVGImageCache.cpp
index 059bbb4..26143b6 100644
--- a/Source/core/svg/graphics/SVGImageCache.cpp
+++ b/Source/core/svg/graphics/SVGImageCache.cpp
@@ -23,6 +23,7 @@
 
 #include "core/fetch/ImageResource.h"
 #include "core/frame/FrameView.h"
+#include "core/html/HTMLImageElement.h"
 #include "core/page/Page.h"
 #include "core/rendering/svg/RenderSVGRoot.h"
 #include "core/svg/graphics/SVGImage.h"
@@ -89,6 +90,14 @@
 
     RefPtr<SVGImageForContainer> imageForContainer = it->value;
     ASSERT(!imageForContainer->size().isEmpty());
+
+    Node* node = renderer->node();
+    if (node && isHTMLImageElement(node)) {
+        const AtomicString& urlString = toHTMLImageElement(node)->imageSourceURL();
+        KURL url = node->document().completeURL(urlString);
+        imageForContainer->setURL(url);
+    }
+
     return imageForContainer.get();
 }
 
diff --git a/Source/core/svg/graphics/SVGImageChromeClient.cpp b/Source/core/svg/graphics/SVGImageChromeClient.cpp
index 4df8c47..19134d0 100644
--- a/Source/core/svg/graphics/SVGImageChromeClient.cpp
+++ b/Source/core/svg/graphics/SVGImageChromeClient.cpp
@@ -29,6 +29,7 @@
 #include "config.h"
 #include "core/svg/graphics/SVGImageChromeClient.h"
 
+#include "core/dom/ScriptForbiddenScope.h"
 #include "core/frame/FrameView.h"
 #include "core/svg/graphics/SVGImage.h"
 #include "platform/graphics/ImageObserver.h"
@@ -80,12 +81,13 @@
 
 void SVGImageChromeClient::animationTimerFired(Timer<SVGImageChromeClient>*)
 {
-    // In principle, we should call requestAnimationFrame callbacks here, but
-    // we know there aren't any because script is forbidden inside SVGImages.
-    if (m_image) {
-        m_image->frameView()->page()->animator().serviceScriptedAnimations(monotonicallyIncreasingTime());
-        m_image->frameView()->updateLayoutAndStyleForPainting();
-    }
+    if (!m_image)
+        return;
+    // serviceScriptedAnimations runs requestAnimationFrame callbacks, but SVG
+    // images can't have any so we assert there's no script.
+    ScriptForbiddenScope forbidScript;
+    m_image->frameView()->page()->animator().serviceScriptedAnimations(monotonicallyIncreasingTime());
+    m_image->frameView()->updateLayoutAndStyleForPainting();
 }
 
 }
diff --git a/Source/core/svg/graphics/SVGImageForContainer.cpp b/Source/core/svg/graphics/SVGImageForContainer.cpp
index 96a0080..75d1beb 100644
--- a/Source/core/svg/graphics/SVGImageForContainer.cpp
+++ b/Source/core/svg/graphics/SVGImageForContainer.cpp
@@ -20,7 +20,6 @@
 #include "config.h"
 #include "core/svg/graphics/SVGImageForContainer.h"
 
-#include "core/svg/graphics/SVGImage.h"
 #include "platform/geometry/FloatRect.h"
 #include "platform/geometry/FloatSize.h"
 #include "wtf/PassRefPtr.h"
diff --git a/Source/core/svg/graphics/SVGImageForContainer.h b/Source/core/svg/graphics/SVGImageForContainer.h
index aea94bc..1333acf 100644
--- a/Source/core/svg/graphics/SVGImageForContainer.h
+++ b/Source/core/svg/graphics/SVGImageForContainer.h
@@ -30,6 +30,7 @@
 #include "platform/geometry/FloatRect.h"
 #include "platform/geometry/FloatSize.h"
 #include "platform/graphics/Image.h"
+#include "platform/weborigin/KURL.h"
 
 namespace WebCore {
 
@@ -43,6 +44,7 @@
     virtual bool isSVGImage() const OVERRIDE { return true; }
 
     virtual IntSize size() const OVERRIDE;
+    void setURL(const KURL& url) { m_image->setURL(url); }
 
     virtual bool usesContainerSize() const OVERRIDE { return m_image->usesContainerSize(); }
     virtual bool hasRelativeWidth() const OVERRIDE { return m_image->hasRelativeWidth(); }
diff --git a/Source/core/svg/properties/SVGAnimatedProperty.cpp b/Source/core/svg/properties/SVGAnimatedProperty.cpp
index 3506f1b..9406d2c 100644
--- a/Source/core/svg/properties/SVGAnimatedProperty.cpp
+++ b/Source/core/svg/properties/SVGAnimatedProperty.cpp
@@ -51,7 +51,11 @@
 
 SVGAnimatedPropertyBase::~SVGAnimatedPropertyBase()
 {
+    // FIXME: Oilpan: We need to investigate why this assert fails in
+    // Oilpan builds.
+#if !ENABLE(OILPAN)
     ASSERT(!isAnimating());
+#endif
 }
 
 void SVGAnimatedPropertyBase::animationStarted()
diff --git a/Source/core/testing/InternalSettings.cpp b/Source/core/testing/InternalSettings.cpp
index 1f29cca..c7b6c38 100644
--- a/Source/core/testing/InternalSettings.cpp
+++ b/Source/core/testing/InternalSettings.cpp
@@ -121,8 +121,6 @@
 #endif
     InternalSettings* internalSettings() const { return m_internalSettings.get(); }
 
-    virtual void trace(Visitor*) OVERRIDE { }
-
 private:
     RefPtr<InternalSettings> m_internalSettings;
 };
@@ -359,6 +357,9 @@
 {
     visitor->trace(m_page);
     InternalSettingsGenerated::trace(visitor);
+#if ENABLE(OILPAN)
+    HeapSupplement<Page>::trace(visitor);
+#endif
 }
 
 }
diff --git a/Source/core/testing/Internals.cpp b/Source/core/testing/Internals.cpp
index 10f83a5..ad01f38 100644
--- a/Source/core/testing/Internals.cpp
+++ b/Source/core/testing/Internals.cpp
@@ -56,7 +56,6 @@
 #include "core/dom/DocumentMarker.h"
 #include "core/dom/DocumentMarkerController.h"
 #include "core/dom/Element.h"
-#include "core/dom/EventHandlerRegistry.h"
 #include "core/dom/ExceptionCode.h"
 #include "core/dom/FullscreenElementStack.h"
 #include "core/dom/NodeRenderStyle.h"
@@ -80,6 +79,7 @@
 #include "core/fetch/ResourceFetcher.h"
 #include "core/frame/DOMPoint.h"
 #include "core/frame/DOMWindow.h"
+#include "core/frame/EventHandlerRegistry.h"
 #include "core/frame/FrameView.h"
 #include "core/frame/LocalFrame.h"
 #include "core/frame/Settings.h"
@@ -581,7 +581,7 @@
     return 0;
 }
 
-PassRefPtr<CSSComputedStyleDeclaration> Internals::computedStyleIncludingVisitedInfo(Node* node, ExceptionState& exceptionState) const
+PassRefPtrWillBeRawPtr<CSSComputedStyleDeclaration> Internals::computedStyleIncludingVisitedInfo(Node* node, ExceptionState& exceptionState) const
 {
     if (!node) {
         exceptionState.throwDOMException(InvalidAccessError, ExceptionMessages::argumentNullOrIncorrectType(1, "Node"));
@@ -1248,7 +1248,9 @@
 
 static unsigned eventHandlerCount(Document& document, EventHandlerRegistry::EventHandlerClass handlerClass)
 {
-    EventHandlerRegistry* registry = EventHandlerRegistry::from(document);
+    if (!document.frameHost())
+        return 0;
+    EventHandlerRegistry* registry = &document.frameHost()->eventHandlerRegistry();
     unsigned count = 0;
     const EventTargetSet* targets = registry->eventHandlerTargets(handlerClass);
     if (targets) {
@@ -2310,22 +2312,22 @@
 
 } // namespace
 
-ScriptPromise Internals::createPromise(ExecutionContext* context)
+ScriptPromise Internals::createPromise(ScriptState* scriptState)
 {
-    return ScriptPromiseResolver::create(context)->promise();
+    return ScriptPromiseResolver::create(scriptState)->promise();
 }
 
-ScriptPromise Internals::createResolvedPromise(ExecutionContext* context, ScriptValue value)
+ScriptPromise Internals::createResolvedPromise(ScriptState* scriptState, ScriptValue value)
 {
-    RefPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::create(context);
+    RefPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::create(scriptState);
     ScriptPromise promise = resolver->promise();
     resolver->resolve(value);
     return promise;
 }
 
-ScriptPromise Internals::createRejectedPromise(ExecutionContext* context, ScriptValue value)
+ScriptPromise Internals::createRejectedPromise(ScriptState* scriptState, ScriptValue value)
 {
-    RefPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::create(context);
+    RefPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::create(scriptState);
     ScriptPromise promise = resolver->promise();
     resolver->reject(value);
     return promise;
@@ -2342,19 +2344,6 @@
     visitor->trace(m_profilers);
 }
 
-void Internals::startSpeechInput(Element* element)
-{
-#if ENABLE(INPUT_SPEECH)
-    HTMLInputElement* input = toHTMLInputElement(element);
-    if (!input->isSpeechEnabled())
-        return;
-
-    InputFieldSpeechButtonElement* speechButton = toInputFieldSpeechButtonElement(input->userAgentShadowRoot()->getElementById(ShadowElementNames::speechButton()));
-    if (speechButton)
-        speechButton->startSpeechInput();
-#endif
-}
-
 void Internals::setValueForUser(Element* element, const String& value)
 {
     toHTMLInputElement(element)->setValueForUser(value);
diff --git a/Source/core/testing/Internals.h b/Source/core/testing/Internals.h
index 74814c1..5288834 100644
--- a/Source/core/testing/Internals.h
+++ b/Source/core/testing/Internals.h
@@ -93,7 +93,7 @@
     bool isSharingStyle(Element*, Element*, ExceptionState&) const;
 
     size_t numberOfScopedHTMLStyleChildren(const Node*, ExceptionState&) const;
-    PassRefPtr<CSSComputedStyleDeclaration> computedStyleIncludingVisitedInfo(Node*, ExceptionState&) const;
+    PassRefPtrWillBeRawPtr<CSSComputedStyleDeclaration> computedStyleIncludingVisitedInfo(Node*, ExceptionState&) const;
 
     ShadowRoot* shadowRoot(Element* host, ExceptionState&);
     ShadowRoot* youngestShadowRoot(Element* host, ExceptionState&);
@@ -310,14 +310,13 @@
 
     void setShouldRevealPassword(Element*, bool, ExceptionState&);
 
-    ScriptPromise createPromise(ExecutionContext*);
-    ScriptPromise createResolvedPromise(ExecutionContext*, ScriptValue);
-    ScriptPromise createRejectedPromise(ExecutionContext*, ScriptValue);
+    ScriptPromise createPromise(ScriptState*);
+    ScriptPromise createResolvedPromise(ScriptState*, ScriptValue);
+    ScriptPromise createRejectedPromise(ScriptState*, ScriptValue);
     ScriptPromise addOneToPromise(ExecutionContext*, ScriptPromise);
 
     void trace(Visitor*);
 
-    void startSpeechInput(Element*);
     void setValueForUser(Element*, const String&);
 
     String textSurroundingNode(Node*, int x, int y, unsigned long maxLength);
diff --git a/Source/core/testing/Internals.idl b/Source/core/testing/Internals.idl
index a98be11..b307c9c 100644
--- a/Source/core/testing/Internals.idl
+++ b/Source/core/testing/Internals.idl
@@ -272,12 +272,11 @@
 
     [RaisesException] void setShouldRevealPassword(Element element, boolean reveal);
 
-    [CallWith=ExecutionContext] Promise createPromise();
-    [CallWith=ExecutionContext] Promise createResolvedPromise(any value);
-    [CallWith=ExecutionContext] Promise createRejectedPromise(any reason);
+    [CallWith=ScriptState] Promise createPromise();
+    [CallWith=ScriptState] Promise createResolvedPromise(any value);
+    [CallWith=ScriptState] Promise createRejectedPromise(any reason);
     [CallWith=ExecutionContext] Promise addOneToPromise(Promise promise);
 
-    void startSpeechInput(Element element);
     void setValueForUser(Element element, DOMString value);
 
     DOMString textSurroundingNode(Node node, long x, long y, unsigned long maxLength);
diff --git a/Source/core/testing/LayerRect.h b/Source/core/testing/LayerRect.h
index 7074c22..f47b7e0 100644
--- a/Source/core/testing/LayerRect.h
+++ b/Source/core/testing/LayerRect.h
@@ -58,6 +58,7 @@
 
     void trace(Visitor* visitor)
     {
+        visitor->trace(m_layerAssociatedNode);
         visitor->trace(m_rect);
     }
 
@@ -71,7 +72,7 @@
     {
     }
 
-    RefPtr<Node> m_layerAssociatedNode;
+    RefPtrWillBeMember<Node> m_layerAssociatedNode;
     String m_layerType;
     int m_associatedNodeOffsetX;
     int m_associatedNodeOffsetY;
diff --git a/Source/core/timing/MemoryInfo.cpp b/Source/core/timing/MemoryInfo.cpp
index 65b2fdc..e6285ee 100644
--- a/Source/core/timing/MemoryInfo.cpp
+++ b/Source/core/timing/MemoryInfo.cpp
@@ -31,6 +31,7 @@
 #include "config.h"
 #include "core/timing/MemoryInfo.h"
 
+#include "RuntimeEnabledFeatures.h"
 #include <limits>
 #include "core/frame/LocalFrame.h"
 #include "core/frame/Settings.h"
@@ -90,7 +91,6 @@
     const int numberOfBuckets = 100;
     DEFINE_STATIC_LOCAL(Vector<size_t>, bucketSizeList, ());
 
-    ASSERT(isMainThread());
     if (bucketSizeList.isEmpty()) {
         bucketSizeList.resize(numberOfBuckets);
 
@@ -130,14 +130,11 @@
     return bucketSizeList[numberOfBuckets - 1];
 }
 
-
-MemoryInfo::MemoryInfo(LocalFrame* frame)
+MemoryInfo::MemoryInfo()
 {
     ScriptWrappable::init(this);
-    if (!frame || !frame->settings())
-        return;
 
-    if (frame->settings()->preciseMemoryInfoEnabled()) {
+    if (RuntimeEnabledFeatures::preciseMemoryInfoEnabled()) {
         ScriptGCEvent::getHeapSize(m_info);
     } else {
         DEFINE_STATIC_LOCAL(HeapSizeCache, heapSizeCache, ());
diff --git a/Source/core/timing/MemoryInfo.h b/Source/core/timing/MemoryInfo.h
index 2c4b37a..32678d5 100644
--- a/Source/core/timing/MemoryInfo.h
+++ b/Source/core/timing/MemoryInfo.h
@@ -39,13 +39,11 @@
 
 namespace WebCore {
 
-class LocalFrame;
-
 class MemoryInfo : public RefCountedWillBeGarbageCollectedFinalized<MemoryInfo>, public ScriptWrappable {
 public:
-    static PassRefPtrWillBeRawPtr<MemoryInfo> create(LocalFrame* frame)
+    static PassRefPtrWillBeRawPtr<MemoryInfo> create()
     {
-        return adoptRefWillBeNoop(new MemoryInfo(frame));
+        return adoptRefWillBeNoop(new MemoryInfo());
     }
 
     size_t totalJSHeapSize() const { return m_info.totalJSHeapSize; }
@@ -55,7 +53,7 @@
     void trace(Visitor*) { }
 
 private:
-    explicit MemoryInfo(LocalFrame*);
+    MemoryInfo();
 
     HeapInfo m_info;
 };
diff --git a/Source/core/timing/Performance.cpp b/Source/core/timing/Performance.cpp
index 20dabe3..e2e0928 100644
--- a/Source/core/timing/Performance.cpp
+++ b/Source/core/timing/Performance.cpp
@@ -72,7 +72,7 @@
 
 PassRefPtrWillBeRawPtr<MemoryInfo> Performance::memory() const
 {
-    return MemoryInfo::create(m_frame);
+    return MemoryInfo::create();
 }
 
 PerformanceNavigation* Performance::navigation() const
diff --git a/Source/core/webcore_dom.target.darwin-arm.mk b/Source/core/webcore_dom.target.darwin-arm.mk
index 8713026..4fac314 100644
--- a/Source/core/webcore_dom.target.darwin-arm.mk
+++ b/Source/core/webcore_dom.target.darwin-arm.mk
@@ -75,7 +75,6 @@
 	third_party/WebKit/Source/core/dom/ElementDataCache.cpp \
 	third_party/WebKit/Source/core/dom/ElementRareData.cpp \
 	third_party/WebKit/Source/core/dom/EmptyNodeList.cpp \
-	third_party/WebKit/Source/core/dom/EventHandlerRegistry.cpp \
 	third_party/WebKit/Source/core/dom/ExecutionContext.cpp \
 	third_party/WebKit/Source/core/dom/FullscreenElementStack.cpp \
 	third_party/WebKit/Source/core/dom/IconURL.cpp \
@@ -223,7 +222,6 @@
 	-pipe \
 	-fPIC \
 	-fno-tree-sra \
-	-fuse-ld=gold \
 	-Wno-psabi \
 	-ffunction-sections \
 	-funwind-tables \
@@ -267,8 +265,9 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DWTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1' \
+	'-DENABLE_WEB_AUDIO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
@@ -281,11 +280,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -323,6 +317,7 @@
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
+	$(LOCAL_PATH)/third_party/openmax_dl \
 	$(LOCAL_PATH)/third_party/angle/include \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
@@ -381,7 +376,6 @@
 	-pipe \
 	-fPIC \
 	-fno-tree-sra \
-	-fuse-ld=gold \
 	-Wno-psabi \
 	-ffunction-sections \
 	-funwind-tables \
@@ -425,8 +419,9 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DWTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1' \
+	'-DENABLE_WEB_AUDIO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
@@ -439,11 +434,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -482,6 +472,7 @@
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
+	$(LOCAL_PATH)/third_party/openmax_dl \
 	$(LOCAL_PATH)/third_party/angle/include \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
diff --git a/Source/core/webcore_dom.target.darwin-arm64.mk b/Source/core/webcore_dom.target.darwin-arm64.mk
index 1c670c8..6ee8e8f 100644
--- a/Source/core/webcore_dom.target.darwin-arm64.mk
+++ b/Source/core/webcore_dom.target.darwin-arm64.mk
@@ -75,7 +75,6 @@
 	third_party/WebKit/Source/core/dom/ElementDataCache.cpp \
 	third_party/WebKit/Source/core/dom/ElementRareData.cpp \
 	third_party/WebKit/Source/core/dom/EmptyNodeList.cpp \
-	third_party/WebKit/Source/core/dom/EventHandlerRegistry.cpp \
 	third_party/WebKit/Source/core/dom/ExecutionContext.cpp \
 	third_party/WebKit/Source/core/dom/FullscreenElementStack.cpp \
 	third_party/WebKit/Source/core/dom/IconURL.cpp \
@@ -263,7 +262,6 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -277,11 +275,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -416,7 +409,6 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -430,11 +422,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
diff --git a/Source/core/webcore_dom.target.darwin-mips.mk b/Source/core/webcore_dom.target.darwin-mips.mk
index d1597ea..864474d 100644
--- a/Source/core/webcore_dom.target.darwin-mips.mk
+++ b/Source/core/webcore_dom.target.darwin-mips.mk
@@ -75,7 +75,6 @@
 	third_party/WebKit/Source/core/dom/ElementDataCache.cpp \
 	third_party/WebKit/Source/core/dom/ElementRareData.cpp \
 	third_party/WebKit/Source/core/dom/EmptyNodeList.cpp \
-	third_party/WebKit/Source/core/dom/EventHandlerRegistry.cpp \
 	third_party/WebKit/Source/core/dom/ExecutionContext.cpp \
 	third_party/WebKit/Source/core/dom/FullscreenElementStack.cpp \
 	third_party/WebKit/Source/core/dom/IconURL.cpp \
@@ -266,7 +265,6 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -280,11 +278,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -423,7 +416,6 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -437,11 +429,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
diff --git a/Source/core/webcore_dom.target.darwin-x86.mk b/Source/core/webcore_dom.target.darwin-x86.mk
index 6dc427c..c7d5465 100644
--- a/Source/core/webcore_dom.target.darwin-x86.mk
+++ b/Source/core/webcore_dom.target.darwin-x86.mk
@@ -75,7 +75,6 @@
 	third_party/WebKit/Source/core/dom/ElementDataCache.cpp \
 	third_party/WebKit/Source/core/dom/ElementRareData.cpp \
 	third_party/WebKit/Source/core/dom/EmptyNodeList.cpp \
-	third_party/WebKit/Source/core/dom/EventHandlerRegistry.cpp \
 	third_party/WebKit/Source/core/dom/ExecutionContext.cpp \
 	third_party/WebKit/Source/core/dom/FullscreenElementStack.cpp \
 	third_party/WebKit/Source/core/dom/IconURL.cpp \
@@ -225,7 +224,6 @@
 	-mfpmath=sse \
 	-mmmx \
 	-m32 \
-	-fuse-ld=gold \
 	-ffunction-sections \
 	-funwind-tables \
 	-g \
@@ -268,8 +266,9 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DWTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1' \
+	'-DENABLE_WEB_AUDIO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
@@ -282,11 +281,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -324,6 +318,7 @@
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
+	$(LOCAL_PATH)/third_party/openmax_dl \
 	$(LOCAL_PATH)/third_party/angle/include \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
@@ -383,7 +378,6 @@
 	-mfpmath=sse \
 	-mmmx \
 	-m32 \
-	-fuse-ld=gold \
 	-ffunction-sections \
 	-funwind-tables \
 	-g \
@@ -426,8 +420,9 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DWTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1' \
+	'-DENABLE_WEB_AUDIO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
@@ -440,11 +435,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -483,6 +473,7 @@
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
+	$(LOCAL_PATH)/third_party/openmax_dl \
 	$(LOCAL_PATH)/third_party/angle/include \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
diff --git a/Source/core/webcore_dom.target.darwin-x86_64.mk b/Source/core/webcore_dom.target.darwin-x86_64.mk
index 013931c..91f5f0a 100644
--- a/Source/core/webcore_dom.target.darwin-x86_64.mk
+++ b/Source/core/webcore_dom.target.darwin-x86_64.mk
@@ -75,7 +75,6 @@
 	third_party/WebKit/Source/core/dom/ElementDataCache.cpp \
 	third_party/WebKit/Source/core/dom/ElementRareData.cpp \
 	third_party/WebKit/Source/core/dom/EmptyNodeList.cpp \
-	third_party/WebKit/Source/core/dom/EventHandlerRegistry.cpp \
 	third_party/WebKit/Source/core/dom/ExecutionContext.cpp \
 	third_party/WebKit/Source/core/dom/FullscreenElementStack.cpp \
 	third_party/WebKit/Source/core/dom/IconURL.cpp \
@@ -225,7 +224,6 @@
 	-Wno-unused-local-typedefs \
 	-m64 \
 	-march=x86-64 \
-	-fuse-ld=gold \
 	-ffunction-sections \
 	-funwind-tables \
 	-g \
@@ -268,8 +266,9 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DWTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1' \
+	'-DENABLE_WEB_AUDIO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
@@ -282,11 +281,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -324,6 +318,7 @@
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
+	$(LOCAL_PATH)/third_party/openmax_dl \
 	$(LOCAL_PATH)/third_party/angle/include \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
@@ -383,7 +378,6 @@
 	-Wno-unused-local-typedefs \
 	-m64 \
 	-march=x86-64 \
-	-fuse-ld=gold \
 	-ffunction-sections \
 	-funwind-tables \
 	-g \
@@ -426,8 +420,9 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DWTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1' \
+	'-DENABLE_WEB_AUDIO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
@@ -440,11 +435,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -483,6 +473,7 @@
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
+	$(LOCAL_PATH)/third_party/openmax_dl \
 	$(LOCAL_PATH)/third_party/angle/include \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
diff --git a/Source/core/webcore_dom.target.linux-arm.mk b/Source/core/webcore_dom.target.linux-arm.mk
index 8713026..4fac314 100644
--- a/Source/core/webcore_dom.target.linux-arm.mk
+++ b/Source/core/webcore_dom.target.linux-arm.mk
@@ -75,7 +75,6 @@
 	third_party/WebKit/Source/core/dom/ElementDataCache.cpp \
 	third_party/WebKit/Source/core/dom/ElementRareData.cpp \
 	third_party/WebKit/Source/core/dom/EmptyNodeList.cpp \
-	third_party/WebKit/Source/core/dom/EventHandlerRegistry.cpp \
 	third_party/WebKit/Source/core/dom/ExecutionContext.cpp \
 	third_party/WebKit/Source/core/dom/FullscreenElementStack.cpp \
 	third_party/WebKit/Source/core/dom/IconURL.cpp \
@@ -223,7 +222,6 @@
 	-pipe \
 	-fPIC \
 	-fno-tree-sra \
-	-fuse-ld=gold \
 	-Wno-psabi \
 	-ffunction-sections \
 	-funwind-tables \
@@ -267,8 +265,9 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DWTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1' \
+	'-DENABLE_WEB_AUDIO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
@@ -281,11 +280,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -323,6 +317,7 @@
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
+	$(LOCAL_PATH)/third_party/openmax_dl \
 	$(LOCAL_PATH)/third_party/angle/include \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
@@ -381,7 +376,6 @@
 	-pipe \
 	-fPIC \
 	-fno-tree-sra \
-	-fuse-ld=gold \
 	-Wno-psabi \
 	-ffunction-sections \
 	-funwind-tables \
@@ -425,8 +419,9 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DWTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1' \
+	'-DENABLE_WEB_AUDIO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
@@ -439,11 +434,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -482,6 +472,7 @@
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
+	$(LOCAL_PATH)/third_party/openmax_dl \
 	$(LOCAL_PATH)/third_party/angle/include \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
diff --git a/Source/core/webcore_dom.target.linux-arm64.mk b/Source/core/webcore_dom.target.linux-arm64.mk
index 1c670c8..6ee8e8f 100644
--- a/Source/core/webcore_dom.target.linux-arm64.mk
+++ b/Source/core/webcore_dom.target.linux-arm64.mk
@@ -75,7 +75,6 @@
 	third_party/WebKit/Source/core/dom/ElementDataCache.cpp \
 	third_party/WebKit/Source/core/dom/ElementRareData.cpp \
 	third_party/WebKit/Source/core/dom/EmptyNodeList.cpp \
-	third_party/WebKit/Source/core/dom/EventHandlerRegistry.cpp \
 	third_party/WebKit/Source/core/dom/ExecutionContext.cpp \
 	third_party/WebKit/Source/core/dom/FullscreenElementStack.cpp \
 	third_party/WebKit/Source/core/dom/IconURL.cpp \
@@ -263,7 +262,6 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -277,11 +275,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -416,7 +409,6 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -430,11 +422,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
diff --git a/Source/core/webcore_dom.target.linux-mips.mk b/Source/core/webcore_dom.target.linux-mips.mk
index d1597ea..864474d 100644
--- a/Source/core/webcore_dom.target.linux-mips.mk
+++ b/Source/core/webcore_dom.target.linux-mips.mk
@@ -75,7 +75,6 @@
 	third_party/WebKit/Source/core/dom/ElementDataCache.cpp \
 	third_party/WebKit/Source/core/dom/ElementRareData.cpp \
 	third_party/WebKit/Source/core/dom/EmptyNodeList.cpp \
-	third_party/WebKit/Source/core/dom/EventHandlerRegistry.cpp \
 	third_party/WebKit/Source/core/dom/ExecutionContext.cpp \
 	third_party/WebKit/Source/core/dom/FullscreenElementStack.cpp \
 	third_party/WebKit/Source/core/dom/IconURL.cpp \
@@ -266,7 +265,6 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -280,11 +278,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -423,7 +416,6 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -437,11 +429,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
diff --git a/Source/core/webcore_dom.target.linux-x86.mk b/Source/core/webcore_dom.target.linux-x86.mk
index 6dc427c..c7d5465 100644
--- a/Source/core/webcore_dom.target.linux-x86.mk
+++ b/Source/core/webcore_dom.target.linux-x86.mk
@@ -75,7 +75,6 @@
 	third_party/WebKit/Source/core/dom/ElementDataCache.cpp \
 	third_party/WebKit/Source/core/dom/ElementRareData.cpp \
 	third_party/WebKit/Source/core/dom/EmptyNodeList.cpp \
-	third_party/WebKit/Source/core/dom/EventHandlerRegistry.cpp \
 	third_party/WebKit/Source/core/dom/ExecutionContext.cpp \
 	third_party/WebKit/Source/core/dom/FullscreenElementStack.cpp \
 	third_party/WebKit/Source/core/dom/IconURL.cpp \
@@ -225,7 +224,6 @@
 	-mfpmath=sse \
 	-mmmx \
 	-m32 \
-	-fuse-ld=gold \
 	-ffunction-sections \
 	-funwind-tables \
 	-g \
@@ -268,8 +266,9 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DWTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1' \
+	'-DENABLE_WEB_AUDIO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
@@ -282,11 +281,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -324,6 +318,7 @@
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
+	$(LOCAL_PATH)/third_party/openmax_dl \
 	$(LOCAL_PATH)/third_party/angle/include \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
@@ -383,7 +378,6 @@
 	-mfpmath=sse \
 	-mmmx \
 	-m32 \
-	-fuse-ld=gold \
 	-ffunction-sections \
 	-funwind-tables \
 	-g \
@@ -426,8 +420,9 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DWTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1' \
+	'-DENABLE_WEB_AUDIO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
@@ -440,11 +435,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -483,6 +473,7 @@
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
+	$(LOCAL_PATH)/third_party/openmax_dl \
 	$(LOCAL_PATH)/third_party/angle/include \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
diff --git a/Source/core/webcore_dom.target.linux-x86_64.mk b/Source/core/webcore_dom.target.linux-x86_64.mk
index 013931c..91f5f0a 100644
--- a/Source/core/webcore_dom.target.linux-x86_64.mk
+++ b/Source/core/webcore_dom.target.linux-x86_64.mk
@@ -75,7 +75,6 @@
 	third_party/WebKit/Source/core/dom/ElementDataCache.cpp \
 	third_party/WebKit/Source/core/dom/ElementRareData.cpp \
 	third_party/WebKit/Source/core/dom/EmptyNodeList.cpp \
-	third_party/WebKit/Source/core/dom/EventHandlerRegistry.cpp \
 	third_party/WebKit/Source/core/dom/ExecutionContext.cpp \
 	third_party/WebKit/Source/core/dom/FullscreenElementStack.cpp \
 	third_party/WebKit/Source/core/dom/IconURL.cpp \
@@ -225,7 +224,6 @@
 	-Wno-unused-local-typedefs \
 	-m64 \
 	-march=x86-64 \
-	-fuse-ld=gold \
 	-ffunction-sections \
 	-funwind-tables \
 	-g \
@@ -268,8 +266,9 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DWTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1' \
+	'-DENABLE_WEB_AUDIO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
@@ -282,11 +281,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -324,6 +318,7 @@
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
+	$(LOCAL_PATH)/third_party/openmax_dl \
 	$(LOCAL_PATH)/third_party/angle/include \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
@@ -383,7 +378,6 @@
 	-Wno-unused-local-typedefs \
 	-m64 \
 	-march=x86-64 \
-	-fuse-ld=gold \
 	-ffunction-sections \
 	-funwind-tables \
 	-g \
@@ -426,8 +420,9 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DWTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1' \
+	'-DENABLE_WEB_AUDIO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
@@ -440,11 +435,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -483,6 +473,7 @@
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
+	$(LOCAL_PATH)/third_party/openmax_dl \
 	$(LOCAL_PATH)/third_party/angle/include \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
diff --git a/Source/core/webcore_generated.target.darwin-arm.mk b/Source/core/webcore_generated.target.darwin-arm.mk
index da4dd12..ac98d68 100644
--- a/Source/core/webcore_generated.target.darwin-arm.mk
+++ b/Source/core/webcore_generated.target.darwin-arm.mk
@@ -71,44 +71,6 @@
 	mkdir -p $(@D); cp $< $@
 $(gyp_intermediate_dir)/V8GeneratedCoreBindings19.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedCoreBindings19.cpp
 	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings01.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings01.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings02.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings02.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings03.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings03.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings04.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings04.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings05.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings05.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings06.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings06.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings07.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings07.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings08.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings08.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings09.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings09.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings10.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings10.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings11.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings11.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings12.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings12.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings13.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings13.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings14.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings14.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings15.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings15.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings16.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings16.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings17.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings17.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings18.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings18.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings19.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings19.cpp
-	mkdir -p $(@D); cp $< $@
 $(gyp_intermediate_dir)/CSSPropertyNames.cpp: $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp
 	mkdir -p $(@D); cp $< $@
 $(gyp_intermediate_dir)/CSSValueKeywords.cpp: $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp
@@ -201,25 +163,6 @@
 	$(gyp_intermediate_dir)/V8GeneratedCoreBindings17.cpp \
 	$(gyp_intermediate_dir)/V8GeneratedCoreBindings18.cpp \
 	$(gyp_intermediate_dir)/V8GeneratedCoreBindings19.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings01.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings02.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings03.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings04.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings05.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings06.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings07.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings08.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings09.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings10.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings11.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings12.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings13.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings14.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings15.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings16.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings17.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings18.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings19.cpp \
 	$(gyp_intermediate_dir)/CSSPropertyNames.cpp \
 	$(gyp_intermediate_dir)/CSSValueKeywords.cpp \
 	$(gyp_intermediate_dir)/Event.cpp \
@@ -338,6 +281,7 @@
 	third_party/WebKit/Source/bindings/v8/custom/V8CSSStyleDeclarationCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8CSSValueCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp \
+	third_party/WebKit/Source/bindings/v8/custom/V8ClientCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8CryptoCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8CustomEventCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8CustomSQLStatementErrorCallback.cpp \
@@ -412,7 +356,6 @@
 	-pipe \
 	-fPIC \
 	-fno-tree-sra \
-	-fuse-ld=gold \
 	-Wno-psabi \
 	-ffunction-sections \
 	-funwind-tables \
@@ -456,8 +399,9 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DWTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1' \
+	'-DENABLE_WEB_AUDIO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
@@ -470,11 +414,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -508,6 +447,7 @@
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(LOCAL_PATH)/third_party/WebKit/Source \
+	$(LOCAL_PATH)/third_party/openmax_dl \
 	$(LOCAL_PATH)/third_party/WebKit/Source/bindings/v8/custom \
 	$(LOCAL_PATH)/third_party/WebKit/Source/core/html \
 	$(LOCAL_PATH)/third_party/WebKit/Source/core/html/shadow \
@@ -575,7 +515,6 @@
 	-pipe \
 	-fPIC \
 	-fno-tree-sra \
-	-fuse-ld=gold \
 	-Wno-psabi \
 	-ffunction-sections \
 	-funwind-tables \
@@ -619,8 +558,9 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DWTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1' \
+	'-DENABLE_WEB_AUDIO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
@@ -633,11 +573,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -672,6 +607,7 @@
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(LOCAL_PATH)/third_party/WebKit/Source \
+	$(LOCAL_PATH)/third_party/openmax_dl \
 	$(LOCAL_PATH)/third_party/WebKit/Source/bindings/v8/custom \
 	$(LOCAL_PATH)/third_party/WebKit/Source/core/html \
 	$(LOCAL_PATH)/third_party/WebKit/Source/core/html/shadow \
diff --git a/Source/core/webcore_generated.target.darwin-arm64.mk b/Source/core/webcore_generated.target.darwin-arm64.mk
index 9fae3db..febc13e 100644
--- a/Source/core/webcore_generated.target.darwin-arm64.mk
+++ b/Source/core/webcore_generated.target.darwin-arm64.mk
@@ -71,44 +71,6 @@
 	mkdir -p $(@D); cp $< $@
 $(gyp_intermediate_dir)/V8GeneratedCoreBindings19.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedCoreBindings19.cpp
 	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings01.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings01.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings02.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings02.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings03.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings03.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings04.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings04.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings05.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings05.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings06.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings06.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings07.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings07.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings08.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings08.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings09.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings09.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings10.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings10.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings11.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings11.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings12.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings12.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings13.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings13.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings14.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings14.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings15.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings15.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings16.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings16.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings17.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings17.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings18.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings18.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings19.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings19.cpp
-	mkdir -p $(@D); cp $< $@
 $(gyp_intermediate_dir)/CSSPropertyNames.cpp: $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp
 	mkdir -p $(@D); cp $< $@
 $(gyp_intermediate_dir)/CSSValueKeywords.cpp: $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp
@@ -201,25 +163,6 @@
 	$(gyp_intermediate_dir)/V8GeneratedCoreBindings17.cpp \
 	$(gyp_intermediate_dir)/V8GeneratedCoreBindings18.cpp \
 	$(gyp_intermediate_dir)/V8GeneratedCoreBindings19.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings01.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings02.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings03.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings04.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings05.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings06.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings07.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings08.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings09.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings10.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings11.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings12.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings13.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings14.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings15.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings16.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings17.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings18.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings19.cpp \
 	$(gyp_intermediate_dir)/CSSPropertyNames.cpp \
 	$(gyp_intermediate_dir)/CSSValueKeywords.cpp \
 	$(gyp_intermediate_dir)/Event.cpp \
@@ -338,6 +281,7 @@
 	third_party/WebKit/Source/bindings/v8/custom/V8CSSStyleDeclarationCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8CSSValueCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp \
+	third_party/WebKit/Source/bindings/v8/custom/V8ClientCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8CryptoCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8CustomEventCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8CustomSQLStatementErrorCallback.cpp \
@@ -452,7 +396,6 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -466,11 +409,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -610,7 +548,6 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -624,11 +561,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
diff --git a/Source/core/webcore_generated.target.darwin-mips.mk b/Source/core/webcore_generated.target.darwin-mips.mk
index c5ae835..1547579 100644
--- a/Source/core/webcore_generated.target.darwin-mips.mk
+++ b/Source/core/webcore_generated.target.darwin-mips.mk
@@ -71,44 +71,6 @@
 	mkdir -p $(@D); cp $< $@
 $(gyp_intermediate_dir)/V8GeneratedCoreBindings19.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedCoreBindings19.cpp
 	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings01.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings01.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings02.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings02.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings03.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings03.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings04.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings04.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings05.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings05.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings06.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings06.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings07.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings07.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings08.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings08.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings09.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings09.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings10.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings10.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings11.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings11.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings12.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings12.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings13.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings13.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings14.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings14.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings15.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings15.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings16.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings16.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings17.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings17.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings18.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings18.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings19.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings19.cpp
-	mkdir -p $(@D); cp $< $@
 $(gyp_intermediate_dir)/CSSPropertyNames.cpp: $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp
 	mkdir -p $(@D); cp $< $@
 $(gyp_intermediate_dir)/CSSValueKeywords.cpp: $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp
@@ -201,25 +163,6 @@
 	$(gyp_intermediate_dir)/V8GeneratedCoreBindings17.cpp \
 	$(gyp_intermediate_dir)/V8GeneratedCoreBindings18.cpp \
 	$(gyp_intermediate_dir)/V8GeneratedCoreBindings19.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings01.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings02.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings03.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings04.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings05.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings06.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings07.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings08.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings09.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings10.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings11.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings12.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings13.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings14.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings15.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings16.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings17.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings18.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings19.cpp \
 	$(gyp_intermediate_dir)/CSSPropertyNames.cpp \
 	$(gyp_intermediate_dir)/CSSValueKeywords.cpp \
 	$(gyp_intermediate_dir)/Event.cpp \
@@ -338,6 +281,7 @@
 	third_party/WebKit/Source/bindings/v8/custom/V8CSSStyleDeclarationCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8CSSValueCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp \
+	third_party/WebKit/Source/bindings/v8/custom/V8ClientCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8CryptoCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8CustomEventCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8CustomSQLStatementErrorCallback.cpp \
@@ -455,7 +399,6 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -469,11 +412,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -617,7 +555,6 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -631,11 +568,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
diff --git a/Source/core/webcore_generated.target.darwin-x86.mk b/Source/core/webcore_generated.target.darwin-x86.mk
index 192ade3..7977631 100644
--- a/Source/core/webcore_generated.target.darwin-x86.mk
+++ b/Source/core/webcore_generated.target.darwin-x86.mk
@@ -71,44 +71,6 @@
 	mkdir -p $(@D); cp $< $@
 $(gyp_intermediate_dir)/V8GeneratedCoreBindings19.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedCoreBindings19.cpp
 	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings01.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings01.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings02.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings02.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings03.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings03.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings04.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings04.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings05.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings05.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings06.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings06.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings07.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings07.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings08.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings08.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings09.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings09.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings10.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings10.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings11.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings11.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings12.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings12.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings13.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings13.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings14.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings14.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings15.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings15.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings16.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings16.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings17.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings17.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings18.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings18.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings19.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings19.cpp
-	mkdir -p $(@D); cp $< $@
 $(gyp_intermediate_dir)/CSSPropertyNames.cpp: $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp
 	mkdir -p $(@D); cp $< $@
 $(gyp_intermediate_dir)/CSSValueKeywords.cpp: $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp
@@ -201,25 +163,6 @@
 	$(gyp_intermediate_dir)/V8GeneratedCoreBindings17.cpp \
 	$(gyp_intermediate_dir)/V8GeneratedCoreBindings18.cpp \
 	$(gyp_intermediate_dir)/V8GeneratedCoreBindings19.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings01.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings02.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings03.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings04.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings05.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings06.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings07.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings08.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings09.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings10.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings11.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings12.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings13.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings14.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings15.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings16.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings17.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings18.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings19.cpp \
 	$(gyp_intermediate_dir)/CSSPropertyNames.cpp \
 	$(gyp_intermediate_dir)/CSSValueKeywords.cpp \
 	$(gyp_intermediate_dir)/Event.cpp \
@@ -338,6 +281,7 @@
 	third_party/WebKit/Source/bindings/v8/custom/V8CSSStyleDeclarationCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8CSSValueCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp \
+	third_party/WebKit/Source/bindings/v8/custom/V8ClientCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8CryptoCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8CustomEventCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8CustomSQLStatementErrorCallback.cpp \
@@ -414,7 +358,6 @@
 	-mfpmath=sse \
 	-mmmx \
 	-m32 \
-	-fuse-ld=gold \
 	-ffunction-sections \
 	-funwind-tables \
 	-g \
@@ -457,8 +400,9 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DWTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1' \
+	'-DENABLE_WEB_AUDIO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
@@ -471,11 +415,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -509,6 +448,7 @@
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(LOCAL_PATH)/third_party/WebKit/Source \
+	$(LOCAL_PATH)/third_party/openmax_dl \
 	$(LOCAL_PATH)/third_party/WebKit/Source/bindings/v8/custom \
 	$(LOCAL_PATH)/third_party/WebKit/Source/core/html \
 	$(LOCAL_PATH)/third_party/WebKit/Source/core/html/shadow \
@@ -577,7 +517,6 @@
 	-mfpmath=sse \
 	-mmmx \
 	-m32 \
-	-fuse-ld=gold \
 	-ffunction-sections \
 	-funwind-tables \
 	-g \
@@ -620,8 +559,9 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DWTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1' \
+	'-DENABLE_WEB_AUDIO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
@@ -634,11 +574,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -673,6 +608,7 @@
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(LOCAL_PATH)/third_party/WebKit/Source \
+	$(LOCAL_PATH)/third_party/openmax_dl \
 	$(LOCAL_PATH)/third_party/WebKit/Source/bindings/v8/custom \
 	$(LOCAL_PATH)/third_party/WebKit/Source/core/html \
 	$(LOCAL_PATH)/third_party/WebKit/Source/core/html/shadow \
diff --git a/Source/core/webcore_generated.target.darwin-x86_64.mk b/Source/core/webcore_generated.target.darwin-x86_64.mk
index 2b498a2..7a02a02 100644
--- a/Source/core/webcore_generated.target.darwin-x86_64.mk
+++ b/Source/core/webcore_generated.target.darwin-x86_64.mk
@@ -71,44 +71,6 @@
 	mkdir -p $(@D); cp $< $@
 $(gyp_intermediate_dir)/V8GeneratedCoreBindings19.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedCoreBindings19.cpp
 	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings01.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings01.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings02.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings02.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings03.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings03.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings04.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings04.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings05.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings05.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings06.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings06.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings07.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings07.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings08.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings08.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings09.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings09.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings10.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings10.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings11.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings11.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings12.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings12.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings13.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings13.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings14.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings14.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings15.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings15.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings16.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings16.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings17.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings17.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings18.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings18.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings19.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings19.cpp
-	mkdir -p $(@D); cp $< $@
 $(gyp_intermediate_dir)/CSSPropertyNames.cpp: $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp
 	mkdir -p $(@D); cp $< $@
 $(gyp_intermediate_dir)/CSSValueKeywords.cpp: $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp
@@ -201,25 +163,6 @@
 	$(gyp_intermediate_dir)/V8GeneratedCoreBindings17.cpp \
 	$(gyp_intermediate_dir)/V8GeneratedCoreBindings18.cpp \
 	$(gyp_intermediate_dir)/V8GeneratedCoreBindings19.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings01.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings02.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings03.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings04.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings05.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings06.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings07.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings08.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings09.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings10.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings11.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings12.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings13.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings14.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings15.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings16.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings17.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings18.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings19.cpp \
 	$(gyp_intermediate_dir)/CSSPropertyNames.cpp \
 	$(gyp_intermediate_dir)/CSSValueKeywords.cpp \
 	$(gyp_intermediate_dir)/Event.cpp \
@@ -338,6 +281,7 @@
 	third_party/WebKit/Source/bindings/v8/custom/V8CSSStyleDeclarationCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8CSSValueCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp \
+	third_party/WebKit/Source/bindings/v8/custom/V8ClientCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8CryptoCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8CustomEventCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8CustomSQLStatementErrorCallback.cpp \
@@ -414,7 +358,6 @@
 	-Wno-unused-local-typedefs \
 	-m64 \
 	-march=x86-64 \
-	-fuse-ld=gold \
 	-ffunction-sections \
 	-funwind-tables \
 	-g \
@@ -457,8 +400,9 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DWTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1' \
+	'-DENABLE_WEB_AUDIO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
@@ -471,11 +415,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -509,6 +448,7 @@
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(LOCAL_PATH)/third_party/WebKit/Source \
+	$(LOCAL_PATH)/third_party/openmax_dl \
 	$(LOCAL_PATH)/third_party/WebKit/Source/bindings/v8/custom \
 	$(LOCAL_PATH)/third_party/WebKit/Source/core/html \
 	$(LOCAL_PATH)/third_party/WebKit/Source/core/html/shadow \
@@ -577,7 +517,6 @@
 	-Wno-unused-local-typedefs \
 	-m64 \
 	-march=x86-64 \
-	-fuse-ld=gold \
 	-ffunction-sections \
 	-funwind-tables \
 	-g \
@@ -620,8 +559,9 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DWTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1' \
+	'-DENABLE_WEB_AUDIO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
@@ -634,11 +574,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -673,6 +608,7 @@
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(LOCAL_PATH)/third_party/WebKit/Source \
+	$(LOCAL_PATH)/third_party/openmax_dl \
 	$(LOCAL_PATH)/third_party/WebKit/Source/bindings/v8/custom \
 	$(LOCAL_PATH)/third_party/WebKit/Source/core/html \
 	$(LOCAL_PATH)/third_party/WebKit/Source/core/html/shadow \
diff --git a/Source/core/webcore_generated.target.linux-arm.mk b/Source/core/webcore_generated.target.linux-arm.mk
index da4dd12..ac98d68 100644
--- a/Source/core/webcore_generated.target.linux-arm.mk
+++ b/Source/core/webcore_generated.target.linux-arm.mk
@@ -71,44 +71,6 @@
 	mkdir -p $(@D); cp $< $@
 $(gyp_intermediate_dir)/V8GeneratedCoreBindings19.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedCoreBindings19.cpp
 	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings01.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings01.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings02.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings02.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings03.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings03.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings04.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings04.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings05.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings05.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings06.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings06.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings07.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings07.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings08.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings08.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings09.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings09.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings10.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings10.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings11.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings11.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings12.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings12.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings13.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings13.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings14.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings14.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings15.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings15.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings16.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings16.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings17.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings17.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings18.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings18.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings19.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings19.cpp
-	mkdir -p $(@D); cp $< $@
 $(gyp_intermediate_dir)/CSSPropertyNames.cpp: $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp
 	mkdir -p $(@D); cp $< $@
 $(gyp_intermediate_dir)/CSSValueKeywords.cpp: $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp
@@ -201,25 +163,6 @@
 	$(gyp_intermediate_dir)/V8GeneratedCoreBindings17.cpp \
 	$(gyp_intermediate_dir)/V8GeneratedCoreBindings18.cpp \
 	$(gyp_intermediate_dir)/V8GeneratedCoreBindings19.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings01.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings02.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings03.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings04.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings05.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings06.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings07.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings08.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings09.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings10.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings11.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings12.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings13.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings14.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings15.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings16.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings17.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings18.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings19.cpp \
 	$(gyp_intermediate_dir)/CSSPropertyNames.cpp \
 	$(gyp_intermediate_dir)/CSSValueKeywords.cpp \
 	$(gyp_intermediate_dir)/Event.cpp \
@@ -338,6 +281,7 @@
 	third_party/WebKit/Source/bindings/v8/custom/V8CSSStyleDeclarationCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8CSSValueCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp \
+	third_party/WebKit/Source/bindings/v8/custom/V8ClientCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8CryptoCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8CustomEventCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8CustomSQLStatementErrorCallback.cpp \
@@ -412,7 +356,6 @@
 	-pipe \
 	-fPIC \
 	-fno-tree-sra \
-	-fuse-ld=gold \
 	-Wno-psabi \
 	-ffunction-sections \
 	-funwind-tables \
@@ -456,8 +399,9 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DWTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1' \
+	'-DENABLE_WEB_AUDIO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
@@ -470,11 +414,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -508,6 +447,7 @@
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(LOCAL_PATH)/third_party/WebKit/Source \
+	$(LOCAL_PATH)/third_party/openmax_dl \
 	$(LOCAL_PATH)/third_party/WebKit/Source/bindings/v8/custom \
 	$(LOCAL_PATH)/third_party/WebKit/Source/core/html \
 	$(LOCAL_PATH)/third_party/WebKit/Source/core/html/shadow \
@@ -575,7 +515,6 @@
 	-pipe \
 	-fPIC \
 	-fno-tree-sra \
-	-fuse-ld=gold \
 	-Wno-psabi \
 	-ffunction-sections \
 	-funwind-tables \
@@ -619,8 +558,9 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DWTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1' \
+	'-DENABLE_WEB_AUDIO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
@@ -633,11 +573,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -672,6 +607,7 @@
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(LOCAL_PATH)/third_party/WebKit/Source \
+	$(LOCAL_PATH)/third_party/openmax_dl \
 	$(LOCAL_PATH)/third_party/WebKit/Source/bindings/v8/custom \
 	$(LOCAL_PATH)/third_party/WebKit/Source/core/html \
 	$(LOCAL_PATH)/third_party/WebKit/Source/core/html/shadow \
diff --git a/Source/core/webcore_generated.target.linux-arm64.mk b/Source/core/webcore_generated.target.linux-arm64.mk
index 9fae3db..febc13e 100644
--- a/Source/core/webcore_generated.target.linux-arm64.mk
+++ b/Source/core/webcore_generated.target.linux-arm64.mk
@@ -71,44 +71,6 @@
 	mkdir -p $(@D); cp $< $@
 $(gyp_intermediate_dir)/V8GeneratedCoreBindings19.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedCoreBindings19.cpp
 	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings01.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings01.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings02.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings02.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings03.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings03.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings04.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings04.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings05.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings05.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings06.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings06.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings07.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings07.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings08.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings08.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings09.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings09.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings10.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings10.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings11.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings11.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings12.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings12.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings13.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings13.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings14.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings14.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings15.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings15.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings16.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings16.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings17.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings17.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings18.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings18.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings19.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings19.cpp
-	mkdir -p $(@D); cp $< $@
 $(gyp_intermediate_dir)/CSSPropertyNames.cpp: $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp
 	mkdir -p $(@D); cp $< $@
 $(gyp_intermediate_dir)/CSSValueKeywords.cpp: $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp
@@ -201,25 +163,6 @@
 	$(gyp_intermediate_dir)/V8GeneratedCoreBindings17.cpp \
 	$(gyp_intermediate_dir)/V8GeneratedCoreBindings18.cpp \
 	$(gyp_intermediate_dir)/V8GeneratedCoreBindings19.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings01.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings02.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings03.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings04.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings05.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings06.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings07.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings08.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings09.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings10.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings11.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings12.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings13.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings14.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings15.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings16.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings17.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings18.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings19.cpp \
 	$(gyp_intermediate_dir)/CSSPropertyNames.cpp \
 	$(gyp_intermediate_dir)/CSSValueKeywords.cpp \
 	$(gyp_intermediate_dir)/Event.cpp \
@@ -338,6 +281,7 @@
 	third_party/WebKit/Source/bindings/v8/custom/V8CSSStyleDeclarationCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8CSSValueCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp \
+	third_party/WebKit/Source/bindings/v8/custom/V8ClientCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8CryptoCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8CustomEventCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8CustomSQLStatementErrorCallback.cpp \
@@ -452,7 +396,6 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -466,11 +409,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -610,7 +548,6 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -624,11 +561,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
diff --git a/Source/core/webcore_generated.target.linux-mips.mk b/Source/core/webcore_generated.target.linux-mips.mk
index c5ae835..1547579 100644
--- a/Source/core/webcore_generated.target.linux-mips.mk
+++ b/Source/core/webcore_generated.target.linux-mips.mk
@@ -71,44 +71,6 @@
 	mkdir -p $(@D); cp $< $@
 $(gyp_intermediate_dir)/V8GeneratedCoreBindings19.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedCoreBindings19.cpp
 	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings01.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings01.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings02.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings02.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings03.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings03.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings04.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings04.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings05.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings05.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings06.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings06.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings07.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings07.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings08.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings08.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings09.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings09.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings10.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings10.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings11.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings11.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings12.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings12.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings13.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings13.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings14.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings14.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings15.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings15.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings16.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings16.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings17.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings17.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings18.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings18.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings19.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings19.cpp
-	mkdir -p $(@D); cp $< $@
 $(gyp_intermediate_dir)/CSSPropertyNames.cpp: $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp
 	mkdir -p $(@D); cp $< $@
 $(gyp_intermediate_dir)/CSSValueKeywords.cpp: $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp
@@ -201,25 +163,6 @@
 	$(gyp_intermediate_dir)/V8GeneratedCoreBindings17.cpp \
 	$(gyp_intermediate_dir)/V8GeneratedCoreBindings18.cpp \
 	$(gyp_intermediate_dir)/V8GeneratedCoreBindings19.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings01.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings02.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings03.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings04.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings05.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings06.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings07.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings08.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings09.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings10.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings11.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings12.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings13.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings14.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings15.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings16.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings17.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings18.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings19.cpp \
 	$(gyp_intermediate_dir)/CSSPropertyNames.cpp \
 	$(gyp_intermediate_dir)/CSSValueKeywords.cpp \
 	$(gyp_intermediate_dir)/Event.cpp \
@@ -338,6 +281,7 @@
 	third_party/WebKit/Source/bindings/v8/custom/V8CSSStyleDeclarationCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8CSSValueCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp \
+	third_party/WebKit/Source/bindings/v8/custom/V8ClientCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8CryptoCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8CustomEventCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8CustomSQLStatementErrorCallback.cpp \
@@ -455,7 +399,6 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -469,11 +412,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -617,7 +555,6 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -631,11 +568,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
diff --git a/Source/core/webcore_generated.target.linux-x86.mk b/Source/core/webcore_generated.target.linux-x86.mk
index 192ade3..7977631 100644
--- a/Source/core/webcore_generated.target.linux-x86.mk
+++ b/Source/core/webcore_generated.target.linux-x86.mk
@@ -71,44 +71,6 @@
 	mkdir -p $(@D); cp $< $@
 $(gyp_intermediate_dir)/V8GeneratedCoreBindings19.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedCoreBindings19.cpp
 	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings01.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings01.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings02.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings02.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings03.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings03.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings04.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings04.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings05.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings05.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings06.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings06.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings07.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings07.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings08.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings08.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings09.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings09.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings10.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings10.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings11.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings11.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings12.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings12.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings13.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings13.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings14.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings14.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings15.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings15.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings16.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings16.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings17.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings17.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings18.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings18.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings19.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings19.cpp
-	mkdir -p $(@D); cp $< $@
 $(gyp_intermediate_dir)/CSSPropertyNames.cpp: $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp
 	mkdir -p $(@D); cp $< $@
 $(gyp_intermediate_dir)/CSSValueKeywords.cpp: $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp
@@ -201,25 +163,6 @@
 	$(gyp_intermediate_dir)/V8GeneratedCoreBindings17.cpp \
 	$(gyp_intermediate_dir)/V8GeneratedCoreBindings18.cpp \
 	$(gyp_intermediate_dir)/V8GeneratedCoreBindings19.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings01.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings02.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings03.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings04.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings05.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings06.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings07.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings08.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings09.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings10.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings11.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings12.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings13.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings14.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings15.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings16.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings17.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings18.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings19.cpp \
 	$(gyp_intermediate_dir)/CSSPropertyNames.cpp \
 	$(gyp_intermediate_dir)/CSSValueKeywords.cpp \
 	$(gyp_intermediate_dir)/Event.cpp \
@@ -338,6 +281,7 @@
 	third_party/WebKit/Source/bindings/v8/custom/V8CSSStyleDeclarationCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8CSSValueCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp \
+	third_party/WebKit/Source/bindings/v8/custom/V8ClientCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8CryptoCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8CustomEventCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8CustomSQLStatementErrorCallback.cpp \
@@ -414,7 +358,6 @@
 	-mfpmath=sse \
 	-mmmx \
 	-m32 \
-	-fuse-ld=gold \
 	-ffunction-sections \
 	-funwind-tables \
 	-g \
@@ -457,8 +400,9 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DWTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1' \
+	'-DENABLE_WEB_AUDIO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
@@ -471,11 +415,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -509,6 +448,7 @@
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(LOCAL_PATH)/third_party/WebKit/Source \
+	$(LOCAL_PATH)/third_party/openmax_dl \
 	$(LOCAL_PATH)/third_party/WebKit/Source/bindings/v8/custom \
 	$(LOCAL_PATH)/third_party/WebKit/Source/core/html \
 	$(LOCAL_PATH)/third_party/WebKit/Source/core/html/shadow \
@@ -577,7 +517,6 @@
 	-mfpmath=sse \
 	-mmmx \
 	-m32 \
-	-fuse-ld=gold \
 	-ffunction-sections \
 	-funwind-tables \
 	-g \
@@ -620,8 +559,9 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DWTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1' \
+	'-DENABLE_WEB_AUDIO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
@@ -634,11 +574,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -673,6 +608,7 @@
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(LOCAL_PATH)/third_party/WebKit/Source \
+	$(LOCAL_PATH)/third_party/openmax_dl \
 	$(LOCAL_PATH)/third_party/WebKit/Source/bindings/v8/custom \
 	$(LOCAL_PATH)/third_party/WebKit/Source/core/html \
 	$(LOCAL_PATH)/third_party/WebKit/Source/core/html/shadow \
diff --git a/Source/core/webcore_generated.target.linux-x86_64.mk b/Source/core/webcore_generated.target.linux-x86_64.mk
index 2b498a2..7a02a02 100644
--- a/Source/core/webcore_generated.target.linux-x86_64.mk
+++ b/Source/core/webcore_generated.target.linux-x86_64.mk
@@ -71,44 +71,6 @@
 	mkdir -p $(@D); cp $< $@
 $(gyp_intermediate_dir)/V8GeneratedCoreBindings19.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedCoreBindings19.cpp
 	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings01.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings01.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings02.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings02.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings03.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings03.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings04.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings04.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings05.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings05.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings06.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings06.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings07.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings07.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings08.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings08.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings09.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings09.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings10.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings10.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings11.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings11.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings12.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings12.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings13.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings13.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings14.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings14.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings15.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings15.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings16.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings16.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings17.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings17.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings18.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings18.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/V8GeneratedModulesBindings19.cpp: $(gyp_shared_intermediate_dir)/blink/bindings/V8GeneratedModulesBindings19.cpp
-	mkdir -p $(@D); cp $< $@
 $(gyp_intermediate_dir)/CSSPropertyNames.cpp: $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp
 	mkdir -p $(@D); cp $< $@
 $(gyp_intermediate_dir)/CSSValueKeywords.cpp: $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp
@@ -201,25 +163,6 @@
 	$(gyp_intermediate_dir)/V8GeneratedCoreBindings17.cpp \
 	$(gyp_intermediate_dir)/V8GeneratedCoreBindings18.cpp \
 	$(gyp_intermediate_dir)/V8GeneratedCoreBindings19.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings01.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings02.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings03.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings04.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings05.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings06.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings07.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings08.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings09.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings10.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings11.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings12.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings13.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings14.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings15.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings16.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings17.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings18.cpp \
-	$(gyp_intermediate_dir)/V8GeneratedModulesBindings19.cpp \
 	$(gyp_intermediate_dir)/CSSPropertyNames.cpp \
 	$(gyp_intermediate_dir)/CSSValueKeywords.cpp \
 	$(gyp_intermediate_dir)/Event.cpp \
@@ -338,6 +281,7 @@
 	third_party/WebKit/Source/bindings/v8/custom/V8CSSStyleDeclarationCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8CSSValueCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp \
+	third_party/WebKit/Source/bindings/v8/custom/V8ClientCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8CryptoCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8CustomEventCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8CustomSQLStatementErrorCallback.cpp \
@@ -414,7 +358,6 @@
 	-Wno-unused-local-typedefs \
 	-m64 \
 	-march=x86-64 \
-	-fuse-ld=gold \
 	-ffunction-sections \
 	-funwind-tables \
 	-g \
@@ -457,8 +400,9 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DWTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1' \
+	'-DENABLE_WEB_AUDIO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
@@ -471,11 +415,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -509,6 +448,7 @@
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(LOCAL_PATH)/third_party/WebKit/Source \
+	$(LOCAL_PATH)/third_party/openmax_dl \
 	$(LOCAL_PATH)/third_party/WebKit/Source/bindings/v8/custom \
 	$(LOCAL_PATH)/third_party/WebKit/Source/core/html \
 	$(LOCAL_PATH)/third_party/WebKit/Source/core/html/shadow \
@@ -577,7 +517,6 @@
 	-Wno-unused-local-typedefs \
 	-m64 \
 	-march=x86-64 \
-	-fuse-ld=gold \
 	-ffunction-sections \
 	-funwind-tables \
 	-g \
@@ -620,8 +559,9 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DWTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1' \
+	'-DENABLE_WEB_AUDIO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
@@ -634,11 +574,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -673,6 +608,7 @@
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(LOCAL_PATH)/third_party/WebKit/Source \
+	$(LOCAL_PATH)/third_party/openmax_dl \
 	$(LOCAL_PATH)/third_party/WebKit/Source/bindings/v8/custom \
 	$(LOCAL_PATH)/third_party/WebKit/Source/core/html \
 	$(LOCAL_PATH)/third_party/WebKit/Source/core/html/shadow \
diff --git a/Source/core/webcore_html.target.darwin-arm.mk b/Source/core/webcore_html.target.darwin-arm.mk
index ac6d08b..9daf6d3 100644
--- a/Source/core/webcore_html.target.darwin-arm.mk
+++ b/Source/core/webcore_html.target.darwin-arm.mk
@@ -92,6 +92,7 @@
 	third_party/WebKit/Source/core/html/HTMLOutputElement.cpp \
 	third_party/WebKit/Source/core/html/HTMLParagraphElement.cpp \
 	third_party/WebKit/Source/core/html/HTMLParamElement.cpp \
+	third_party/WebKit/Source/core/html/HTMLPictureElement.cpp \
 	third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp \
 	third_party/WebKit/Source/core/html/HTMLPreElement.cpp \
 	third_party/WebKit/Source/core/html/HTMLProgressElement.cpp \
@@ -126,6 +127,7 @@
 	third_party/WebKit/Source/core/html/ImageDocument.cpp \
 	third_party/WebKit/Source/core/html/LabelableElement.cpp \
 	third_party/WebKit/Source/core/html/LabelsNodeList.cpp \
+	third_party/WebKit/Source/core/html/LinkManifest.cpp \
 	third_party/WebKit/Source/core/html/LinkRelAttribute.cpp \
 	third_party/WebKit/Source/core/html/LinkResource.cpp \
 	third_party/WebKit/Source/core/html/MediaController.cpp \
@@ -309,7 +311,6 @@
 	-pipe \
 	-fPIC \
 	-fno-tree-sra \
-	-fuse-ld=gold \
 	-Wno-psabi \
 	-ffunction-sections \
 	-funwind-tables \
@@ -353,8 +354,9 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DWTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1' \
+	'-DENABLE_WEB_AUDIO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
@@ -367,11 +369,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -409,6 +406,7 @@
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
+	$(LOCAL_PATH)/third_party/openmax_dl \
 	$(LOCAL_PATH)/third_party/angle/include \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
@@ -467,7 +465,6 @@
 	-pipe \
 	-fPIC \
 	-fno-tree-sra \
-	-fuse-ld=gold \
 	-Wno-psabi \
 	-ffunction-sections \
 	-funwind-tables \
@@ -511,8 +508,9 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DWTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1' \
+	'-DENABLE_WEB_AUDIO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
@@ -525,11 +523,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -568,6 +561,7 @@
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
+	$(LOCAL_PATH)/third_party/openmax_dl \
 	$(LOCAL_PATH)/third_party/angle/include \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
diff --git a/Source/core/webcore_html.target.darwin-arm64.mk b/Source/core/webcore_html.target.darwin-arm64.mk
index 09b680f..90a466e 100644
--- a/Source/core/webcore_html.target.darwin-arm64.mk
+++ b/Source/core/webcore_html.target.darwin-arm64.mk
@@ -92,6 +92,7 @@
 	third_party/WebKit/Source/core/html/HTMLOutputElement.cpp \
 	third_party/WebKit/Source/core/html/HTMLParagraphElement.cpp \
 	third_party/WebKit/Source/core/html/HTMLParamElement.cpp \
+	third_party/WebKit/Source/core/html/HTMLPictureElement.cpp \
 	third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp \
 	third_party/WebKit/Source/core/html/HTMLPreElement.cpp \
 	third_party/WebKit/Source/core/html/HTMLProgressElement.cpp \
@@ -126,6 +127,7 @@
 	third_party/WebKit/Source/core/html/ImageDocument.cpp \
 	third_party/WebKit/Source/core/html/LabelableElement.cpp \
 	third_party/WebKit/Source/core/html/LabelsNodeList.cpp \
+	third_party/WebKit/Source/core/html/LinkManifest.cpp \
 	third_party/WebKit/Source/core/html/LinkRelAttribute.cpp \
 	third_party/WebKit/Source/core/html/LinkResource.cpp \
 	third_party/WebKit/Source/core/html/MediaController.cpp \
@@ -349,7 +351,6 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -363,11 +364,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -502,7 +498,6 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -516,11 +511,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
diff --git a/Source/core/webcore_html.target.darwin-mips.mk b/Source/core/webcore_html.target.darwin-mips.mk
index 1d03b4a..ed2c2e3 100644
--- a/Source/core/webcore_html.target.darwin-mips.mk
+++ b/Source/core/webcore_html.target.darwin-mips.mk
@@ -92,6 +92,7 @@
 	third_party/WebKit/Source/core/html/HTMLOutputElement.cpp \
 	third_party/WebKit/Source/core/html/HTMLParagraphElement.cpp \
 	third_party/WebKit/Source/core/html/HTMLParamElement.cpp \
+	third_party/WebKit/Source/core/html/HTMLPictureElement.cpp \
 	third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp \
 	third_party/WebKit/Source/core/html/HTMLPreElement.cpp \
 	third_party/WebKit/Source/core/html/HTMLProgressElement.cpp \
@@ -126,6 +127,7 @@
 	third_party/WebKit/Source/core/html/ImageDocument.cpp \
 	third_party/WebKit/Source/core/html/LabelableElement.cpp \
 	third_party/WebKit/Source/core/html/LabelsNodeList.cpp \
+	third_party/WebKit/Source/core/html/LinkManifest.cpp \
 	third_party/WebKit/Source/core/html/LinkRelAttribute.cpp \
 	third_party/WebKit/Source/core/html/LinkResource.cpp \
 	third_party/WebKit/Source/core/html/MediaController.cpp \
@@ -352,7 +354,6 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -366,11 +367,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -509,7 +505,6 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -523,11 +518,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
diff --git a/Source/core/webcore_html.target.darwin-x86.mk b/Source/core/webcore_html.target.darwin-x86.mk
index d125e6d..1686a11 100644
--- a/Source/core/webcore_html.target.darwin-x86.mk
+++ b/Source/core/webcore_html.target.darwin-x86.mk
@@ -92,6 +92,7 @@
 	third_party/WebKit/Source/core/html/HTMLOutputElement.cpp \
 	third_party/WebKit/Source/core/html/HTMLParagraphElement.cpp \
 	third_party/WebKit/Source/core/html/HTMLParamElement.cpp \
+	third_party/WebKit/Source/core/html/HTMLPictureElement.cpp \
 	third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp \
 	third_party/WebKit/Source/core/html/HTMLPreElement.cpp \
 	third_party/WebKit/Source/core/html/HTMLProgressElement.cpp \
@@ -126,6 +127,7 @@
 	third_party/WebKit/Source/core/html/ImageDocument.cpp \
 	third_party/WebKit/Source/core/html/LabelableElement.cpp \
 	third_party/WebKit/Source/core/html/LabelsNodeList.cpp \
+	third_party/WebKit/Source/core/html/LinkManifest.cpp \
 	third_party/WebKit/Source/core/html/LinkRelAttribute.cpp \
 	third_party/WebKit/Source/core/html/LinkResource.cpp \
 	third_party/WebKit/Source/core/html/MediaController.cpp \
@@ -311,7 +313,6 @@
 	-mfpmath=sse \
 	-mmmx \
 	-m32 \
-	-fuse-ld=gold \
 	-ffunction-sections \
 	-funwind-tables \
 	-g \
@@ -354,8 +355,9 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DWTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1' \
+	'-DENABLE_WEB_AUDIO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
@@ -368,11 +370,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -410,6 +407,7 @@
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
+	$(LOCAL_PATH)/third_party/openmax_dl \
 	$(LOCAL_PATH)/third_party/angle/include \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
@@ -469,7 +467,6 @@
 	-mfpmath=sse \
 	-mmmx \
 	-m32 \
-	-fuse-ld=gold \
 	-ffunction-sections \
 	-funwind-tables \
 	-g \
@@ -512,8 +509,9 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DWTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1' \
+	'-DENABLE_WEB_AUDIO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
@@ -526,11 +524,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -569,6 +562,7 @@
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
+	$(LOCAL_PATH)/third_party/openmax_dl \
 	$(LOCAL_PATH)/third_party/angle/include \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
diff --git a/Source/core/webcore_html.target.darwin-x86_64.mk b/Source/core/webcore_html.target.darwin-x86_64.mk
index a7912e1..b2fa15c 100644
--- a/Source/core/webcore_html.target.darwin-x86_64.mk
+++ b/Source/core/webcore_html.target.darwin-x86_64.mk
@@ -92,6 +92,7 @@
 	third_party/WebKit/Source/core/html/HTMLOutputElement.cpp \
 	third_party/WebKit/Source/core/html/HTMLParagraphElement.cpp \
 	third_party/WebKit/Source/core/html/HTMLParamElement.cpp \
+	third_party/WebKit/Source/core/html/HTMLPictureElement.cpp \
 	third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp \
 	third_party/WebKit/Source/core/html/HTMLPreElement.cpp \
 	third_party/WebKit/Source/core/html/HTMLProgressElement.cpp \
@@ -126,6 +127,7 @@
 	third_party/WebKit/Source/core/html/ImageDocument.cpp \
 	third_party/WebKit/Source/core/html/LabelableElement.cpp \
 	third_party/WebKit/Source/core/html/LabelsNodeList.cpp \
+	third_party/WebKit/Source/core/html/LinkManifest.cpp \
 	third_party/WebKit/Source/core/html/LinkRelAttribute.cpp \
 	third_party/WebKit/Source/core/html/LinkResource.cpp \
 	third_party/WebKit/Source/core/html/MediaController.cpp \
@@ -311,7 +313,6 @@
 	-Wno-unused-local-typedefs \
 	-m64 \
 	-march=x86-64 \
-	-fuse-ld=gold \
 	-ffunction-sections \
 	-funwind-tables \
 	-g \
@@ -354,8 +355,9 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DWTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1' \
+	'-DENABLE_WEB_AUDIO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
@@ -368,11 +370,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -410,6 +407,7 @@
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
+	$(LOCAL_PATH)/third_party/openmax_dl \
 	$(LOCAL_PATH)/third_party/angle/include \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
@@ -469,7 +467,6 @@
 	-Wno-unused-local-typedefs \
 	-m64 \
 	-march=x86-64 \
-	-fuse-ld=gold \
 	-ffunction-sections \
 	-funwind-tables \
 	-g \
@@ -512,8 +509,9 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DWTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1' \
+	'-DENABLE_WEB_AUDIO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
@@ -526,11 +524,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -569,6 +562,7 @@
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
+	$(LOCAL_PATH)/third_party/openmax_dl \
 	$(LOCAL_PATH)/third_party/angle/include \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
diff --git a/Source/core/webcore_html.target.linux-arm.mk b/Source/core/webcore_html.target.linux-arm.mk
index ac6d08b..9daf6d3 100644
--- a/Source/core/webcore_html.target.linux-arm.mk
+++ b/Source/core/webcore_html.target.linux-arm.mk
@@ -92,6 +92,7 @@
 	third_party/WebKit/Source/core/html/HTMLOutputElement.cpp \
 	third_party/WebKit/Source/core/html/HTMLParagraphElement.cpp \
 	third_party/WebKit/Source/core/html/HTMLParamElement.cpp \
+	third_party/WebKit/Source/core/html/HTMLPictureElement.cpp \
 	third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp \
 	third_party/WebKit/Source/core/html/HTMLPreElement.cpp \
 	third_party/WebKit/Source/core/html/HTMLProgressElement.cpp \
@@ -126,6 +127,7 @@
 	third_party/WebKit/Source/core/html/ImageDocument.cpp \
 	third_party/WebKit/Source/core/html/LabelableElement.cpp \
 	third_party/WebKit/Source/core/html/LabelsNodeList.cpp \
+	third_party/WebKit/Source/core/html/LinkManifest.cpp \
 	third_party/WebKit/Source/core/html/LinkRelAttribute.cpp \
 	third_party/WebKit/Source/core/html/LinkResource.cpp \
 	third_party/WebKit/Source/core/html/MediaController.cpp \
@@ -309,7 +311,6 @@
 	-pipe \
 	-fPIC \
 	-fno-tree-sra \
-	-fuse-ld=gold \
 	-Wno-psabi \
 	-ffunction-sections \
 	-funwind-tables \
@@ -353,8 +354,9 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DWTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1' \
+	'-DENABLE_WEB_AUDIO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
@@ -367,11 +369,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -409,6 +406,7 @@
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
+	$(LOCAL_PATH)/third_party/openmax_dl \
 	$(LOCAL_PATH)/third_party/angle/include \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
@@ -467,7 +465,6 @@
 	-pipe \
 	-fPIC \
 	-fno-tree-sra \
-	-fuse-ld=gold \
 	-Wno-psabi \
 	-ffunction-sections \
 	-funwind-tables \
@@ -511,8 +508,9 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DWTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1' \
+	'-DENABLE_WEB_AUDIO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
@@ -525,11 +523,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -568,6 +561,7 @@
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
+	$(LOCAL_PATH)/third_party/openmax_dl \
 	$(LOCAL_PATH)/third_party/angle/include \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
diff --git a/Source/core/webcore_html.target.linux-arm64.mk b/Source/core/webcore_html.target.linux-arm64.mk
index 09b680f..90a466e 100644
--- a/Source/core/webcore_html.target.linux-arm64.mk
+++ b/Source/core/webcore_html.target.linux-arm64.mk
@@ -92,6 +92,7 @@
 	third_party/WebKit/Source/core/html/HTMLOutputElement.cpp \
 	third_party/WebKit/Source/core/html/HTMLParagraphElement.cpp \
 	third_party/WebKit/Source/core/html/HTMLParamElement.cpp \
+	third_party/WebKit/Source/core/html/HTMLPictureElement.cpp \
 	third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp \
 	third_party/WebKit/Source/core/html/HTMLPreElement.cpp \
 	third_party/WebKit/Source/core/html/HTMLProgressElement.cpp \
@@ -126,6 +127,7 @@
 	third_party/WebKit/Source/core/html/ImageDocument.cpp \
 	third_party/WebKit/Source/core/html/LabelableElement.cpp \
 	third_party/WebKit/Source/core/html/LabelsNodeList.cpp \
+	third_party/WebKit/Source/core/html/LinkManifest.cpp \
 	third_party/WebKit/Source/core/html/LinkRelAttribute.cpp \
 	third_party/WebKit/Source/core/html/LinkResource.cpp \
 	third_party/WebKit/Source/core/html/MediaController.cpp \
@@ -349,7 +351,6 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -363,11 +364,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -502,7 +498,6 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -516,11 +511,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
diff --git a/Source/core/webcore_html.target.linux-mips.mk b/Source/core/webcore_html.target.linux-mips.mk
index 1d03b4a..ed2c2e3 100644
--- a/Source/core/webcore_html.target.linux-mips.mk
+++ b/Source/core/webcore_html.target.linux-mips.mk
@@ -92,6 +92,7 @@
 	third_party/WebKit/Source/core/html/HTMLOutputElement.cpp \
 	third_party/WebKit/Source/core/html/HTMLParagraphElement.cpp \
 	third_party/WebKit/Source/core/html/HTMLParamElement.cpp \
+	third_party/WebKit/Source/core/html/HTMLPictureElement.cpp \
 	third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp \
 	third_party/WebKit/Source/core/html/HTMLPreElement.cpp \
 	third_party/WebKit/Source/core/html/HTMLProgressElement.cpp \
@@ -126,6 +127,7 @@
 	third_party/WebKit/Source/core/html/ImageDocument.cpp \
 	third_party/WebKit/Source/core/html/LabelableElement.cpp \
 	third_party/WebKit/Source/core/html/LabelsNodeList.cpp \
+	third_party/WebKit/Source/core/html/LinkManifest.cpp \
 	third_party/WebKit/Source/core/html/LinkRelAttribute.cpp \
 	third_party/WebKit/Source/core/html/LinkResource.cpp \
 	third_party/WebKit/Source/core/html/MediaController.cpp \
@@ -352,7 +354,6 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -366,11 +367,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -509,7 +505,6 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -523,11 +518,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
diff --git a/Source/core/webcore_html.target.linux-x86.mk b/Source/core/webcore_html.target.linux-x86.mk
index d125e6d..1686a11 100644
--- a/Source/core/webcore_html.target.linux-x86.mk
+++ b/Source/core/webcore_html.target.linux-x86.mk
@@ -92,6 +92,7 @@
 	third_party/WebKit/Source/core/html/HTMLOutputElement.cpp \
 	third_party/WebKit/Source/core/html/HTMLParagraphElement.cpp \
 	third_party/WebKit/Source/core/html/HTMLParamElement.cpp \
+	third_party/WebKit/Source/core/html/HTMLPictureElement.cpp \
 	third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp \
 	third_party/WebKit/Source/core/html/HTMLPreElement.cpp \
 	third_party/WebKit/Source/core/html/HTMLProgressElement.cpp \
@@ -126,6 +127,7 @@
 	third_party/WebKit/Source/core/html/ImageDocument.cpp \
 	third_party/WebKit/Source/core/html/LabelableElement.cpp \
 	third_party/WebKit/Source/core/html/LabelsNodeList.cpp \
+	third_party/WebKit/Source/core/html/LinkManifest.cpp \
 	third_party/WebKit/Source/core/html/LinkRelAttribute.cpp \
 	third_party/WebKit/Source/core/html/LinkResource.cpp \
 	third_party/WebKit/Source/core/html/MediaController.cpp \
@@ -311,7 +313,6 @@
 	-mfpmath=sse \
 	-mmmx \
 	-m32 \
-	-fuse-ld=gold \
 	-ffunction-sections \
 	-funwind-tables \
 	-g \
@@ -354,8 +355,9 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DWTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1' \
+	'-DENABLE_WEB_AUDIO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
@@ -368,11 +370,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -410,6 +407,7 @@
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
+	$(LOCAL_PATH)/third_party/openmax_dl \
 	$(LOCAL_PATH)/third_party/angle/include \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
@@ -469,7 +467,6 @@
 	-mfpmath=sse \
 	-mmmx \
 	-m32 \
-	-fuse-ld=gold \
 	-ffunction-sections \
 	-funwind-tables \
 	-g \
@@ -512,8 +509,9 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DWTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1' \
+	'-DENABLE_WEB_AUDIO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
@@ -526,11 +524,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -569,6 +562,7 @@
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
+	$(LOCAL_PATH)/third_party/openmax_dl \
 	$(LOCAL_PATH)/third_party/angle/include \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
diff --git a/Source/core/webcore_html.target.linux-x86_64.mk b/Source/core/webcore_html.target.linux-x86_64.mk
index a7912e1..b2fa15c 100644
--- a/Source/core/webcore_html.target.linux-x86_64.mk
+++ b/Source/core/webcore_html.target.linux-x86_64.mk
@@ -92,6 +92,7 @@
 	third_party/WebKit/Source/core/html/HTMLOutputElement.cpp \
 	third_party/WebKit/Source/core/html/HTMLParagraphElement.cpp \
 	third_party/WebKit/Source/core/html/HTMLParamElement.cpp \
+	third_party/WebKit/Source/core/html/HTMLPictureElement.cpp \
 	third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp \
 	third_party/WebKit/Source/core/html/HTMLPreElement.cpp \
 	third_party/WebKit/Source/core/html/HTMLProgressElement.cpp \
@@ -126,6 +127,7 @@
 	third_party/WebKit/Source/core/html/ImageDocument.cpp \
 	third_party/WebKit/Source/core/html/LabelableElement.cpp \
 	third_party/WebKit/Source/core/html/LabelsNodeList.cpp \
+	third_party/WebKit/Source/core/html/LinkManifest.cpp \
 	third_party/WebKit/Source/core/html/LinkRelAttribute.cpp \
 	third_party/WebKit/Source/core/html/LinkResource.cpp \
 	third_party/WebKit/Source/core/html/MediaController.cpp \
@@ -311,7 +313,6 @@
 	-Wno-unused-local-typedefs \
 	-m64 \
 	-march=x86-64 \
-	-fuse-ld=gold \
 	-ffunction-sections \
 	-funwind-tables \
 	-g \
@@ -354,8 +355,9 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DWTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1' \
+	'-DENABLE_WEB_AUDIO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
@@ -368,11 +370,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -410,6 +407,7 @@
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
+	$(LOCAL_PATH)/third_party/openmax_dl \
 	$(LOCAL_PATH)/third_party/angle/include \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
@@ -469,7 +467,6 @@
 	-Wno-unused-local-typedefs \
 	-m64 \
 	-march=x86-64 \
-	-fuse-ld=gold \
 	-ffunction-sections \
 	-funwind-tables \
 	-g \
@@ -512,8 +509,9 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DWTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1' \
+	'-DENABLE_WEB_AUDIO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
@@ -526,11 +524,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -569,6 +562,7 @@
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
+	$(LOCAL_PATH)/third_party/openmax_dl \
 	$(LOCAL_PATH)/third_party/angle/include \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
diff --git a/Source/core/webcore_prerequisites.target.darwin-arm.mk b/Source/core/webcore_prerequisites.target.darwin-arm.mk
index e0239cf..178c694 100644
--- a/Source/core/webcore_prerequisites.target.darwin-arm.mk
+++ b/Source/core/webcore_prerequisites.target.darwin-arm.mk
@@ -38,7 +38,8 @@
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_sqlite_sqlite_gyp,,,$(GYP_VAR_PREFIX))/third_party_sqlite_sqlite_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_zlib_zlib_gyp,,,$(GYP_VAR_PREFIX))/third_party_zlib_zlib_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,url_url_lib_gyp,,,$(GYP_VAR_PREFIX))/url_url_lib_gyp.a \
-	$(call intermediates-dir-for,GYP,v8_tools_gyp_v8_gyp,,,$(GYP_VAR_PREFIX))/v8.stamp
+	$(call intermediates-dir-for,GYP,v8_tools_gyp_v8_gyp,,,$(GYP_VAR_PREFIX))/v8.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_openmax_dl_dl_openmax_dl_gyp,,,$(GYP_VAR_PREFIX))/third_party_openmax_dl_dl_openmax_dl_gyp.a
 
 GYP_GENERATED_OUTPUTS :=
 
diff --git a/Source/core/webcore_prerequisites.target.darwin-x86.mk b/Source/core/webcore_prerequisites.target.darwin-x86.mk
index e0239cf..178c694 100644
--- a/Source/core/webcore_prerequisites.target.darwin-x86.mk
+++ b/Source/core/webcore_prerequisites.target.darwin-x86.mk
@@ -38,7 +38,8 @@
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_sqlite_sqlite_gyp,,,$(GYP_VAR_PREFIX))/third_party_sqlite_sqlite_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_zlib_zlib_gyp,,,$(GYP_VAR_PREFIX))/third_party_zlib_zlib_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,url_url_lib_gyp,,,$(GYP_VAR_PREFIX))/url_url_lib_gyp.a \
-	$(call intermediates-dir-for,GYP,v8_tools_gyp_v8_gyp,,,$(GYP_VAR_PREFIX))/v8.stamp
+	$(call intermediates-dir-for,GYP,v8_tools_gyp_v8_gyp,,,$(GYP_VAR_PREFIX))/v8.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_openmax_dl_dl_openmax_dl_gyp,,,$(GYP_VAR_PREFIX))/third_party_openmax_dl_dl_openmax_dl_gyp.a
 
 GYP_GENERATED_OUTPUTS :=
 
diff --git a/Source/core/webcore_prerequisites.target.darwin-x86_64.mk b/Source/core/webcore_prerequisites.target.darwin-x86_64.mk
index e0239cf..178c694 100644
--- a/Source/core/webcore_prerequisites.target.darwin-x86_64.mk
+++ b/Source/core/webcore_prerequisites.target.darwin-x86_64.mk
@@ -38,7 +38,8 @@
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_sqlite_sqlite_gyp,,,$(GYP_VAR_PREFIX))/third_party_sqlite_sqlite_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_zlib_zlib_gyp,,,$(GYP_VAR_PREFIX))/third_party_zlib_zlib_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,url_url_lib_gyp,,,$(GYP_VAR_PREFIX))/url_url_lib_gyp.a \
-	$(call intermediates-dir-for,GYP,v8_tools_gyp_v8_gyp,,,$(GYP_VAR_PREFIX))/v8.stamp
+	$(call intermediates-dir-for,GYP,v8_tools_gyp_v8_gyp,,,$(GYP_VAR_PREFIX))/v8.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_openmax_dl_dl_openmax_dl_gyp,,,$(GYP_VAR_PREFIX))/third_party_openmax_dl_dl_openmax_dl_gyp.a
 
 GYP_GENERATED_OUTPUTS :=
 
diff --git a/Source/core/webcore_prerequisites.target.linux-arm.mk b/Source/core/webcore_prerequisites.target.linux-arm.mk
index e0239cf..178c694 100644
--- a/Source/core/webcore_prerequisites.target.linux-arm.mk
+++ b/Source/core/webcore_prerequisites.target.linux-arm.mk
@@ -38,7 +38,8 @@
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_sqlite_sqlite_gyp,,,$(GYP_VAR_PREFIX))/third_party_sqlite_sqlite_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_zlib_zlib_gyp,,,$(GYP_VAR_PREFIX))/third_party_zlib_zlib_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,url_url_lib_gyp,,,$(GYP_VAR_PREFIX))/url_url_lib_gyp.a \
-	$(call intermediates-dir-for,GYP,v8_tools_gyp_v8_gyp,,,$(GYP_VAR_PREFIX))/v8.stamp
+	$(call intermediates-dir-for,GYP,v8_tools_gyp_v8_gyp,,,$(GYP_VAR_PREFIX))/v8.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_openmax_dl_dl_openmax_dl_gyp,,,$(GYP_VAR_PREFIX))/third_party_openmax_dl_dl_openmax_dl_gyp.a
 
 GYP_GENERATED_OUTPUTS :=
 
diff --git a/Source/core/webcore_prerequisites.target.linux-x86.mk b/Source/core/webcore_prerequisites.target.linux-x86.mk
index e0239cf..178c694 100644
--- a/Source/core/webcore_prerequisites.target.linux-x86.mk
+++ b/Source/core/webcore_prerequisites.target.linux-x86.mk
@@ -38,7 +38,8 @@
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_sqlite_sqlite_gyp,,,$(GYP_VAR_PREFIX))/third_party_sqlite_sqlite_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_zlib_zlib_gyp,,,$(GYP_VAR_PREFIX))/third_party_zlib_zlib_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,url_url_lib_gyp,,,$(GYP_VAR_PREFIX))/url_url_lib_gyp.a \
-	$(call intermediates-dir-for,GYP,v8_tools_gyp_v8_gyp,,,$(GYP_VAR_PREFIX))/v8.stamp
+	$(call intermediates-dir-for,GYP,v8_tools_gyp_v8_gyp,,,$(GYP_VAR_PREFIX))/v8.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_openmax_dl_dl_openmax_dl_gyp,,,$(GYP_VAR_PREFIX))/third_party_openmax_dl_dl_openmax_dl_gyp.a
 
 GYP_GENERATED_OUTPUTS :=
 
diff --git a/Source/core/webcore_prerequisites.target.linux-x86_64.mk b/Source/core/webcore_prerequisites.target.linux-x86_64.mk
index e0239cf..178c694 100644
--- a/Source/core/webcore_prerequisites.target.linux-x86_64.mk
+++ b/Source/core/webcore_prerequisites.target.linux-x86_64.mk
@@ -38,7 +38,8 @@
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_sqlite_sqlite_gyp,,,$(GYP_VAR_PREFIX))/third_party_sqlite_sqlite_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_zlib_zlib_gyp,,,$(GYP_VAR_PREFIX))/third_party_zlib_zlib_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,url_url_lib_gyp,,,$(GYP_VAR_PREFIX))/url_url_lib_gyp.a \
-	$(call intermediates-dir-for,GYP,v8_tools_gyp_v8_gyp,,,$(GYP_VAR_PREFIX))/v8.stamp
+	$(call intermediates-dir-for,GYP,v8_tools_gyp_v8_gyp,,,$(GYP_VAR_PREFIX))/v8.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_openmax_dl_dl_openmax_dl_gyp,,,$(GYP_VAR_PREFIX))/third_party_openmax_dl_dl_openmax_dl_gyp.a
 
 GYP_GENERATED_OUTPUTS :=
 
diff --git a/Source/core/webcore_remaining.target.darwin-arm.mk b/Source/core/webcore_remaining.target.darwin-arm.mk
index f8a31cf..44797f1 100644
--- a/Source/core/webcore_remaining.target.darwin-arm.mk
+++ b/Source/core/webcore_remaining.target.darwin-arm.mk
@@ -346,6 +346,7 @@
 	third_party/WebKit/Source/core/frame/DeprecatedScheduleStyleRecalcDuringLayout.cpp \
 	third_party/WebKit/Source/core/frame/DeviceSensorEventController.cpp \
 	third_party/WebKit/Source/core/frame/DeviceSensorEventDispatcher.cpp \
+	third_party/WebKit/Source/core/frame/EventHandlerRegistry.cpp \
 	third_party/WebKit/Source/core/frame/Frame.cpp \
 	third_party/WebKit/Source/core/frame/FrameConsole.cpp \
 	third_party/WebKit/Source/core/frame/FrameDestructionObserver.cpp \
@@ -507,10 +508,6 @@
 	third_party/WebKit/Source/core/plugins/DOMPlugin.cpp \
 	third_party/WebKit/Source/core/plugins/DOMPluginArray.cpp \
 	third_party/WebKit/Source/core/plugins/PluginOcclusionSupport.cpp \
-	third_party/WebKit/Source/core/speech/SpeechInput.cpp \
-	third_party/WebKit/Source/core/speech/SpeechInputEvent.cpp \
-	third_party/WebKit/Source/core/speech/SpeechInputResult.cpp \
-	third_party/WebKit/Source/core/speech/SpeechInputResultList.cpp \
 	third_party/WebKit/Source/core/storage/Storage.cpp \
 	third_party/WebKit/Source/core/storage/StorageArea.cpp \
 	third_party/WebKit/Source/core/storage/StorageEvent.cpp \
@@ -589,7 +586,6 @@
 	-fPIC \
 	-fno-strict-aliasing \
 	-fno-tree-sra \
-	-fuse-ld=gold \
 	-Wno-psabi \
 	-ffunction-sections \
 	-funwind-tables \
@@ -633,8 +629,9 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DWTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1' \
+	'-DENABLE_WEB_AUDIO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
@@ -647,11 +644,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -689,6 +681,7 @@
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
+	$(LOCAL_PATH)/third_party/openmax_dl \
 	$(LOCAL_PATH)/third_party/angle/include \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
@@ -748,7 +741,6 @@
 	-fPIC \
 	-fno-strict-aliasing \
 	-fno-tree-sra \
-	-fuse-ld=gold \
 	-Wno-psabi \
 	-ffunction-sections \
 	-funwind-tables \
@@ -792,8 +784,9 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DWTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1' \
+	'-DENABLE_WEB_AUDIO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
@@ -806,11 +799,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -849,6 +837,7 @@
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
+	$(LOCAL_PATH)/third_party/openmax_dl \
 	$(LOCAL_PATH)/third_party/angle/include \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
diff --git a/Source/core/webcore_remaining.target.darwin-arm64.mk b/Source/core/webcore_remaining.target.darwin-arm64.mk
index c62392c..8c1f810 100644
--- a/Source/core/webcore_remaining.target.darwin-arm64.mk
+++ b/Source/core/webcore_remaining.target.darwin-arm64.mk
@@ -346,6 +346,7 @@
 	third_party/WebKit/Source/core/frame/DeprecatedScheduleStyleRecalcDuringLayout.cpp \
 	third_party/WebKit/Source/core/frame/DeviceSensorEventController.cpp \
 	third_party/WebKit/Source/core/frame/DeviceSensorEventDispatcher.cpp \
+	third_party/WebKit/Source/core/frame/EventHandlerRegistry.cpp \
 	third_party/WebKit/Source/core/frame/Frame.cpp \
 	third_party/WebKit/Source/core/frame/FrameConsole.cpp \
 	third_party/WebKit/Source/core/frame/FrameDestructionObserver.cpp \
@@ -507,10 +508,6 @@
 	third_party/WebKit/Source/core/plugins/DOMPlugin.cpp \
 	third_party/WebKit/Source/core/plugins/DOMPluginArray.cpp \
 	third_party/WebKit/Source/core/plugins/PluginOcclusionSupport.cpp \
-	third_party/WebKit/Source/core/speech/SpeechInput.cpp \
-	third_party/WebKit/Source/core/speech/SpeechInputEvent.cpp \
-	third_party/WebKit/Source/core/speech/SpeechInputResult.cpp \
-	third_party/WebKit/Source/core/speech/SpeechInputResultList.cpp \
 	third_party/WebKit/Source/core/storage/Storage.cpp \
 	third_party/WebKit/Source/core/storage/StorageArea.cpp \
 	third_party/WebKit/Source/core/storage/StorageEvent.cpp \
@@ -629,7 +626,6 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -643,11 +639,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -783,7 +774,6 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -797,11 +787,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
diff --git a/Source/core/webcore_remaining.target.darwin-mips.mk b/Source/core/webcore_remaining.target.darwin-mips.mk
index 4e869c7..a02ff30 100644
--- a/Source/core/webcore_remaining.target.darwin-mips.mk
+++ b/Source/core/webcore_remaining.target.darwin-mips.mk
@@ -346,6 +346,7 @@
 	third_party/WebKit/Source/core/frame/DeprecatedScheduleStyleRecalcDuringLayout.cpp \
 	third_party/WebKit/Source/core/frame/DeviceSensorEventController.cpp \
 	third_party/WebKit/Source/core/frame/DeviceSensorEventDispatcher.cpp \
+	third_party/WebKit/Source/core/frame/EventHandlerRegistry.cpp \
 	third_party/WebKit/Source/core/frame/Frame.cpp \
 	third_party/WebKit/Source/core/frame/FrameConsole.cpp \
 	third_party/WebKit/Source/core/frame/FrameDestructionObserver.cpp \
@@ -507,10 +508,6 @@
 	third_party/WebKit/Source/core/plugins/DOMPlugin.cpp \
 	third_party/WebKit/Source/core/plugins/DOMPluginArray.cpp \
 	third_party/WebKit/Source/core/plugins/PluginOcclusionSupport.cpp \
-	third_party/WebKit/Source/core/speech/SpeechInput.cpp \
-	third_party/WebKit/Source/core/speech/SpeechInputEvent.cpp \
-	third_party/WebKit/Source/core/speech/SpeechInputResult.cpp \
-	third_party/WebKit/Source/core/speech/SpeechInputResultList.cpp \
 	third_party/WebKit/Source/core/storage/Storage.cpp \
 	third_party/WebKit/Source/core/storage/StorageArea.cpp \
 	third_party/WebKit/Source/core/storage/StorageEvent.cpp \
@@ -632,7 +629,6 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -646,11 +642,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -790,7 +781,6 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -804,11 +794,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
diff --git a/Source/core/webcore_remaining.target.darwin-x86.mk b/Source/core/webcore_remaining.target.darwin-x86.mk
index c138240..1f639e6 100644
--- a/Source/core/webcore_remaining.target.darwin-x86.mk
+++ b/Source/core/webcore_remaining.target.darwin-x86.mk
@@ -346,6 +346,7 @@
 	third_party/WebKit/Source/core/frame/DeprecatedScheduleStyleRecalcDuringLayout.cpp \
 	third_party/WebKit/Source/core/frame/DeviceSensorEventController.cpp \
 	third_party/WebKit/Source/core/frame/DeviceSensorEventDispatcher.cpp \
+	third_party/WebKit/Source/core/frame/EventHandlerRegistry.cpp \
 	third_party/WebKit/Source/core/frame/Frame.cpp \
 	third_party/WebKit/Source/core/frame/FrameConsole.cpp \
 	third_party/WebKit/Source/core/frame/FrameDestructionObserver.cpp \
@@ -507,10 +508,6 @@
 	third_party/WebKit/Source/core/plugins/DOMPlugin.cpp \
 	third_party/WebKit/Source/core/plugins/DOMPluginArray.cpp \
 	third_party/WebKit/Source/core/plugins/PluginOcclusionSupport.cpp \
-	third_party/WebKit/Source/core/speech/SpeechInput.cpp \
-	third_party/WebKit/Source/core/speech/SpeechInputEvent.cpp \
-	third_party/WebKit/Source/core/speech/SpeechInputResult.cpp \
-	third_party/WebKit/Source/core/speech/SpeechInputResultList.cpp \
 	third_party/WebKit/Source/core/storage/Storage.cpp \
 	third_party/WebKit/Source/core/storage/StorageArea.cpp \
 	third_party/WebKit/Source/core/storage/StorageEvent.cpp \
@@ -591,7 +588,6 @@
 	-mfpmath=sse \
 	-mmmx \
 	-m32 \
-	-fuse-ld=gold \
 	-ffunction-sections \
 	-funwind-tables \
 	-g \
@@ -634,8 +630,9 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DWTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1' \
+	'-DENABLE_WEB_AUDIO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
@@ -648,11 +645,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -690,6 +682,7 @@
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
+	$(LOCAL_PATH)/third_party/openmax_dl \
 	$(LOCAL_PATH)/third_party/angle/include \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
@@ -750,7 +743,6 @@
 	-mfpmath=sse \
 	-mmmx \
 	-m32 \
-	-fuse-ld=gold \
 	-ffunction-sections \
 	-funwind-tables \
 	-g \
@@ -793,8 +785,9 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DWTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1' \
+	'-DENABLE_WEB_AUDIO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
@@ -807,11 +800,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -850,6 +838,7 @@
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
+	$(LOCAL_PATH)/third_party/openmax_dl \
 	$(LOCAL_PATH)/third_party/angle/include \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
diff --git a/Source/core/webcore_remaining.target.darwin-x86_64.mk b/Source/core/webcore_remaining.target.darwin-x86_64.mk
index 82d4846..192bfd5 100644
--- a/Source/core/webcore_remaining.target.darwin-x86_64.mk
+++ b/Source/core/webcore_remaining.target.darwin-x86_64.mk
@@ -346,6 +346,7 @@
 	third_party/WebKit/Source/core/frame/DeprecatedScheduleStyleRecalcDuringLayout.cpp \
 	third_party/WebKit/Source/core/frame/DeviceSensorEventController.cpp \
 	third_party/WebKit/Source/core/frame/DeviceSensorEventDispatcher.cpp \
+	third_party/WebKit/Source/core/frame/EventHandlerRegistry.cpp \
 	third_party/WebKit/Source/core/frame/Frame.cpp \
 	third_party/WebKit/Source/core/frame/FrameConsole.cpp \
 	third_party/WebKit/Source/core/frame/FrameDestructionObserver.cpp \
@@ -507,10 +508,6 @@
 	third_party/WebKit/Source/core/plugins/DOMPlugin.cpp \
 	third_party/WebKit/Source/core/plugins/DOMPluginArray.cpp \
 	third_party/WebKit/Source/core/plugins/PluginOcclusionSupport.cpp \
-	third_party/WebKit/Source/core/speech/SpeechInput.cpp \
-	third_party/WebKit/Source/core/speech/SpeechInputEvent.cpp \
-	third_party/WebKit/Source/core/speech/SpeechInputResult.cpp \
-	third_party/WebKit/Source/core/speech/SpeechInputResultList.cpp \
 	third_party/WebKit/Source/core/storage/Storage.cpp \
 	third_party/WebKit/Source/core/storage/StorageArea.cpp \
 	third_party/WebKit/Source/core/storage/StorageEvent.cpp \
@@ -591,7 +588,6 @@
 	-fno-strict-aliasing \
 	-m64 \
 	-march=x86-64 \
-	-fuse-ld=gold \
 	-ffunction-sections \
 	-funwind-tables \
 	-g \
@@ -634,8 +630,9 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DWTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1' \
+	'-DENABLE_WEB_AUDIO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
@@ -648,11 +645,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -690,6 +682,7 @@
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
+	$(LOCAL_PATH)/third_party/openmax_dl \
 	$(LOCAL_PATH)/third_party/angle/include \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
@@ -750,7 +743,6 @@
 	-fno-strict-aliasing \
 	-m64 \
 	-march=x86-64 \
-	-fuse-ld=gold \
 	-ffunction-sections \
 	-funwind-tables \
 	-g \
@@ -793,8 +785,9 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DWTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1' \
+	'-DENABLE_WEB_AUDIO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
@@ -807,11 +800,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -850,6 +838,7 @@
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
+	$(LOCAL_PATH)/third_party/openmax_dl \
 	$(LOCAL_PATH)/third_party/angle/include \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
diff --git a/Source/core/webcore_remaining.target.linux-arm.mk b/Source/core/webcore_remaining.target.linux-arm.mk
index f8a31cf..44797f1 100644
--- a/Source/core/webcore_remaining.target.linux-arm.mk
+++ b/Source/core/webcore_remaining.target.linux-arm.mk
@@ -346,6 +346,7 @@
 	third_party/WebKit/Source/core/frame/DeprecatedScheduleStyleRecalcDuringLayout.cpp \
 	third_party/WebKit/Source/core/frame/DeviceSensorEventController.cpp \
 	third_party/WebKit/Source/core/frame/DeviceSensorEventDispatcher.cpp \
+	third_party/WebKit/Source/core/frame/EventHandlerRegistry.cpp \
 	third_party/WebKit/Source/core/frame/Frame.cpp \
 	third_party/WebKit/Source/core/frame/FrameConsole.cpp \
 	third_party/WebKit/Source/core/frame/FrameDestructionObserver.cpp \
@@ -507,10 +508,6 @@
 	third_party/WebKit/Source/core/plugins/DOMPlugin.cpp \
 	third_party/WebKit/Source/core/plugins/DOMPluginArray.cpp \
 	third_party/WebKit/Source/core/plugins/PluginOcclusionSupport.cpp \
-	third_party/WebKit/Source/core/speech/SpeechInput.cpp \
-	third_party/WebKit/Source/core/speech/SpeechInputEvent.cpp \
-	third_party/WebKit/Source/core/speech/SpeechInputResult.cpp \
-	third_party/WebKit/Source/core/speech/SpeechInputResultList.cpp \
 	third_party/WebKit/Source/core/storage/Storage.cpp \
 	third_party/WebKit/Source/core/storage/StorageArea.cpp \
 	third_party/WebKit/Source/core/storage/StorageEvent.cpp \
@@ -589,7 +586,6 @@
 	-fPIC \
 	-fno-strict-aliasing \
 	-fno-tree-sra \
-	-fuse-ld=gold \
 	-Wno-psabi \
 	-ffunction-sections \
 	-funwind-tables \
@@ -633,8 +629,9 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DWTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1' \
+	'-DENABLE_WEB_AUDIO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
@@ -647,11 +644,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -689,6 +681,7 @@
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
+	$(LOCAL_PATH)/third_party/openmax_dl \
 	$(LOCAL_PATH)/third_party/angle/include \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
@@ -748,7 +741,6 @@
 	-fPIC \
 	-fno-strict-aliasing \
 	-fno-tree-sra \
-	-fuse-ld=gold \
 	-Wno-psabi \
 	-ffunction-sections \
 	-funwind-tables \
@@ -792,8 +784,9 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DWTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1' \
+	'-DENABLE_WEB_AUDIO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
@@ -806,11 +799,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -849,6 +837,7 @@
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
+	$(LOCAL_PATH)/third_party/openmax_dl \
 	$(LOCAL_PATH)/third_party/angle/include \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
diff --git a/Source/core/webcore_remaining.target.linux-arm64.mk b/Source/core/webcore_remaining.target.linux-arm64.mk
index c62392c..8c1f810 100644
--- a/Source/core/webcore_remaining.target.linux-arm64.mk
+++ b/Source/core/webcore_remaining.target.linux-arm64.mk
@@ -346,6 +346,7 @@
 	third_party/WebKit/Source/core/frame/DeprecatedScheduleStyleRecalcDuringLayout.cpp \
 	third_party/WebKit/Source/core/frame/DeviceSensorEventController.cpp \
 	third_party/WebKit/Source/core/frame/DeviceSensorEventDispatcher.cpp \
+	third_party/WebKit/Source/core/frame/EventHandlerRegistry.cpp \
 	third_party/WebKit/Source/core/frame/Frame.cpp \
 	third_party/WebKit/Source/core/frame/FrameConsole.cpp \
 	third_party/WebKit/Source/core/frame/FrameDestructionObserver.cpp \
@@ -507,10 +508,6 @@
 	third_party/WebKit/Source/core/plugins/DOMPlugin.cpp \
 	third_party/WebKit/Source/core/plugins/DOMPluginArray.cpp \
 	third_party/WebKit/Source/core/plugins/PluginOcclusionSupport.cpp \
-	third_party/WebKit/Source/core/speech/SpeechInput.cpp \
-	third_party/WebKit/Source/core/speech/SpeechInputEvent.cpp \
-	third_party/WebKit/Source/core/speech/SpeechInputResult.cpp \
-	third_party/WebKit/Source/core/speech/SpeechInputResultList.cpp \
 	third_party/WebKit/Source/core/storage/Storage.cpp \
 	third_party/WebKit/Source/core/storage/StorageArea.cpp \
 	third_party/WebKit/Source/core/storage/StorageEvent.cpp \
@@ -629,7 +626,6 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -643,11 +639,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -783,7 +774,6 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -797,11 +787,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
diff --git a/Source/core/webcore_remaining.target.linux-mips.mk b/Source/core/webcore_remaining.target.linux-mips.mk
index 4e869c7..a02ff30 100644
--- a/Source/core/webcore_remaining.target.linux-mips.mk
+++ b/Source/core/webcore_remaining.target.linux-mips.mk
@@ -346,6 +346,7 @@
 	third_party/WebKit/Source/core/frame/DeprecatedScheduleStyleRecalcDuringLayout.cpp \
 	third_party/WebKit/Source/core/frame/DeviceSensorEventController.cpp \
 	third_party/WebKit/Source/core/frame/DeviceSensorEventDispatcher.cpp \
+	third_party/WebKit/Source/core/frame/EventHandlerRegistry.cpp \
 	third_party/WebKit/Source/core/frame/Frame.cpp \
 	third_party/WebKit/Source/core/frame/FrameConsole.cpp \
 	third_party/WebKit/Source/core/frame/FrameDestructionObserver.cpp \
@@ -507,10 +508,6 @@
 	third_party/WebKit/Source/core/plugins/DOMPlugin.cpp \
 	third_party/WebKit/Source/core/plugins/DOMPluginArray.cpp \
 	third_party/WebKit/Source/core/plugins/PluginOcclusionSupport.cpp \
-	third_party/WebKit/Source/core/speech/SpeechInput.cpp \
-	third_party/WebKit/Source/core/speech/SpeechInputEvent.cpp \
-	third_party/WebKit/Source/core/speech/SpeechInputResult.cpp \
-	third_party/WebKit/Source/core/speech/SpeechInputResultList.cpp \
 	third_party/WebKit/Source/core/storage/Storage.cpp \
 	third_party/WebKit/Source/core/storage/StorageArea.cpp \
 	third_party/WebKit/Source/core/storage/StorageEvent.cpp \
@@ -632,7 +629,6 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -646,11 +642,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -790,7 +781,6 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -804,11 +794,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
diff --git a/Source/core/webcore_remaining.target.linux-x86.mk b/Source/core/webcore_remaining.target.linux-x86.mk
index c138240..1f639e6 100644
--- a/Source/core/webcore_remaining.target.linux-x86.mk
+++ b/Source/core/webcore_remaining.target.linux-x86.mk
@@ -346,6 +346,7 @@
 	third_party/WebKit/Source/core/frame/DeprecatedScheduleStyleRecalcDuringLayout.cpp \
 	third_party/WebKit/Source/core/frame/DeviceSensorEventController.cpp \
 	third_party/WebKit/Source/core/frame/DeviceSensorEventDispatcher.cpp \
+	third_party/WebKit/Source/core/frame/EventHandlerRegistry.cpp \
 	third_party/WebKit/Source/core/frame/Frame.cpp \
 	third_party/WebKit/Source/core/frame/FrameConsole.cpp \
 	third_party/WebKit/Source/core/frame/FrameDestructionObserver.cpp \
@@ -507,10 +508,6 @@
 	third_party/WebKit/Source/core/plugins/DOMPlugin.cpp \
 	third_party/WebKit/Source/core/plugins/DOMPluginArray.cpp \
 	third_party/WebKit/Source/core/plugins/PluginOcclusionSupport.cpp \
-	third_party/WebKit/Source/core/speech/SpeechInput.cpp \
-	third_party/WebKit/Source/core/speech/SpeechInputEvent.cpp \
-	third_party/WebKit/Source/core/speech/SpeechInputResult.cpp \
-	third_party/WebKit/Source/core/speech/SpeechInputResultList.cpp \
 	third_party/WebKit/Source/core/storage/Storage.cpp \
 	third_party/WebKit/Source/core/storage/StorageArea.cpp \
 	third_party/WebKit/Source/core/storage/StorageEvent.cpp \
@@ -591,7 +588,6 @@
 	-mfpmath=sse \
 	-mmmx \
 	-m32 \
-	-fuse-ld=gold \
 	-ffunction-sections \
 	-funwind-tables \
 	-g \
@@ -634,8 +630,9 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DWTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1' \
+	'-DENABLE_WEB_AUDIO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
@@ -648,11 +645,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -690,6 +682,7 @@
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
+	$(LOCAL_PATH)/third_party/openmax_dl \
 	$(LOCAL_PATH)/third_party/angle/include \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
@@ -750,7 +743,6 @@
 	-mfpmath=sse \
 	-mmmx \
 	-m32 \
-	-fuse-ld=gold \
 	-ffunction-sections \
 	-funwind-tables \
 	-g \
@@ -793,8 +785,9 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DWTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1' \
+	'-DENABLE_WEB_AUDIO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
@@ -807,11 +800,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -850,6 +838,7 @@
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
+	$(LOCAL_PATH)/third_party/openmax_dl \
 	$(LOCAL_PATH)/third_party/angle/include \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
diff --git a/Source/core/webcore_remaining.target.linux-x86_64.mk b/Source/core/webcore_remaining.target.linux-x86_64.mk
index 82d4846..192bfd5 100644
--- a/Source/core/webcore_remaining.target.linux-x86_64.mk
+++ b/Source/core/webcore_remaining.target.linux-x86_64.mk
@@ -346,6 +346,7 @@
 	third_party/WebKit/Source/core/frame/DeprecatedScheduleStyleRecalcDuringLayout.cpp \
 	third_party/WebKit/Source/core/frame/DeviceSensorEventController.cpp \
 	third_party/WebKit/Source/core/frame/DeviceSensorEventDispatcher.cpp \
+	third_party/WebKit/Source/core/frame/EventHandlerRegistry.cpp \
 	third_party/WebKit/Source/core/frame/Frame.cpp \
 	third_party/WebKit/Source/core/frame/FrameConsole.cpp \
 	third_party/WebKit/Source/core/frame/FrameDestructionObserver.cpp \
@@ -507,10 +508,6 @@
 	third_party/WebKit/Source/core/plugins/DOMPlugin.cpp \
 	third_party/WebKit/Source/core/plugins/DOMPluginArray.cpp \
 	third_party/WebKit/Source/core/plugins/PluginOcclusionSupport.cpp \
-	third_party/WebKit/Source/core/speech/SpeechInput.cpp \
-	third_party/WebKit/Source/core/speech/SpeechInputEvent.cpp \
-	third_party/WebKit/Source/core/speech/SpeechInputResult.cpp \
-	third_party/WebKit/Source/core/speech/SpeechInputResultList.cpp \
 	third_party/WebKit/Source/core/storage/Storage.cpp \
 	third_party/WebKit/Source/core/storage/StorageArea.cpp \
 	third_party/WebKit/Source/core/storage/StorageEvent.cpp \
@@ -591,7 +588,6 @@
 	-fno-strict-aliasing \
 	-m64 \
 	-march=x86-64 \
-	-fuse-ld=gold \
 	-ffunction-sections \
 	-funwind-tables \
 	-g \
@@ -634,8 +630,9 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DWTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1' \
+	'-DENABLE_WEB_AUDIO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
@@ -648,11 +645,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -690,6 +682,7 @@
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
+	$(LOCAL_PATH)/third_party/openmax_dl \
 	$(LOCAL_PATH)/third_party/angle/include \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
@@ -750,7 +743,6 @@
 	-fno-strict-aliasing \
 	-m64 \
 	-march=x86-64 \
-	-fuse-ld=gold \
 	-ffunction-sections \
 	-funwind-tables \
 	-g \
@@ -793,8 +785,9 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DWTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1' \
+	'-DENABLE_WEB_AUDIO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
@@ -807,11 +800,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -850,6 +838,7 @@
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
+	$(LOCAL_PATH)/third_party/openmax_dl \
 	$(LOCAL_PATH)/third_party/angle/include \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
diff --git a/Source/core/webcore_rendering.target.darwin-arm.mk b/Source/core/webcore_rendering.target.darwin-arm.mk
index 8127f6c..4005608 100644
--- a/Source/core/webcore_rendering.target.darwin-arm.mk
+++ b/Source/core/webcore_rendering.target.darwin-arm.mk
@@ -75,7 +75,6 @@
 	third_party/WebKit/Source/core/rendering/RenderImageResource.cpp \
 	third_party/WebKit/Source/core/rendering/RenderImageResourceStyleImage.cpp \
 	third_party/WebKit/Source/core/rendering/RenderInline.cpp \
-	third_party/WebKit/Source/core/rendering/RenderInputSpeech.cpp \
 	third_party/WebKit/Source/core/rendering/RenderLayer.cpp \
 	third_party/WebKit/Source/core/rendering/RenderLayerBlendInfo.cpp \
 	third_party/WebKit/Source/core/rendering/RenderLayerClipper.cpp \
@@ -104,7 +103,6 @@
 	third_party/WebKit/Source/core/rendering/RenderProgress.cpp \
 	third_party/WebKit/Source/core/rendering/RenderQuote.cpp \
 	third_party/WebKit/Source/core/rendering/RenderRegion.cpp \
-	third_party/WebKit/Source/core/rendering/RenderRegionSet.cpp \
 	third_party/WebKit/Source/core/rendering/RenderReplaced.cpp \
 	third_party/WebKit/Source/core/rendering/RenderReplica.cpp \
 	third_party/WebKit/Source/core/rendering/RenderRuby.cpp \
@@ -145,6 +143,7 @@
 	third_party/WebKit/Source/core/rendering/TextAutosizer.cpp \
 	third_party/WebKit/Source/core/rendering/break_lines.cpp \
 	third_party/WebKit/Source/core/rendering/compositing/CompositedLayerMapping.cpp \
+	third_party/WebKit/Source/core/rendering/compositing/CompositingLayerAssigner.cpp \
 	third_party/WebKit/Source/core/rendering/compositing/CompositingPropertyUpdater.cpp \
 	third_party/WebKit/Source/core/rendering/compositing/CompositingReasonFinder.cpp \
 	third_party/WebKit/Source/core/rendering/compositing/CompositingRequirementsUpdater.cpp \
@@ -206,7 +205,6 @@
 	-pipe \
 	-fPIC \
 	-fno-tree-sra \
-	-fuse-ld=gold \
 	-Wno-psabi \
 	-ffunction-sections \
 	-funwind-tables \
@@ -250,8 +248,9 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DWTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1' \
+	'-DENABLE_WEB_AUDIO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
@@ -264,11 +263,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -306,6 +300,7 @@
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
+	$(LOCAL_PATH)/third_party/openmax_dl \
 	$(LOCAL_PATH)/third_party/angle/include \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
@@ -364,7 +359,6 @@
 	-pipe \
 	-fPIC \
 	-fno-tree-sra \
-	-fuse-ld=gold \
 	-Wno-psabi \
 	-ffunction-sections \
 	-funwind-tables \
@@ -408,8 +402,9 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DWTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1' \
+	'-DENABLE_WEB_AUDIO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
@@ -422,11 +417,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -465,6 +455,7 @@
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
+	$(LOCAL_PATH)/third_party/openmax_dl \
 	$(LOCAL_PATH)/third_party/angle/include \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
diff --git a/Source/core/webcore_rendering.target.darwin-arm64.mk b/Source/core/webcore_rendering.target.darwin-arm64.mk
index 70b6937..887f0c0 100644
--- a/Source/core/webcore_rendering.target.darwin-arm64.mk
+++ b/Source/core/webcore_rendering.target.darwin-arm64.mk
@@ -75,7 +75,6 @@
 	third_party/WebKit/Source/core/rendering/RenderImageResource.cpp \
 	third_party/WebKit/Source/core/rendering/RenderImageResourceStyleImage.cpp \
 	third_party/WebKit/Source/core/rendering/RenderInline.cpp \
-	third_party/WebKit/Source/core/rendering/RenderInputSpeech.cpp \
 	third_party/WebKit/Source/core/rendering/RenderLayer.cpp \
 	third_party/WebKit/Source/core/rendering/RenderLayerBlendInfo.cpp \
 	third_party/WebKit/Source/core/rendering/RenderLayerClipper.cpp \
@@ -104,7 +103,6 @@
 	third_party/WebKit/Source/core/rendering/RenderProgress.cpp \
 	third_party/WebKit/Source/core/rendering/RenderQuote.cpp \
 	third_party/WebKit/Source/core/rendering/RenderRegion.cpp \
-	third_party/WebKit/Source/core/rendering/RenderRegionSet.cpp \
 	third_party/WebKit/Source/core/rendering/RenderReplaced.cpp \
 	third_party/WebKit/Source/core/rendering/RenderReplica.cpp \
 	third_party/WebKit/Source/core/rendering/RenderRuby.cpp \
@@ -145,6 +143,7 @@
 	third_party/WebKit/Source/core/rendering/TextAutosizer.cpp \
 	third_party/WebKit/Source/core/rendering/break_lines.cpp \
 	third_party/WebKit/Source/core/rendering/compositing/CompositedLayerMapping.cpp \
+	third_party/WebKit/Source/core/rendering/compositing/CompositingLayerAssigner.cpp \
 	third_party/WebKit/Source/core/rendering/compositing/CompositingPropertyUpdater.cpp \
 	third_party/WebKit/Source/core/rendering/compositing/CompositingReasonFinder.cpp \
 	third_party/WebKit/Source/core/rendering/compositing/CompositingRequirementsUpdater.cpp \
@@ -246,7 +245,6 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -260,11 +258,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -399,7 +392,6 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -413,11 +405,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
diff --git a/Source/core/webcore_rendering.target.darwin-mips.mk b/Source/core/webcore_rendering.target.darwin-mips.mk
index e8e9a2c..8071d89 100644
--- a/Source/core/webcore_rendering.target.darwin-mips.mk
+++ b/Source/core/webcore_rendering.target.darwin-mips.mk
@@ -75,7 +75,6 @@
 	third_party/WebKit/Source/core/rendering/RenderImageResource.cpp \
 	third_party/WebKit/Source/core/rendering/RenderImageResourceStyleImage.cpp \
 	third_party/WebKit/Source/core/rendering/RenderInline.cpp \
-	third_party/WebKit/Source/core/rendering/RenderInputSpeech.cpp \
 	third_party/WebKit/Source/core/rendering/RenderLayer.cpp \
 	third_party/WebKit/Source/core/rendering/RenderLayerBlendInfo.cpp \
 	third_party/WebKit/Source/core/rendering/RenderLayerClipper.cpp \
@@ -104,7 +103,6 @@
 	third_party/WebKit/Source/core/rendering/RenderProgress.cpp \
 	third_party/WebKit/Source/core/rendering/RenderQuote.cpp \
 	third_party/WebKit/Source/core/rendering/RenderRegion.cpp \
-	third_party/WebKit/Source/core/rendering/RenderRegionSet.cpp \
 	third_party/WebKit/Source/core/rendering/RenderReplaced.cpp \
 	third_party/WebKit/Source/core/rendering/RenderReplica.cpp \
 	third_party/WebKit/Source/core/rendering/RenderRuby.cpp \
@@ -145,6 +143,7 @@
 	third_party/WebKit/Source/core/rendering/TextAutosizer.cpp \
 	third_party/WebKit/Source/core/rendering/break_lines.cpp \
 	third_party/WebKit/Source/core/rendering/compositing/CompositedLayerMapping.cpp \
+	third_party/WebKit/Source/core/rendering/compositing/CompositingLayerAssigner.cpp \
 	third_party/WebKit/Source/core/rendering/compositing/CompositingPropertyUpdater.cpp \
 	third_party/WebKit/Source/core/rendering/compositing/CompositingReasonFinder.cpp \
 	third_party/WebKit/Source/core/rendering/compositing/CompositingRequirementsUpdater.cpp \
@@ -249,7 +248,6 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -263,11 +261,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -406,7 +399,6 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -420,11 +412,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
diff --git a/Source/core/webcore_rendering.target.darwin-x86.mk b/Source/core/webcore_rendering.target.darwin-x86.mk
index 257e614..87ea78a 100644
--- a/Source/core/webcore_rendering.target.darwin-x86.mk
+++ b/Source/core/webcore_rendering.target.darwin-x86.mk
@@ -75,7 +75,6 @@
 	third_party/WebKit/Source/core/rendering/RenderImageResource.cpp \
 	third_party/WebKit/Source/core/rendering/RenderImageResourceStyleImage.cpp \
 	third_party/WebKit/Source/core/rendering/RenderInline.cpp \
-	third_party/WebKit/Source/core/rendering/RenderInputSpeech.cpp \
 	third_party/WebKit/Source/core/rendering/RenderLayer.cpp \
 	third_party/WebKit/Source/core/rendering/RenderLayerBlendInfo.cpp \
 	third_party/WebKit/Source/core/rendering/RenderLayerClipper.cpp \
@@ -104,7 +103,6 @@
 	third_party/WebKit/Source/core/rendering/RenderProgress.cpp \
 	third_party/WebKit/Source/core/rendering/RenderQuote.cpp \
 	third_party/WebKit/Source/core/rendering/RenderRegion.cpp \
-	third_party/WebKit/Source/core/rendering/RenderRegionSet.cpp \
 	third_party/WebKit/Source/core/rendering/RenderReplaced.cpp \
 	third_party/WebKit/Source/core/rendering/RenderReplica.cpp \
 	third_party/WebKit/Source/core/rendering/RenderRuby.cpp \
@@ -145,6 +143,7 @@
 	third_party/WebKit/Source/core/rendering/TextAutosizer.cpp \
 	third_party/WebKit/Source/core/rendering/break_lines.cpp \
 	third_party/WebKit/Source/core/rendering/compositing/CompositedLayerMapping.cpp \
+	third_party/WebKit/Source/core/rendering/compositing/CompositingLayerAssigner.cpp \
 	third_party/WebKit/Source/core/rendering/compositing/CompositingPropertyUpdater.cpp \
 	third_party/WebKit/Source/core/rendering/compositing/CompositingReasonFinder.cpp \
 	third_party/WebKit/Source/core/rendering/compositing/CompositingRequirementsUpdater.cpp \
@@ -209,7 +208,6 @@
 	-mfpmath=sse \
 	-mmmx \
 	-m32 \
-	-fuse-ld=gold \
 	-ffunction-sections \
 	-funwind-tables \
 	-g \
@@ -252,8 +250,9 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DWTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1' \
+	'-DENABLE_WEB_AUDIO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
@@ -266,11 +265,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -308,6 +302,7 @@
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
+	$(LOCAL_PATH)/third_party/openmax_dl \
 	$(LOCAL_PATH)/third_party/angle/include \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
@@ -368,7 +363,6 @@
 	-mfpmath=sse \
 	-mmmx \
 	-m32 \
-	-fuse-ld=gold \
 	-ffunction-sections \
 	-funwind-tables \
 	-g \
@@ -411,8 +405,9 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DWTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1' \
+	'-DENABLE_WEB_AUDIO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
@@ -425,11 +420,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -468,6 +458,7 @@
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
+	$(LOCAL_PATH)/third_party/openmax_dl \
 	$(LOCAL_PATH)/third_party/angle/include \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
diff --git a/Source/core/webcore_rendering.target.darwin-x86_64.mk b/Source/core/webcore_rendering.target.darwin-x86_64.mk
index 2a9b639..0539e7b 100644
--- a/Source/core/webcore_rendering.target.darwin-x86_64.mk
+++ b/Source/core/webcore_rendering.target.darwin-x86_64.mk
@@ -75,7 +75,6 @@
 	third_party/WebKit/Source/core/rendering/RenderImageResource.cpp \
 	third_party/WebKit/Source/core/rendering/RenderImageResourceStyleImage.cpp \
 	third_party/WebKit/Source/core/rendering/RenderInline.cpp \
-	third_party/WebKit/Source/core/rendering/RenderInputSpeech.cpp \
 	third_party/WebKit/Source/core/rendering/RenderLayer.cpp \
 	third_party/WebKit/Source/core/rendering/RenderLayerBlendInfo.cpp \
 	third_party/WebKit/Source/core/rendering/RenderLayerClipper.cpp \
@@ -104,7 +103,6 @@
 	third_party/WebKit/Source/core/rendering/RenderProgress.cpp \
 	third_party/WebKit/Source/core/rendering/RenderQuote.cpp \
 	third_party/WebKit/Source/core/rendering/RenderRegion.cpp \
-	third_party/WebKit/Source/core/rendering/RenderRegionSet.cpp \
 	third_party/WebKit/Source/core/rendering/RenderReplaced.cpp \
 	third_party/WebKit/Source/core/rendering/RenderReplica.cpp \
 	third_party/WebKit/Source/core/rendering/RenderRuby.cpp \
@@ -145,6 +143,7 @@
 	third_party/WebKit/Source/core/rendering/TextAutosizer.cpp \
 	third_party/WebKit/Source/core/rendering/break_lines.cpp \
 	third_party/WebKit/Source/core/rendering/compositing/CompositedLayerMapping.cpp \
+	third_party/WebKit/Source/core/rendering/compositing/CompositingLayerAssigner.cpp \
 	third_party/WebKit/Source/core/rendering/compositing/CompositingPropertyUpdater.cpp \
 	third_party/WebKit/Source/core/rendering/compositing/CompositingReasonFinder.cpp \
 	third_party/WebKit/Source/core/rendering/compositing/CompositingRequirementsUpdater.cpp \
@@ -208,7 +207,6 @@
 	-Wno-unused-local-typedefs \
 	-m64 \
 	-march=x86-64 \
-	-fuse-ld=gold \
 	-ffunction-sections \
 	-funwind-tables \
 	-g \
@@ -251,8 +249,9 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DWTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1' \
+	'-DENABLE_WEB_AUDIO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
@@ -265,11 +264,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -307,6 +301,7 @@
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
+	$(LOCAL_PATH)/third_party/openmax_dl \
 	$(LOCAL_PATH)/third_party/angle/include \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
@@ -366,7 +361,6 @@
 	-Wno-unused-local-typedefs \
 	-m64 \
 	-march=x86-64 \
-	-fuse-ld=gold \
 	-ffunction-sections \
 	-funwind-tables \
 	-g \
@@ -409,8 +403,9 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DWTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1' \
+	'-DENABLE_WEB_AUDIO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
@@ -423,11 +418,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -466,6 +456,7 @@
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
+	$(LOCAL_PATH)/third_party/openmax_dl \
 	$(LOCAL_PATH)/third_party/angle/include \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
diff --git a/Source/core/webcore_rendering.target.linux-arm.mk b/Source/core/webcore_rendering.target.linux-arm.mk
index 8127f6c..4005608 100644
--- a/Source/core/webcore_rendering.target.linux-arm.mk
+++ b/Source/core/webcore_rendering.target.linux-arm.mk
@@ -75,7 +75,6 @@
 	third_party/WebKit/Source/core/rendering/RenderImageResource.cpp \
 	third_party/WebKit/Source/core/rendering/RenderImageResourceStyleImage.cpp \
 	third_party/WebKit/Source/core/rendering/RenderInline.cpp \
-	third_party/WebKit/Source/core/rendering/RenderInputSpeech.cpp \
 	third_party/WebKit/Source/core/rendering/RenderLayer.cpp \
 	third_party/WebKit/Source/core/rendering/RenderLayerBlendInfo.cpp \
 	third_party/WebKit/Source/core/rendering/RenderLayerClipper.cpp \
@@ -104,7 +103,6 @@
 	third_party/WebKit/Source/core/rendering/RenderProgress.cpp \
 	third_party/WebKit/Source/core/rendering/RenderQuote.cpp \
 	third_party/WebKit/Source/core/rendering/RenderRegion.cpp \
-	third_party/WebKit/Source/core/rendering/RenderRegionSet.cpp \
 	third_party/WebKit/Source/core/rendering/RenderReplaced.cpp \
 	third_party/WebKit/Source/core/rendering/RenderReplica.cpp \
 	third_party/WebKit/Source/core/rendering/RenderRuby.cpp \
@@ -145,6 +143,7 @@
 	third_party/WebKit/Source/core/rendering/TextAutosizer.cpp \
 	third_party/WebKit/Source/core/rendering/break_lines.cpp \
 	third_party/WebKit/Source/core/rendering/compositing/CompositedLayerMapping.cpp \
+	third_party/WebKit/Source/core/rendering/compositing/CompositingLayerAssigner.cpp \
 	third_party/WebKit/Source/core/rendering/compositing/CompositingPropertyUpdater.cpp \
 	third_party/WebKit/Source/core/rendering/compositing/CompositingReasonFinder.cpp \
 	third_party/WebKit/Source/core/rendering/compositing/CompositingRequirementsUpdater.cpp \
@@ -206,7 +205,6 @@
 	-pipe \
 	-fPIC \
 	-fno-tree-sra \
-	-fuse-ld=gold \
 	-Wno-psabi \
 	-ffunction-sections \
 	-funwind-tables \
@@ -250,8 +248,9 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DWTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1' \
+	'-DENABLE_WEB_AUDIO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
@@ -264,11 +263,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -306,6 +300,7 @@
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
+	$(LOCAL_PATH)/third_party/openmax_dl \
 	$(LOCAL_PATH)/third_party/angle/include \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
@@ -364,7 +359,6 @@
 	-pipe \
 	-fPIC \
 	-fno-tree-sra \
-	-fuse-ld=gold \
 	-Wno-psabi \
 	-ffunction-sections \
 	-funwind-tables \
@@ -408,8 +402,9 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DWTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1' \
+	'-DENABLE_WEB_AUDIO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
@@ -422,11 +417,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -465,6 +455,7 @@
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
+	$(LOCAL_PATH)/third_party/openmax_dl \
 	$(LOCAL_PATH)/third_party/angle/include \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
diff --git a/Source/core/webcore_rendering.target.linux-arm64.mk b/Source/core/webcore_rendering.target.linux-arm64.mk
index 70b6937..887f0c0 100644
--- a/Source/core/webcore_rendering.target.linux-arm64.mk
+++ b/Source/core/webcore_rendering.target.linux-arm64.mk
@@ -75,7 +75,6 @@
 	third_party/WebKit/Source/core/rendering/RenderImageResource.cpp \
 	third_party/WebKit/Source/core/rendering/RenderImageResourceStyleImage.cpp \
 	third_party/WebKit/Source/core/rendering/RenderInline.cpp \
-	third_party/WebKit/Source/core/rendering/RenderInputSpeech.cpp \
 	third_party/WebKit/Source/core/rendering/RenderLayer.cpp \
 	third_party/WebKit/Source/core/rendering/RenderLayerBlendInfo.cpp \
 	third_party/WebKit/Source/core/rendering/RenderLayerClipper.cpp \
@@ -104,7 +103,6 @@
 	third_party/WebKit/Source/core/rendering/RenderProgress.cpp \
 	third_party/WebKit/Source/core/rendering/RenderQuote.cpp \
 	third_party/WebKit/Source/core/rendering/RenderRegion.cpp \
-	third_party/WebKit/Source/core/rendering/RenderRegionSet.cpp \
 	third_party/WebKit/Source/core/rendering/RenderReplaced.cpp \
 	third_party/WebKit/Source/core/rendering/RenderReplica.cpp \
 	third_party/WebKit/Source/core/rendering/RenderRuby.cpp \
@@ -145,6 +143,7 @@
 	third_party/WebKit/Source/core/rendering/TextAutosizer.cpp \
 	third_party/WebKit/Source/core/rendering/break_lines.cpp \
 	third_party/WebKit/Source/core/rendering/compositing/CompositedLayerMapping.cpp \
+	third_party/WebKit/Source/core/rendering/compositing/CompositingLayerAssigner.cpp \
 	third_party/WebKit/Source/core/rendering/compositing/CompositingPropertyUpdater.cpp \
 	third_party/WebKit/Source/core/rendering/compositing/CompositingReasonFinder.cpp \
 	third_party/WebKit/Source/core/rendering/compositing/CompositingRequirementsUpdater.cpp \
@@ -246,7 +245,6 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -260,11 +258,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -399,7 +392,6 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -413,11 +405,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
diff --git a/Source/core/webcore_rendering.target.linux-mips.mk b/Source/core/webcore_rendering.target.linux-mips.mk
index e8e9a2c..8071d89 100644
--- a/Source/core/webcore_rendering.target.linux-mips.mk
+++ b/Source/core/webcore_rendering.target.linux-mips.mk
@@ -75,7 +75,6 @@
 	third_party/WebKit/Source/core/rendering/RenderImageResource.cpp \
 	third_party/WebKit/Source/core/rendering/RenderImageResourceStyleImage.cpp \
 	third_party/WebKit/Source/core/rendering/RenderInline.cpp \
-	third_party/WebKit/Source/core/rendering/RenderInputSpeech.cpp \
 	third_party/WebKit/Source/core/rendering/RenderLayer.cpp \
 	third_party/WebKit/Source/core/rendering/RenderLayerBlendInfo.cpp \
 	third_party/WebKit/Source/core/rendering/RenderLayerClipper.cpp \
@@ -104,7 +103,6 @@
 	third_party/WebKit/Source/core/rendering/RenderProgress.cpp \
 	third_party/WebKit/Source/core/rendering/RenderQuote.cpp \
 	third_party/WebKit/Source/core/rendering/RenderRegion.cpp \
-	third_party/WebKit/Source/core/rendering/RenderRegionSet.cpp \
 	third_party/WebKit/Source/core/rendering/RenderReplaced.cpp \
 	third_party/WebKit/Source/core/rendering/RenderReplica.cpp \
 	third_party/WebKit/Source/core/rendering/RenderRuby.cpp \
@@ -145,6 +143,7 @@
 	third_party/WebKit/Source/core/rendering/TextAutosizer.cpp \
 	third_party/WebKit/Source/core/rendering/break_lines.cpp \
 	third_party/WebKit/Source/core/rendering/compositing/CompositedLayerMapping.cpp \
+	third_party/WebKit/Source/core/rendering/compositing/CompositingLayerAssigner.cpp \
 	third_party/WebKit/Source/core/rendering/compositing/CompositingPropertyUpdater.cpp \
 	third_party/WebKit/Source/core/rendering/compositing/CompositingReasonFinder.cpp \
 	third_party/WebKit/Source/core/rendering/compositing/CompositingRequirementsUpdater.cpp \
@@ -249,7 +248,6 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -263,11 +261,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -406,7 +399,6 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -420,11 +412,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
diff --git a/Source/core/webcore_rendering.target.linux-x86.mk b/Source/core/webcore_rendering.target.linux-x86.mk
index 257e614..87ea78a 100644
--- a/Source/core/webcore_rendering.target.linux-x86.mk
+++ b/Source/core/webcore_rendering.target.linux-x86.mk
@@ -75,7 +75,6 @@
 	third_party/WebKit/Source/core/rendering/RenderImageResource.cpp \
 	third_party/WebKit/Source/core/rendering/RenderImageResourceStyleImage.cpp \
 	third_party/WebKit/Source/core/rendering/RenderInline.cpp \
-	third_party/WebKit/Source/core/rendering/RenderInputSpeech.cpp \
 	third_party/WebKit/Source/core/rendering/RenderLayer.cpp \
 	third_party/WebKit/Source/core/rendering/RenderLayerBlendInfo.cpp \
 	third_party/WebKit/Source/core/rendering/RenderLayerClipper.cpp \
@@ -104,7 +103,6 @@
 	third_party/WebKit/Source/core/rendering/RenderProgress.cpp \
 	third_party/WebKit/Source/core/rendering/RenderQuote.cpp \
 	third_party/WebKit/Source/core/rendering/RenderRegion.cpp \
-	third_party/WebKit/Source/core/rendering/RenderRegionSet.cpp \
 	third_party/WebKit/Source/core/rendering/RenderReplaced.cpp \
 	third_party/WebKit/Source/core/rendering/RenderReplica.cpp \
 	third_party/WebKit/Source/core/rendering/RenderRuby.cpp \
@@ -145,6 +143,7 @@
 	third_party/WebKit/Source/core/rendering/TextAutosizer.cpp \
 	third_party/WebKit/Source/core/rendering/break_lines.cpp \
 	third_party/WebKit/Source/core/rendering/compositing/CompositedLayerMapping.cpp \
+	third_party/WebKit/Source/core/rendering/compositing/CompositingLayerAssigner.cpp \
 	third_party/WebKit/Source/core/rendering/compositing/CompositingPropertyUpdater.cpp \
 	third_party/WebKit/Source/core/rendering/compositing/CompositingReasonFinder.cpp \
 	third_party/WebKit/Source/core/rendering/compositing/CompositingRequirementsUpdater.cpp \
@@ -209,7 +208,6 @@
 	-mfpmath=sse \
 	-mmmx \
 	-m32 \
-	-fuse-ld=gold \
 	-ffunction-sections \
 	-funwind-tables \
 	-g \
@@ -252,8 +250,9 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DWTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1' \
+	'-DENABLE_WEB_AUDIO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
@@ -266,11 +265,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -308,6 +302,7 @@
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
+	$(LOCAL_PATH)/third_party/openmax_dl \
 	$(LOCAL_PATH)/third_party/angle/include \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
@@ -368,7 +363,6 @@
 	-mfpmath=sse \
 	-mmmx \
 	-m32 \
-	-fuse-ld=gold \
 	-ffunction-sections \
 	-funwind-tables \
 	-g \
@@ -411,8 +405,9 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DWTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1' \
+	'-DENABLE_WEB_AUDIO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
@@ -425,11 +420,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -468,6 +458,7 @@
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
+	$(LOCAL_PATH)/third_party/openmax_dl \
 	$(LOCAL_PATH)/third_party/angle/include \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
diff --git a/Source/core/webcore_rendering.target.linux-x86_64.mk b/Source/core/webcore_rendering.target.linux-x86_64.mk
index 2a9b639..0539e7b 100644
--- a/Source/core/webcore_rendering.target.linux-x86_64.mk
+++ b/Source/core/webcore_rendering.target.linux-x86_64.mk
@@ -75,7 +75,6 @@
 	third_party/WebKit/Source/core/rendering/RenderImageResource.cpp \
 	third_party/WebKit/Source/core/rendering/RenderImageResourceStyleImage.cpp \
 	third_party/WebKit/Source/core/rendering/RenderInline.cpp \
-	third_party/WebKit/Source/core/rendering/RenderInputSpeech.cpp \
 	third_party/WebKit/Source/core/rendering/RenderLayer.cpp \
 	third_party/WebKit/Source/core/rendering/RenderLayerBlendInfo.cpp \
 	third_party/WebKit/Source/core/rendering/RenderLayerClipper.cpp \
@@ -104,7 +103,6 @@
 	third_party/WebKit/Source/core/rendering/RenderProgress.cpp \
 	third_party/WebKit/Source/core/rendering/RenderQuote.cpp \
 	third_party/WebKit/Source/core/rendering/RenderRegion.cpp \
-	third_party/WebKit/Source/core/rendering/RenderRegionSet.cpp \
 	third_party/WebKit/Source/core/rendering/RenderReplaced.cpp \
 	third_party/WebKit/Source/core/rendering/RenderReplica.cpp \
 	third_party/WebKit/Source/core/rendering/RenderRuby.cpp \
@@ -145,6 +143,7 @@
 	third_party/WebKit/Source/core/rendering/TextAutosizer.cpp \
 	third_party/WebKit/Source/core/rendering/break_lines.cpp \
 	third_party/WebKit/Source/core/rendering/compositing/CompositedLayerMapping.cpp \
+	third_party/WebKit/Source/core/rendering/compositing/CompositingLayerAssigner.cpp \
 	third_party/WebKit/Source/core/rendering/compositing/CompositingPropertyUpdater.cpp \
 	third_party/WebKit/Source/core/rendering/compositing/CompositingReasonFinder.cpp \
 	third_party/WebKit/Source/core/rendering/compositing/CompositingRequirementsUpdater.cpp \
@@ -208,7 +207,6 @@
 	-Wno-unused-local-typedefs \
 	-m64 \
 	-march=x86-64 \
-	-fuse-ld=gold \
 	-ffunction-sections \
 	-funwind-tables \
 	-g \
@@ -251,8 +249,9 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DWTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1' \
+	'-DENABLE_WEB_AUDIO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
@@ -265,11 +264,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -307,6 +301,7 @@
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
+	$(LOCAL_PATH)/third_party/openmax_dl \
 	$(LOCAL_PATH)/third_party/angle/include \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
@@ -366,7 +361,6 @@
 	-Wno-unused-local-typedefs \
 	-m64 \
 	-march=x86-64 \
-	-fuse-ld=gold \
 	-ffunction-sections \
 	-funwind-tables \
 	-g \
@@ -409,8 +403,9 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DWTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1' \
+	'-DENABLE_WEB_AUDIO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
@@ -423,11 +418,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -466,6 +456,7 @@
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
+	$(LOCAL_PATH)/third_party/openmax_dl \
 	$(LOCAL_PATH)/third_party/angle/include \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
diff --git a/Source/core/webcore_svg.target.darwin-arm.mk b/Source/core/webcore_svg.target.darwin-arm.mk
index 1929b6c..0e2a414 100644
--- a/Source/core/webcore_svg.target.darwin-arm.mk
+++ b/Source/core/webcore_svg.target.darwin-arm.mk
@@ -109,7 +109,6 @@
 	third_party/WebKit/Source/core/svg/SVGDefsElement.cpp \
 	third_party/WebKit/Source/core/svg/SVGDescElement.cpp \
 	third_party/WebKit/Source/core/svg/SVGDiscardElement.cpp \
-	third_party/WebKit/Source/core/svg/SVGDocument.cpp \
 	third_party/WebKit/Source/core/svg/SVGDocumentExtensions.cpp \
 	third_party/WebKit/Source/core/svg/SVGElement.cpp \
 	third_party/WebKit/Source/core/svg/SVGElementInstance.cpp \
@@ -270,7 +269,6 @@
 	-pipe \
 	-fPIC \
 	-fno-tree-sra \
-	-fuse-ld=gold \
 	-Wno-psabi \
 	-ffunction-sections \
 	-funwind-tables \
@@ -314,8 +312,9 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DWTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1' \
+	'-DENABLE_WEB_AUDIO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
@@ -328,11 +327,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -370,6 +364,7 @@
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
+	$(LOCAL_PATH)/third_party/openmax_dl \
 	$(LOCAL_PATH)/third_party/angle/include \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
@@ -428,7 +423,6 @@
 	-pipe \
 	-fPIC \
 	-fno-tree-sra \
-	-fuse-ld=gold \
 	-Wno-psabi \
 	-ffunction-sections \
 	-funwind-tables \
@@ -472,8 +466,9 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DWTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1' \
+	'-DENABLE_WEB_AUDIO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
@@ -486,11 +481,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -529,6 +519,7 @@
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
+	$(LOCAL_PATH)/third_party/openmax_dl \
 	$(LOCAL_PATH)/third_party/angle/include \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
diff --git a/Source/core/webcore_svg.target.darwin-arm64.mk b/Source/core/webcore_svg.target.darwin-arm64.mk
index 9cc0509..b63847b 100644
--- a/Source/core/webcore_svg.target.darwin-arm64.mk
+++ b/Source/core/webcore_svg.target.darwin-arm64.mk
@@ -109,7 +109,6 @@
 	third_party/WebKit/Source/core/svg/SVGDefsElement.cpp \
 	third_party/WebKit/Source/core/svg/SVGDescElement.cpp \
 	third_party/WebKit/Source/core/svg/SVGDiscardElement.cpp \
-	third_party/WebKit/Source/core/svg/SVGDocument.cpp \
 	third_party/WebKit/Source/core/svg/SVGDocumentExtensions.cpp \
 	third_party/WebKit/Source/core/svg/SVGElement.cpp \
 	third_party/WebKit/Source/core/svg/SVGElementInstance.cpp \
@@ -310,7 +309,6 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -324,11 +322,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -463,7 +456,6 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -477,11 +469,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
diff --git a/Source/core/webcore_svg.target.darwin-mips.mk b/Source/core/webcore_svg.target.darwin-mips.mk
index eb56231..e5917a0 100644
--- a/Source/core/webcore_svg.target.darwin-mips.mk
+++ b/Source/core/webcore_svg.target.darwin-mips.mk
@@ -109,7 +109,6 @@
 	third_party/WebKit/Source/core/svg/SVGDefsElement.cpp \
 	third_party/WebKit/Source/core/svg/SVGDescElement.cpp \
 	third_party/WebKit/Source/core/svg/SVGDiscardElement.cpp \
-	third_party/WebKit/Source/core/svg/SVGDocument.cpp \
 	third_party/WebKit/Source/core/svg/SVGDocumentExtensions.cpp \
 	third_party/WebKit/Source/core/svg/SVGElement.cpp \
 	third_party/WebKit/Source/core/svg/SVGElementInstance.cpp \
@@ -313,7 +312,6 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -327,11 +325,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -470,7 +463,6 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -484,11 +476,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
diff --git a/Source/core/webcore_svg.target.darwin-x86.mk b/Source/core/webcore_svg.target.darwin-x86.mk
index 9fb31c9..8fc3d45 100644
--- a/Source/core/webcore_svg.target.darwin-x86.mk
+++ b/Source/core/webcore_svg.target.darwin-x86.mk
@@ -109,7 +109,6 @@
 	third_party/WebKit/Source/core/svg/SVGDefsElement.cpp \
 	third_party/WebKit/Source/core/svg/SVGDescElement.cpp \
 	third_party/WebKit/Source/core/svg/SVGDiscardElement.cpp \
-	third_party/WebKit/Source/core/svg/SVGDocument.cpp \
 	third_party/WebKit/Source/core/svg/SVGDocumentExtensions.cpp \
 	third_party/WebKit/Source/core/svg/SVGElement.cpp \
 	third_party/WebKit/Source/core/svg/SVGElementInstance.cpp \
@@ -272,7 +271,6 @@
 	-mfpmath=sse \
 	-mmmx \
 	-m32 \
-	-fuse-ld=gold \
 	-ffunction-sections \
 	-funwind-tables \
 	-g \
@@ -315,8 +313,9 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DWTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1' \
+	'-DENABLE_WEB_AUDIO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
@@ -329,11 +328,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -371,6 +365,7 @@
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
+	$(LOCAL_PATH)/third_party/openmax_dl \
 	$(LOCAL_PATH)/third_party/angle/include \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
@@ -430,7 +425,6 @@
 	-mfpmath=sse \
 	-mmmx \
 	-m32 \
-	-fuse-ld=gold \
 	-ffunction-sections \
 	-funwind-tables \
 	-g \
@@ -473,8 +467,9 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DWTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1' \
+	'-DENABLE_WEB_AUDIO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
@@ -487,11 +482,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -530,6 +520,7 @@
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
+	$(LOCAL_PATH)/third_party/openmax_dl \
 	$(LOCAL_PATH)/third_party/angle/include \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
diff --git a/Source/core/webcore_svg.target.darwin-x86_64.mk b/Source/core/webcore_svg.target.darwin-x86_64.mk
index e7e4263..f2c1200 100644
--- a/Source/core/webcore_svg.target.darwin-x86_64.mk
+++ b/Source/core/webcore_svg.target.darwin-x86_64.mk
@@ -109,7 +109,6 @@
 	third_party/WebKit/Source/core/svg/SVGDefsElement.cpp \
 	third_party/WebKit/Source/core/svg/SVGDescElement.cpp \
 	third_party/WebKit/Source/core/svg/SVGDiscardElement.cpp \
-	third_party/WebKit/Source/core/svg/SVGDocument.cpp \
 	third_party/WebKit/Source/core/svg/SVGDocumentExtensions.cpp \
 	third_party/WebKit/Source/core/svg/SVGElement.cpp \
 	third_party/WebKit/Source/core/svg/SVGElementInstance.cpp \
@@ -272,7 +271,6 @@
 	-Wno-unused-local-typedefs \
 	-m64 \
 	-march=x86-64 \
-	-fuse-ld=gold \
 	-ffunction-sections \
 	-funwind-tables \
 	-g \
@@ -315,8 +313,9 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DWTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1' \
+	'-DENABLE_WEB_AUDIO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
@@ -329,11 +328,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -371,6 +365,7 @@
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
+	$(LOCAL_PATH)/third_party/openmax_dl \
 	$(LOCAL_PATH)/third_party/angle/include \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
@@ -430,7 +425,6 @@
 	-Wno-unused-local-typedefs \
 	-m64 \
 	-march=x86-64 \
-	-fuse-ld=gold \
 	-ffunction-sections \
 	-funwind-tables \
 	-g \
@@ -473,8 +467,9 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DWTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1' \
+	'-DENABLE_WEB_AUDIO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
@@ -487,11 +482,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -530,6 +520,7 @@
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
+	$(LOCAL_PATH)/third_party/openmax_dl \
 	$(LOCAL_PATH)/third_party/angle/include \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
diff --git a/Source/core/webcore_svg.target.linux-arm.mk b/Source/core/webcore_svg.target.linux-arm.mk
index 1929b6c..0e2a414 100644
--- a/Source/core/webcore_svg.target.linux-arm.mk
+++ b/Source/core/webcore_svg.target.linux-arm.mk
@@ -109,7 +109,6 @@
 	third_party/WebKit/Source/core/svg/SVGDefsElement.cpp \
 	third_party/WebKit/Source/core/svg/SVGDescElement.cpp \
 	third_party/WebKit/Source/core/svg/SVGDiscardElement.cpp \
-	third_party/WebKit/Source/core/svg/SVGDocument.cpp \
 	third_party/WebKit/Source/core/svg/SVGDocumentExtensions.cpp \
 	third_party/WebKit/Source/core/svg/SVGElement.cpp \
 	third_party/WebKit/Source/core/svg/SVGElementInstance.cpp \
@@ -270,7 +269,6 @@
 	-pipe \
 	-fPIC \
 	-fno-tree-sra \
-	-fuse-ld=gold \
 	-Wno-psabi \
 	-ffunction-sections \
 	-funwind-tables \
@@ -314,8 +312,9 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DWTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1' \
+	'-DENABLE_WEB_AUDIO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
@@ -328,11 +327,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -370,6 +364,7 @@
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
+	$(LOCAL_PATH)/third_party/openmax_dl \
 	$(LOCAL_PATH)/third_party/angle/include \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
@@ -428,7 +423,6 @@
 	-pipe \
 	-fPIC \
 	-fno-tree-sra \
-	-fuse-ld=gold \
 	-Wno-psabi \
 	-ffunction-sections \
 	-funwind-tables \
@@ -472,8 +466,9 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DWTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1' \
+	'-DENABLE_WEB_AUDIO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
@@ -486,11 +481,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -529,6 +519,7 @@
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
+	$(LOCAL_PATH)/third_party/openmax_dl \
 	$(LOCAL_PATH)/third_party/angle/include \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
diff --git a/Source/core/webcore_svg.target.linux-arm64.mk b/Source/core/webcore_svg.target.linux-arm64.mk
index 9cc0509..b63847b 100644
--- a/Source/core/webcore_svg.target.linux-arm64.mk
+++ b/Source/core/webcore_svg.target.linux-arm64.mk
@@ -109,7 +109,6 @@
 	third_party/WebKit/Source/core/svg/SVGDefsElement.cpp \
 	third_party/WebKit/Source/core/svg/SVGDescElement.cpp \
 	third_party/WebKit/Source/core/svg/SVGDiscardElement.cpp \
-	third_party/WebKit/Source/core/svg/SVGDocument.cpp \
 	third_party/WebKit/Source/core/svg/SVGDocumentExtensions.cpp \
 	third_party/WebKit/Source/core/svg/SVGElement.cpp \
 	third_party/WebKit/Source/core/svg/SVGElementInstance.cpp \
@@ -310,7 +309,6 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -324,11 +322,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -463,7 +456,6 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -477,11 +469,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
diff --git a/Source/core/webcore_svg.target.linux-mips.mk b/Source/core/webcore_svg.target.linux-mips.mk
index eb56231..e5917a0 100644
--- a/Source/core/webcore_svg.target.linux-mips.mk
+++ b/Source/core/webcore_svg.target.linux-mips.mk
@@ -109,7 +109,6 @@
 	third_party/WebKit/Source/core/svg/SVGDefsElement.cpp \
 	third_party/WebKit/Source/core/svg/SVGDescElement.cpp \
 	third_party/WebKit/Source/core/svg/SVGDiscardElement.cpp \
-	third_party/WebKit/Source/core/svg/SVGDocument.cpp \
 	third_party/WebKit/Source/core/svg/SVGDocumentExtensions.cpp \
 	third_party/WebKit/Source/core/svg/SVGElement.cpp \
 	third_party/WebKit/Source/core/svg/SVGElementInstance.cpp \
@@ -313,7 +312,6 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -327,11 +325,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -470,7 +463,6 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
@@ -484,11 +476,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
diff --git a/Source/core/webcore_svg.target.linux-x86.mk b/Source/core/webcore_svg.target.linux-x86.mk
index 9fb31c9..8fc3d45 100644
--- a/Source/core/webcore_svg.target.linux-x86.mk
+++ b/Source/core/webcore_svg.target.linux-x86.mk
@@ -109,7 +109,6 @@
 	third_party/WebKit/Source/core/svg/SVGDefsElement.cpp \
 	third_party/WebKit/Source/core/svg/SVGDescElement.cpp \
 	third_party/WebKit/Source/core/svg/SVGDiscardElement.cpp \
-	third_party/WebKit/Source/core/svg/SVGDocument.cpp \
 	third_party/WebKit/Source/core/svg/SVGDocumentExtensions.cpp \
 	third_party/WebKit/Source/core/svg/SVGElement.cpp \
 	third_party/WebKit/Source/core/svg/SVGElementInstance.cpp \
@@ -272,7 +271,6 @@
 	-mfpmath=sse \
 	-mmmx \
 	-m32 \
-	-fuse-ld=gold \
 	-ffunction-sections \
 	-funwind-tables \
 	-g \
@@ -315,8 +313,9 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DWTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1' \
+	'-DENABLE_WEB_AUDIO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
@@ -329,11 +328,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -371,6 +365,7 @@
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
+	$(LOCAL_PATH)/third_party/openmax_dl \
 	$(LOCAL_PATH)/third_party/angle/include \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
@@ -430,7 +425,6 @@
 	-mfpmath=sse \
 	-mmmx \
 	-m32 \
-	-fuse-ld=gold \
 	-ffunction-sections \
 	-funwind-tables \
 	-g \
@@ -473,8 +467,9 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DWTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1' \
+	'-DENABLE_WEB_AUDIO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
@@ -487,11 +482,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -530,6 +520,7 @@
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
+	$(LOCAL_PATH)/third_party/openmax_dl \
 	$(LOCAL_PATH)/third_party/angle/include \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
diff --git a/Source/core/webcore_svg.target.linux-x86_64.mk b/Source/core/webcore_svg.target.linux-x86_64.mk
index e7e4263..f2c1200 100644
--- a/Source/core/webcore_svg.target.linux-x86_64.mk
+++ b/Source/core/webcore_svg.target.linux-x86_64.mk
@@ -109,7 +109,6 @@
 	third_party/WebKit/Source/core/svg/SVGDefsElement.cpp \
 	third_party/WebKit/Source/core/svg/SVGDescElement.cpp \
 	third_party/WebKit/Source/core/svg/SVGDiscardElement.cpp \
-	third_party/WebKit/Source/core/svg/SVGDocument.cpp \
 	third_party/WebKit/Source/core/svg/SVGDocumentExtensions.cpp \
 	third_party/WebKit/Source/core/svg/SVGElement.cpp \
 	third_party/WebKit/Source/core/svg/SVGElementInstance.cpp \
@@ -272,7 +271,6 @@
 	-Wno-unused-local-typedefs \
 	-m64 \
 	-march=x86-64 \
-	-fuse-ld=gold \
 	-ffunction-sections \
 	-funwind-tables \
 	-g \
@@ -315,8 +313,9 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DWTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1' \
+	'-DENABLE_WEB_AUDIO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
@@ -329,11 +328,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -371,6 +365,7 @@
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
+	$(LOCAL_PATH)/third_party/openmax_dl \
 	$(LOCAL_PATH)/third_party/angle/include \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
@@ -430,7 +425,6 @@
 	-Wno-unused-local-typedefs \
 	-m64 \
 	-march=x86-64 \
-	-fuse-ld=gold \
 	-ffunction-sections \
 	-funwind-tables \
 	-g \
@@ -473,8 +467,9 @@
 	'-DENABLE_SVG_FONTS=1' \
 	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
 	'-DENABLE_FAST_MOBILE_SCROLLING=1' \
-	'-DENABLE_INPUT_SPEECH=0' \
 	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DWTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1' \
+	'-DENABLE_WEB_AUDIO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
@@ -487,11 +482,6 @@
 	'-DSK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS=1' \
 	'-DSK_SUPPORT_LEGACY_GETTOPDEVICE' \
 	'-DSK_SUPPORT_LEGACY_N32_NAME' \
-	'-DSK_SUPPORT_LEGACY_PROCXFERMODE' \
-	'-DSK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_HEADERS' \
-	'-DSK_SUPPORT_LEGACY_PICTURE_CAN_RECORD' \
-	'-DSK_SUPPORT_DEPRECATED_RECORD_FLAGS' \
 	'-DSK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE' \
 	'-DSK_SUPPORT_LEGACY_GETTOTALCLIP' \
 	'-DSK_BUILD_FOR_ANDROID' \
@@ -530,6 +520,7 @@
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
+	$(LOCAL_PATH)/third_party/openmax_dl \
 	$(LOCAL_PATH)/third_party/angle/include \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
diff --git a/Source/core/workers/DedicatedWorkerGlobalScope.idl b/Source/core/workers/DedicatedWorkerGlobalScope.idl
index dcc182c..8c4444d 100644
--- a/Source/core/workers/DedicatedWorkerGlobalScope.idl
+++ b/Source/core/workers/DedicatedWorkerGlobalScope.idl
@@ -29,7 +29,8 @@
  */
 
 [
-    GlobalContext=DedicatedWorkerGlobalScope
+    Exposed=DedicatedWorker,
+    Global=Worker&DedicatedWorker
 ] interface DedicatedWorkerGlobalScope : WorkerGlobalScope {
     [Custom, RaisesException] void postMessage(any message, optional MessagePort[] messagePorts);
     attribute EventHandler onmessage;
diff --git a/Source/core/workers/SharedWorkerGlobalScope.idl b/Source/core/workers/SharedWorkerGlobalScope.idl
index dcb59b8..e2a7f55 100644
--- a/Source/core/workers/SharedWorkerGlobalScope.idl
+++ b/Source/core/workers/SharedWorkerGlobalScope.idl
@@ -29,7 +29,8 @@
  */
 
 [
-    GlobalContext=SharedWorkerGlobalScope
+    Exposed=SharedWorker,
+    Global=Worker&SharedWorker
 ] interface SharedWorkerGlobalScope : WorkerGlobalScope {
     readonly attribute DOMString name;
              attribute EventHandler onconnect;
diff --git a/Source/core/workers/WorkerConsole.cpp b/Source/core/workers/WorkerConsole.cpp
index 1d77add..063b10a 100644
--- a/Source/core/workers/WorkerConsole.cpp
+++ b/Source/core/workers/WorkerConsole.cpp
@@ -65,6 +65,7 @@
 void WorkerConsole::trace(Visitor* visitor)
 {
     visitor->trace(m_scope);
+    ConsoleBase::trace(visitor);
 }
 
 // FIXME: add memory getter
diff --git a/Source/core/workers/WorkerConsole.h b/Source/core/workers/WorkerConsole.h
index 883de3d..cf61f6b 100644
--- a/Source/core/workers/WorkerConsole.h
+++ b/Source/core/workers/WorkerConsole.h
@@ -53,7 +53,7 @@
     }
     virtual ~WorkerConsole();
 
-    void trace(Visitor*);
+    virtual void trace(Visitor*) OVERRIDE;
 
 protected:
     virtual ExecutionContext* context() OVERRIDE;
diff --git a/Source/core/workers/WorkerGlobalScope.idl b/Source/core/workers/WorkerGlobalScope.idl
index 7e5dd62..ced2f23 100644
--- a/Source/core/workers/WorkerGlobalScope.idl
+++ b/Source/core/workers/WorkerGlobalScope.idl
@@ -26,7 +26,7 @@
 
 [
     Custom=ToV8,
-    GlobalContext=WorkerGlobalScope,
+    Exposed=Worker,
     WillBeGarbageCollected
 ] interface WorkerGlobalScope : EventTarget {
 
@@ -46,6 +46,5 @@
     [MeasureAs=PrefixedWorkerURL] attribute URLConstructor webkitURL; // FIXME: deprecate this.
 };
 
-WorkerGlobalScope implements ImageBitmapFactories;
 WorkerGlobalScope implements WindowBase64;
 WorkerGlobalScope implements WindowTimers;
diff --git a/Source/core/workers/WorkerLocation.idl b/Source/core/workers/WorkerLocation.idl
index b1a62e4..252f3a7 100644
--- a/Source/core/workers/WorkerLocation.idl
+++ b/Source/core/workers/WorkerLocation.idl
@@ -28,7 +28,7 @@
 
 // http://www.w3.org/TR/workers/#workerlocation
 [
-    GlobalContext=WorkerGlobalScope,
+    Exposed=Worker,
     WillBeGarbageCollected,
 ] interface WorkerLocation {
 };
diff --git a/Source/core/workers/WorkerNavigator.idl b/Source/core/workers/WorkerNavigator.idl
index 2f585bf..5c14253 100644
--- a/Source/core/workers/WorkerNavigator.idl
+++ b/Source/core/workers/WorkerNavigator.idl
@@ -29,7 +29,7 @@
 // http://www.whatwg.org/specs/web-apps/current-work/multipage/workers.html#the-workernavigator-object
 
 [
-    GlobalContext=WorkerGlobalScope,
+    Exposed=Worker,
     WillBeGarbageCollected,
 ] interface WorkerNavigator {
 };
diff --git a/Source/core/workers/WorkerReportingProxy.h b/Source/core/workers/WorkerReportingProxy.h
index ae28d3f..52f1fbe 100644
--- a/Source/core/workers/WorkerReportingProxy.h
+++ b/Source/core/workers/WorkerReportingProxy.h
@@ -55,10 +55,8 @@
     virtual void workerGlobalScopeClosed() = 0;
 
     // Invoked when the thread is stopped and WorkerGlobalScope is being
-    // destructed.
-    // FIXME: Clarify when it should be called and merge it with
-    // willDestroyWorkerGlobalScope if we decide to always run it before
-    // destruction.
+    // destructed. (This is be the last method that is called on this
+    // interface)
     virtual void workerGlobalScopeDestroyed() = 0;
 
     // Invoked when the thread is about to be stopped and WorkerGlobalScope
diff --git a/Source/core/workers/WorkerThread.cpp b/Source/core/workers/WorkerThread.cpp
index 0c888e3..0a97731 100644
--- a/Source/core/workers/WorkerThread.cpp
+++ b/Source/core/workers/WorkerThread.cpp
@@ -244,8 +244,4 @@
     return m_threadID == currentThread();
 }
 
-class ReleaseFastMallocFreeMemoryTask : public ExecutionContextTask {
-    virtual void performTask(ExecutionContext*) OVERRIDE { WTF::releaseFastMallocFreeMemory(); }
-};
-
 } // namespace WebCore
diff --git a/Source/core/xml/DocumentXPathEvaluator.cpp b/Source/core/xml/DocumentXPathEvaluator.cpp
index 3e9b489..a5181ef 100644
--- a/Source/core/xml/DocumentXPathEvaluator.cpp
+++ b/Source/core/xml/DocumentXPathEvaluator.cpp
@@ -77,6 +77,7 @@
 void DocumentXPathEvaluator::trace(Visitor* visitor)
 {
     visitor->trace(m_xpathEvaluator);
+    DocumentSupplement::trace(visitor);
 }
 
 } // namespace WebCore
diff --git a/Source/core/xml/XMLHttpRequest.cpp b/Source/core/xml/XMLHttpRequest.cpp
index 245bbc5..783654b 100644
--- a/Source/core/xml/XMLHttpRequest.cpp
+++ b/Source/core/xml/XMLHttpRequest.cpp
@@ -447,6 +447,7 @@
 
     if (m_async || (m_state <= OPENED || m_state == DONE)) {
         TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "XHRReadyStateChange", "data", InspectorXhrReadyStateChangeEvent::data(executionContext(), this));
+        TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline.stack"), "CallStack", "stack", InspectorCallStackEvent::currentCallStack());
         ProgressEventAction flushAction = DoNotFlushProgressEvent;
         if (m_state == DONE) {
             if (m_error)
@@ -455,17 +456,20 @@
                 flushAction = FlushProgressEvent;
         }
         m_progressEventThrottle.dispatchReadyStateChangeEvent(XMLHttpRequestProgressEvent::create(EventTypeNames::readystatechange), flushAction);
+        TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "UpdateCounters", "data", InspectorUpdateCountersEvent::data());
     }
 
     InspectorInstrumentation::didDispatchXHRReadyStateChangeEvent(cookie);
     if (m_state == DONE && !m_error) {
         {
             TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "XHRLoad", "data", InspectorXhrLoadEvent::data(executionContext(), this));
+            TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline.stack"), "CallStack", "stack", InspectorCallStackEvent::currentCallStack());
             InspectorInstrumentationCookie cookie = InspectorInstrumentation::willDispatchXHRLoadEvent(executionContext(), this);
             dispatchThrottledProgressEventSnapshot(EventTypeNames::load);
             InspectorInstrumentation::didDispatchXHRLoadEvent(cookie);
         }
         dispatchThrottledProgressEventSnapshot(EventTypeNames::loadend);
+        TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "UpdateCounters", "data", InspectorUpdateCountersEvent::data());
     }
 }
 
diff --git a/Source/core/xml/XMLHttpRequest.idl b/Source/core/xml/XMLHttpRequest.idl
index 3f179a8..39b0209 100644
--- a/Source/core/xml/XMLHttpRequest.idl
+++ b/Source/core/xml/XMLHttpRequest.idl
@@ -40,7 +40,7 @@
     WillBeGarbageCollected,
     ActiveDOMObject,
     CustomConstructor(optional XMLHttpRequestOptions options),
-    GlobalContext=Window&WorkerGlobalScope,
+    Exposed=Window&Worker
 ] interface XMLHttpRequest : XMLHttpRequestEventTarget {
     // event handler attributes
     attribute EventHandler onreadystatechange;
diff --git a/Source/core/xml/XSLImportRule.cpp b/Source/core/xml/XSLImportRule.cpp
index 48b1e4b..ca80291 100644
--- a/Source/core/xml/XSLImportRule.cpp
+++ b/Source/core/xml/XSLImportRule.cpp
@@ -40,8 +40,10 @@
 
 XSLImportRule::~XSLImportRule()
 {
+#if !ENABLE(OILPAN)
     if (m_styleSheet)
         m_styleSheet->setParentStyleSheet(0);
+#endif
 
     if (m_resource)
         m_resource->removeClient(this);
@@ -112,4 +114,10 @@
     }
 }
 
+void XSLImportRule::trace(Visitor* visitor)
+{
+    visitor->trace(m_parentStyleSheet);
+    visitor->trace(m_styleSheet);
+}
+
 } // namespace WebCore
diff --git a/Source/core/xml/XSLImportRule.h b/Source/core/xml/XSLImportRule.h
index 3521e69..70fbc8f 100644
--- a/Source/core/xml/XSLImportRule.h
+++ b/Source/core/xml/XSLImportRule.h
@@ -33,16 +33,17 @@
 
 class XSLStyleSheetResource;
 
-class XSLImportRule FINAL : private StyleSheetResourceClient {
-    WTF_MAKE_FAST_ALLOCATED;
+class XSLImportRule FINAL : public NoBaseWillBeGarbageCollectedFinalized<XSLImportRule>, private StyleSheetResourceClient {
+    WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED;
 public:
-    static PassOwnPtr<XSLImportRule> create(XSLStyleSheet* parentSheet, const String& href)
+    static PassOwnPtrWillBeRawPtr<XSLImportRule> create(XSLStyleSheet* parentSheet, const String& href)
     {
         ASSERT(RuntimeEnabledFeatures::xsltEnabled());
-        return adoptPtr(new XSLImportRule(parentSheet, href));
+        return adoptPtrWillBeNoop(new XSLImportRule(parentSheet, href));
     }
 
     virtual ~XSLImportRule();
+    virtual void trace(Visitor*);
 
     const String& href() const { return m_strHref; }
     XSLStyleSheet* styleSheet() const { return m_styleSheet.get(); }
@@ -58,12 +59,9 @@
 
     virtual void setXSLStyleSheet(const String& href, const KURL& baseURL, const String& sheet) OVERRIDE;
 
-    // FIXME: Oilpan: This raw pointer is safe and has to be kept raw at this
-    // point to avoid cycles. When XSLImportRule is moved to the oilpan heap
-    // it should be a Member and be traced.
-    XSLStyleSheet* m_parentStyleSheet;
+    RawPtrWillBeMember<XSLStyleSheet> m_parentStyleSheet;
     String m_strHref;
-    RefPtrWillBePersistent<XSLStyleSheet> m_styleSheet;
+    RefPtrWillBeMember<XSLStyleSheet> m_styleSheet;
     ResourcePtr<XSLStyleSheetResource> m_resource;
     bool m_loading;
 };
diff --git a/Source/core/xml/XSLStyleSheet.h b/Source/core/xml/XSLStyleSheet.h
index fb80c6a..46586f8 100644
--- a/Source/core/xml/XSLStyleSheet.h
+++ b/Source/core/xml/XSLStyleSheet.h
@@ -95,7 +95,7 @@
     virtual String href() const OVERRIDE { return m_originalURL; }
     virtual String title() const OVERRIDE { return emptyString(); }
 
-    virtual void clearOwnerNode() OVERRIDE { m_ownerNode = 0; }
+    virtual void clearOwnerNode() OVERRIDE { m_ownerNode = nullptr; }
     virtual KURL baseURL() const OVERRIDE { return m_finalURL; }
     virtual bool isLoading() const OVERRIDE;
 
@@ -105,12 +105,12 @@
     XSLStyleSheet(Node* parentNode, const String& originalURL, const KURL& finalURL, bool embedded);
     XSLStyleSheet(XSLImportRule* parentImport, const String& originalURL, const KURL& finalURL);
 
-    Node* m_ownerNode;
+    RawPtrWillBeMember<Node> m_ownerNode;
     String m_originalURL;
     KURL m_finalURL;
     bool m_isDisabled;
 
-    Vector<OwnPtr<XSLImportRule> > m_children;
+    WillBeHeapVector<OwnPtrWillBeMember<XSLImportRule> > m_children;
 
     bool m_embedded;
     bool m_processed;
diff --git a/Source/core/xml/XSLStyleSheetLibxslt.cpp b/Source/core/xml/XSLStyleSheetLibxslt.cpp
index ccb66de..b4a5679 100644
--- a/Source/core/xml/XSLStyleSheetLibxslt.cpp
+++ b/Source/core/xml/XSLStyleSheetLibxslt.cpp
@@ -39,7 +39,7 @@
 namespace WebCore {
 
 XSLStyleSheet::XSLStyleSheet(XSLImportRule* parentRule, const String& originalURL, const KURL& finalURL)
-    : m_ownerNode(0)
+    : m_ownerNode(nullptr)
     , m_originalURL(originalURL)
     , m_finalURL(finalURL)
     , m_isDisabled(false)
@@ -70,11 +70,12 @@
 {
     if (!m_stylesheetDocTaken)
         xmlFreeDoc(m_stylesheetDoc);
-
+#if !ENABLE(OILPAN)
     for (unsigned i = 0; i < m_children.size(); ++i) {
         ASSERT(m_children.at(i)->parentStyleSheet() == this);
         m_children.at(i)->setParentStyleSheet(0);
     }
+#endif
 }
 
 bool XSLStyleSheet::isLoading() const
@@ -216,7 +217,7 @@
 
 void XSLStyleSheet::loadChildSheet(const String& href)
 {
-    OwnPtr<XSLImportRule> childRule = XSLImportRule::create(this, href);
+    OwnPtrWillBeRawPtr<XSLImportRule> childRule = XSLImportRule::create(this, href);
     XSLImportRule* c = childRule.get();
     m_children.append(childRule.release());
     c->loadSheet();
@@ -305,7 +306,10 @@
 
 void XSLStyleSheet::trace(Visitor* visitor)
 {
+    visitor->trace(m_ownerNode);
+    visitor->trace(m_children);
     visitor->trace(m_parentStyleSheet);
+    StyleSheet::trace(visitor);
 }
 
 } // namespace WebCore
diff --git a/Source/core/xml/parser/XMLDocumentParser.cpp b/Source/core/xml/parser/XMLDocumentParser.cpp
index 60b4d72..1d27a20 100644
--- a/Source/core/xml/parser/XMLDocumentParser.cpp
+++ b/Source/core/xml/parser/XMLDocumentParser.cpp
@@ -1036,14 +1036,15 @@
     ASSERT(!m_pendingScript);
     m_requestingScript = true;
 
-    if (scriptLoader->prepareScript(m_scriptStartPosition, ScriptLoader::AllowLegacyTypeInTypeAttribute)) {
+    ScriptPrep prep = scriptLoader->prepareScript(m_scriptStartPosition, ScriptLoader::AllowLegacyTypeInTypeAttribute);
+    if (prep.succeeded()) {
         // FIXME: Script execution should be shared between
         // the libxml2 and Qt XMLDocumentParser implementations.
 
         if (scriptLoader->readyToBeParserExecuted()) {
             scriptLoader->executeScript(ScriptSourceCode(scriptLoader->scriptContent(), document()->url(), m_scriptStartPosition));
         } else if (scriptLoader->willBeParserExecuted()) {
-            m_pendingScript = scriptLoader->resource();
+            m_pendingScript = prep.resource();
             m_scriptElement = element;
             m_pendingScript->addClient(this);